From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 00:23:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 654D21065672; Sun, 1 Jan 2012 00:23:32 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53BCE8FC1A; Sun, 1 Jan 2012 00:23: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 q010NWgf089493; Sun, 1 Jan 2012 00:23:32 GMT (envelope-from jgh@svn.freebsd.org) Received: (from jgh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q010NWRk089491; Sun, 1 Jan 2012 00:23:32 GMT (envelope-from jgh@svn.freebsd.org) Message-Id: <201201010023.q010NWRk089491@svn.freebsd.org> From: Jason Helfman Date: Sun, 1 Jan 2012 00:23: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: r229164 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 00:23:32 -0000 Author: jgh (ports committer) Date: Sun Jan 1 00:23:32 2012 New Revision: 229164 URL: http://svn.freebsd.org/changeset/base/229164 Log: - add myself to the calendar (jgh) Approved by: crees (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Dec 31 23:56:58 2011 (r229163) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Jan 1 00:23:32 2012 (r229164) @@ -48,6 +48,7 @@ 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 +02/03 Jason Helfman born in Royal Oak, Michigan, United States, 1972 02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/10 David Greenman born in Portland, Oregon, United States, 1968 From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 00:32:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00F20106564A; Sun, 1 Jan 2012 00:32:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 82BFD8FC08; Sun, 1 Jan 2012 00:32:45 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3EC9C25D389F; Sun, 1 Jan 2012 00:32:44 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 67D7DBD73A8; Sun, 1 Jan 2012 00:32:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id QY3RWLnjXIGf; Sun, 1 Jan 2012 00:32:41 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A8DA7BD73A6; Sun, 1 Jan 2012 00:32:41 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20111231164830.GI90831@alchemy.franken.de> Date: Sun, 1 Jan 2012 00:32:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <96FE9A64-A995-42F6-9F71-7B20F5CF5F1D@lists.zabbadoz.net> References: <201112302122.pBULMAuS031216@svn.freebsd.org> <20111231155931.GH90831@alchemy.franken.de> <20111231164830.GI90831@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229032 - head/sys/modules/cfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 00:32:46 -0000 On 31. Dec 2011, at 16:48 , Marius Strobl wrote: > On Sat, Dec 31, 2011 at 04:26:04PM +0000, Bjoern A. Zeeb wrote: >>=20 >> On 31. Dec 2011, at 15:59 , Marius Strobl wrote: >>=20 >>> On Sat, Dec 31, 2011 at 02:05:40PM +0000, Bjoern A. Zeeb wrote: >>>>=20 >>>> On 30. Dec 2011, at 21:22 , Marius Strobl wrote: >>>>=20 >>>>> Author: marius >>>>> Date: Fri Dec 30 21:22:10 2011 >>>>> New Revision: 229032 >>>>> URL: http://svn.freebsd.org/changeset/base/229032 >>>>>=20 >>>>> Log: >>>>> Add header required by cfi_bus_fdt.c. >>>>>=20 >>>>> Modified: >>>>> head/sys/modules/cfi/Makefile >>>>>=20 >>>>=20 >>>> This (most likely) broke at least the arm KB920X config: >>>>=20 >>>> In file included from @/arm/xscale/ixp425/ixp425var.h:47, >>>> from = /scratch/tmp/bz/head.universe/sys/modules/cfi/../../dev/cfi/cfi_bus_ixp4xx= .c:45: >>>> @/dev/pci/pcivar.h:219:20: error: pci_if.h: No such file or = directory >>>> mkdep: compile failed >>>>=20 >>>=20 >>> It didn't, the original r228981 just reveals a problem with = ixp425var.h. >>> The funny thing is that while it's pretty much clear from your above >>> snippet what's going on I can't reproduce this, also not part of an >>> universe build and apparently also not the tinderbox. >>=20 >> The tinderbox does not build it if you look at the details;-) >=20 > I was referring to the absence of any new breakage report by the > tinderbox after r229032, which IMO should have occurred by now. Oh, it's been arm not mips; yeah it should have built that and failed. Not sure why not. make universe is happy now at least as well. Thanks a lot! --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 01:08:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014AB106566C; Sun, 1 Jan 2012 01:08:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E43F98FC08; Sun, 1 Jan 2012 01:08:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0118pwC090838; Sun, 1 Jan 2012 01:08:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0118pCt090836; Sun, 1 Jan 2012 01:08:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201010108.q0118pCt090836@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jan 2012 01:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229165 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 01:08:52 -0000 Author: adrian Date: Sun Jan 1 01:08:51 2012 New Revision: 229165 URL: http://svn.freebsd.org/changeset/base/229165 Log: If frames are dumped out of the queue, let's at least see what they are. This shows that the majority of the weird traffic I see here are probe frames that haven't been sent out, but I can also trigger this condition by doing ICMP w/ -i 0.3 - enough to trigger the TX during actual scanning, but not fast enough to stop scanning from occuring. PR: kern/163689 Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Jan 1 00:23:32 2012 (r229164) +++ head/sys/dev/ath/if_ath_tx.c Sun Jan 1 01:08:51 2012 (r229165) @@ -2405,6 +2405,12 @@ ath_tx_tid_drain(struct ath_softc *sc, s tid->hwq_depth, tid->incomp, tid->baw_head, tid->baw_tail, tap == NULL ? -1 : tap->txa_start, ni->ni_txseqs[tid->tid]); + + /* XXX Dump the frame, see what it is? */ + ieee80211_dump_pkt(ni->ni_ic, + mtod(bf->bf_m, const uint8_t *), + bf->bf_m->m_len, 0, -1); + t = 1; } From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 02:04:43 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80274106564A; Sun, 1 Jan 2012 02:04:43 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 430708FC13; Sun, 1 Jan 2012 02:04:43 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0124gxl094656; Sat, 31 Dec 2011 21:04:42 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0124g0R094655; Sat, 31 Dec 2011 21:04:42 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sat, 31 Dec 2011 21:04:42 -0500 From: David Schultz To: Dimitry Andric Message-ID: <20120101020442.GA94452@zim.MIT.EDU> Mail-Followup-To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112221503.pBMF3m0w021930@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201112221503.pBMF3m0w021930@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r228801 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 02:04:43 -0000 On Thu, Dec 22, 2011, Dimitry Andric wrote: > Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default > for our gcc since more than three years (see r181534, which is also in > stable/9 and stable/8). This flag used to be for the benefit of the old > in-kernel math emulator, which was removed more than eight years ago. Quite the opposite, actually. gcc/freebsd used to be hard-coded to use -mno-fancy-math-387 by default, which was really only appropriate for FPUless x86 chips back when FreeBSD supported them. The makefile setting overrides the old gcc default. The flag isn't "for the benefit of the in-kernel math emulator"; it's actually to reap the benefits of *not* having an in-kernel math emulator! Do you know if clang has the correct default here, or if it picked up trunk gcc's bogus default? It doesn't seem to support the flag to change the behavior, and it seems to default to -mno-fancy-math-387. (The flag should only affect things when -ffast-math is also specified.) From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 02:54:25 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A9B106566C; Sun, 1 Jan 2012 02:54:25 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 958498FC0A; Sun, 1 Jan 2012 02:54:25 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q012sMAl094870; Sat, 31 Dec 2011 21:54:22 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q012sMuP094869; Sat, 31 Dec 2011 21:54:22 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sat, 31 Dec 2011 21:54:22 -0500 From: David Schultz To: Ed Schouten Message-ID: <20120101025422.GD94452@zim.MIT.EDU> Mail-Followup-To: Ed Schouten , Steve Kargl , Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112291441.pBTEfI8l060127@svn.freebsd.org> <4EFCA6A6.6080103@FreeBSD.org> <20111229183213.GK1895@hoeg.nl> <20111229184934.GA47885@troutmask.apl.washington.edu> <20111229192359.GM1895@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111229192359.GM1895@hoeg.nl> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Andreas Tobler , Steve Kargl Subject: Re: svn commit: r228955 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 02:54:25 -0000 On Thu, Dec 29, 2011, Ed Schouten wrote: > Hi Steve, > > * Steve Kargl , 20111229 19:49: > > Are you going to submit a bug report to GCC? Because, as of now, > > you've broken my ability to do development work on bleeding edge > > freebsd and bleeding edge gcc. > > Here you go: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51705 > > In the future, could you write such bug reports yourself? I am really > not that interested in GCC's development process. I'm out of town and don't remember the details of this, but is there a reason we couldn't simply have an appropriate #ifdef that uses __attribute((__noreturn__)) instead of [[noreturn]]? We have plenty of ifdefs in the tree already to work around deficiencies in various compilers. Saying "it's the compiler's fault and we're not going to work around it" is a significant departure from historical precedent, and it punishes the wrong people. Easier than arguing with the GNU folks about fixing it, too... From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 03:34:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 466C0106564A; Sun, 1 Jan 2012 03:34:16 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 03C2D8FC13; Sun, 1 Jan 2012 03:34:15 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q013YCkI062798; Sat, 31 Dec 2011 19:34:12 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q013YCcN062797; Sat, 31 Dec 2011 19:34:12 -0800 (PST) (envelope-from sgk) Date: Sat, 31 Dec 2011 19:34:12 -0800 From: Steve Kargl To: Ed Schouten , Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120101033412.GB62729@troutmask.apl.washington.edu> References: <201112291441.pBTEfI8l060127@svn.freebsd.org> <4EFCA6A6.6080103@FreeBSD.org> <20111229183213.GK1895@hoeg.nl> <20111229184934.GA47885@troutmask.apl.washington.edu> <20111229192359.GM1895@hoeg.nl> <20120101025422.GD94452@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120101025422.GD94452@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r228955 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 03:34:16 -0000 On Sat, Dec 31, 2011 at 09:54:22PM -0500, David Schultz wrote: > On Thu, Dec 29, 2011, Ed Schouten wrote: > > Hi Steve, > > > > * Steve Kargl , 20111229 19:49: > > > Are you going to submit a bug report to GCC? Because, as of now, > > > you've broken my ability to do development work on bleeding edge > > > freebsd and bleeding edge gcc. > > > > Here you go: > > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51705 > > > > In the future, could you write such bug reports yourself? I am really > > not that interested in GCC's development process. > > I'm out of town and don't remember the details of this, but is there a > reason we couldn't simply have an appropriate #ifdef that uses > __attribute((__noreturn__)) instead of [[noreturn]]? We have plenty > of ifdefs in the tree already to work around deficiencies in various > compilers. Saying "it's the compiler's fault and we're not going to > work around it" is a significant departure from historical precedent, > and it punishes the wrong people. Easier than arguing with the GNU > folks about fixing it, too... I've already sent a patch to GCC to work around the problem. FreeBSD is still considered to be a primary platform for GCC, so problem is a P1 issue in bugzilla. Unfortunately, I think that there are no active FreeBSD gcc maintainer. This means the patch may linger in bugzilla for awhile. -- Steve From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 09:12:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5C09106564A; Sun, 1 Jan 2012 09:12:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A37FA8FC08; Sun, 1 Jan 2012 09:12: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 q019CMj2005792; Sun, 1 Jan 2012 09:12:22 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q019CM1Z005789; Sun, 1 Jan 2012 09:12:22 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201010912.q019CM1Z005789@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 1 Jan 2012 09:12: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: r229168 - head/sys/mips/cavium/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 09:12:22 -0000 Author: gonzo Date: Sun Jan 1 09:12:21 2012 New Revision: 229168 URL: http://svn.freebsd.org/changeset/base/229168 Log: - Properly set IRQ handlers for all USB ports Modified: head/sys/mips/cavium/usb/octusb.h head/sys/mips/cavium/usb/octusb_octeon.c Modified: head/sys/mips/cavium/usb/octusb.h ============================================================================== --- head/sys/mips/cavium/usb/octusb.h Sun Jan 1 03:38:36 2012 (r229167) +++ head/sys/mips/cavium/usb/octusb.h Sun Jan 1 09:12:21 2012 (r229168) @@ -29,14 +29,7 @@ #define _OCTUSB_H_ #define OCTUSB_MAX_DEVICES MIN(USB_MAX_DEVICES, 64) -/* - * The second port is on a different IRQ and so we disable it for now. - */ -#if 1 -#define OCTUSB_MAX_PORTS 1 /* hardcoded */ -#else #define OCTUSB_MAX_PORTS 2 /* hardcoded */ -#endif #define OCTUSB_MAX_FIXUP 4096 /* bytes */ #define OCTUSB_INTR_ENDPT 0x01 @@ -121,8 +114,8 @@ struct octusb_softc { struct usb_device *sc_devices[OCTUSB_MAX_DEVICES]; - struct resource *sc_irq_res; - void *sc_intr_hdl; + struct resource *sc_irq_res[OCTUSB_MAX_PORTS]; + void *sc_intr_hdl[OCTUSB_MAX_PORTS]; struct octusb_port sc_port[OCTUSB_MAX_PORTS]; device_t sc_dev; Modified: head/sys/mips/cavium/usb/octusb_octeon.c ============================================================================== --- head/sys/mips/cavium/usb/octusb_octeon.c Sun Jan 1 03:38:36 2012 (r229167) +++ head/sys/mips/cavium/usb/octusb_octeon.c Sun Jan 1 09:12:21 2012 (r229168) @@ -94,6 +94,8 @@ octusb_octeon_attach(device_t dev) struct octusb_octeon_softc *sc = device_get_softc(dev); int err; int rid; + int nports; + int i; /* setup controller interface softc */ @@ -107,12 +109,29 @@ octusb_octeon_attach(device_t dev) USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); } - rid = 0; - sc->sc_dci.sc_irq_res = - bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - CVMX_IRQ_USB, CVMX_IRQ_USB, 1, RF_ACTIVE); - if (!(sc->sc_dci.sc_irq_res)) { - goto error; + nports = cvmx_usb_get_num_ports(); + if (nports > OCTUSB_MAX_PORTS) + panic("octusb: too many USB ports %d", nports); + for (i = 0; i < nports; i++) { + rid = 0; + sc->sc_dci.sc_irq_res[i] = + bus_alloc_resource(dev, SYS_RES_IRQ, &rid, + CVMX_IRQ_USB0 + i, CVMX_IRQ_USB0 + i, 1, RF_ACTIVE); + if (!(sc->sc_dci.sc_irq_res[i])) { + goto error; + } + +#if (__FreeBSD_version >= 700031) + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res[i], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl[i]); +#else + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res[i], INTR_TYPE_BIO | INTR_MPSAFE, + (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl[i]); +#endif + if (err) { + sc->sc_dci.sc_intr_hdl[i] = NULL; + goto error; + } } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); @@ -121,17 +140,7 @@ octusb_octeon_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif - if (err) { - sc->sc_dci.sc_intr_hdl = NULL; - goto error; - } + err = octusb_init(&sc->sc_dci); if (!err) { err = device_probe_and_attach(sc->sc_dci.sc_bus.bdev); @@ -152,6 +161,8 @@ octusb_octeon_detach(device_t dev) struct octusb_octeon_softc *sc = device_get_softc(dev); device_t bdev; int err; + int nports; + int i; if (sc->sc_dci.sc_bus.bdev) { bdev = sc->sc_dci.sc_bus.bdev; @@ -161,20 +172,26 @@ octusb_octeon_detach(device_t dev) /* during module unload there are lots of children leftover */ device_delete_children(dev); - if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) { + if (sc->sc_dci.sc_irq_res[0] && sc->sc_dci.sc_intr_hdl[0]) /* - * only call octusb_octeon_uninit() after octusb_octeon_init() - */ + * only call octusb_octeon_uninit() after octusb_octeon_init() + */ octusb_uninit(&sc->sc_dci); - err = bus_teardown_intr(dev, sc->sc_dci.sc_irq_res, - sc->sc_dci.sc_intr_hdl); - sc->sc_dci.sc_intr_hdl = NULL; - } - if (sc->sc_dci.sc_irq_res) { - bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->sc_dci.sc_irq_res); - sc->sc_dci.sc_irq_res = NULL; + nports = cvmx_usb_get_num_ports(); + if (nports > OCTUSB_MAX_PORTS) + panic("octusb: too many USB ports %d", nports); + for (i = 0; i < nports; i++) { + if (sc->sc_dci.sc_irq_res[0] && sc->sc_dci.sc_intr_hdl[0]) { + err = bus_teardown_intr(dev, sc->sc_dci.sc_irq_res[i], + sc->sc_dci.sc_intr_hdl[i]); + sc->sc_dci.sc_intr_hdl[i] = NULL; + } + if (sc->sc_dci.sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->sc_dci.sc_irq_res[i]); + sc->sc_dci.sc_irq_res[i] = NULL; + } } usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 09:29:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3761106564A; Sun, 1 Jan 2012 09:29:26 +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 6F6138FC08; Sun, 1 Jan 2012 09:29:26 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id A62A42A28E69; Sun, 1 Jan 2012 10:29:25 +0100 (CET) Date: Sun, 1 Jan 2012 10:29:25 +0100 From: Ed Schouten To: Steve Kargl , Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120101092925.GZ1895@hoeg.nl> References: <201112291441.pBTEfI8l060127@svn.freebsd.org> <4EFCA6A6.6080103@FreeBSD.org> <20111229183213.GK1895@hoeg.nl> <20111229184934.GA47885@troutmask.apl.washington.edu> <20111229192359.GM1895@hoeg.nl> <20120101025422.GD94452@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N6OI5UwltL9FF6Nb" Content-Disposition: inline In-Reply-To: <20120101025422.GD94452@zim.MIT.EDU> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r228955 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 09:29:26 -0000 --N6OI5UwltL9FF6Nb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable David, * David Schultz , 20120101 03:54: > I'm out of town and don't remember the details of this, but is there a > reason we couldn't simply have an appropriate #ifdef that uses > __attribute((__noreturn__)) instead of [[noreturn]]? We have plenty > of ifdefs in the tree already to work around deficiencies in various > compilers. Saying "it's the compiler's fault and we're not going to > work around it" is a significant departure from historical precedent, > and it punishes the wrong people. Easier than arguing with the GNU > folks about fixing it, too... Right now GCC 4.7 is still an unreleased piece of software. If GCC 4.7 was a released piece of software, I would of course agree that we should add the workaround. The problem isn't that GCC 4.7 doesn't support [[noreturn]]. The problem is that GCC only implements parts of C++11, yet it forces the compiler into C++11 mode while bootstrapping. Even if we add a workaround for this in sys/cdefs.h, we can likely never ever get rid of it. Because if someone wants to install GCC 4.7 on a FreeBSD 14.0 box in 2020 to build an old piece of software, he still needs the workaround. But there's nothing serious going on here. The issue is already discussed in GCC Bugzilla and there is a patch that fixes the build. Let's just wait to see what happens. --=20 Ed Schouten WWW: http://80386.nl/ --N6OI5UwltL9FF6Nb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPACd1AAoJEG5e2P40kaK7XUwP/1V1bGGtT9AnlJ9oX/ITiSu0 rTwOoSMGSPIN+xyilNPiJR30RaESAGPWhAwC2DmakUrFRw+mMmGlvkrlHv/cqKGu vZOWd+7tbOIShjEsEeOZZXVmAZXar7BtfKPhwpY/zGdiniOaLAAbFoa7yzCCMu1a xpUwgVC6SAGW2vik3jsqU0KFR+6iWVnw9U7CC5HiYkcUdJU2wdr/io7tz737t4iJ 8PhJh2t829Oh8oh4euZgHWi9yIjU4widD7poZX2TAtPVclDfFaDyWL5RTl2HNp8b rCqrNL/Mk/+Bu2fCcs2M2aynWA4CkbIi7EYFuiZkvdA5fXht8zie+0bDCTcbDk5v AGbylRSDy9QugueFmrk1nE7Ba5zYu9v+Jj2e2XYIqQuFsdPZljEgd9afDxmittQB gFpyrAaYikZMfr97V1+9L/ndk/0++9GnlcDXxkJtQ41vhb3Ar/8eq1zTC+nya1cc Wuw2fRqKet3f3zxTmy4VlOHOqMCCDhvYOhmy5JMYggur1PFHFqtVst7iwTTnO9Ut xUfds9BPB3Zd4cC+MjVHdtP4OknwrhveLCk/TeyxBJE3FHFwRvzi+hMcOgo4fZBN VLgWx1Grdr6OLomLZaXRNnK1WzaECQTapKfs2QHRGoexzy3+z2L6wtjkI85oYGpF L3D6F+hZpd8QRtsDI1IN =4pLG -----END PGP SIGNATURE----- --N6OI5UwltL9FF6Nb-- From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 15:56:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A4D106566B; Sun, 1 Jan 2012 15:56:16 +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 BCCB28FC0C; Sun, 1 Jan 2012 15:56: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 q01FuF5s019344; Sun, 1 Jan 2012 15:56:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01FuF5V019342; Sun, 1 Jan 2012 15:56:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201011556.q01FuF5V019342@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 1 Jan 2012 15:56: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: r229169 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 15:56:16 -0000 Author: nwhitehorn Date: Sun Jan 1 15:56:15 2012 New Revision: 229169 URL: http://svn.freebsd.org/changeset/base/229169 Log: Instead of forcing -O1 on PowerPC for LLVM and clang, fix the actual problem by adding -fno-strict-aliasing to CFLAGS. Since this is a global issue that just happened to manifest on PowerPC, add this to CFLAGS unconditionally. MFC after: 1 week Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sun Jan 1 09:12:21 2012 (r229168) +++ head/lib/clang/clang.build.mk Sun Jan 1 15:56:15 2012 (r229169) @@ -8,10 +8,8 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG -# Correct for gcc miscompilation when compiling on PPC with -O2 -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -O1 -.endif +# LLVM is not strict aliasing safe as of 12/31/2011 +CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\" From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 16:11:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10792106564A; Sun, 1 Jan 2012 16:11:12 +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 C165A8FC16; Sun, 1 Jan 2012 16:11:11 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e165:a097:747b:93eb] (unknown [IPv6:2001:7b8:3a7:0:e165:a097:747b:93eb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E12B45C37; Sun, 1 Jan 2012 17:11:10 +0100 (CET) Message-ID: <4F00859C.5020205@FreeBSD.org> Date: Sun, 01 Jan 2012 17:11:08 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Nathan Whitehorn References: <201201011556.q01FuF5V019342@svn.freebsd.org> In-Reply-To: <201201011556.q01FuF5V019342@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229169 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 16:11:12 -0000 On 2012-01-01 16:56, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Jan 1 15:56:15 2012 > New Revision: 229169 > URL: http://svn.freebsd.org/changeset/base/229169 > > Log: > Instead of forcing -O1 on PowerPC for LLVM and clang, fix the actual > problem by adding -fno-strict-aliasing to CFLAGS. Since this is a global > issue that just happened to manifest on PowerPC, add this to CFLAGS > unconditionally. > > MFC after: 1 week > > Modified: > head/lib/clang/clang.build.mk > > Modified: head/lib/clang/clang.build.mk > ============================================================================== > --- head/lib/clang/clang.build.mk Sun Jan 1 09:12:21 2012 (r229168) > +++ head/lib/clang/clang.build.mk Sun Jan 1 15:56:15 2012 (r229169) > @@ -8,10 +8,8 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG > -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ > -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG > > -# Correct for gcc miscompilation when compiling on PPC with -O2 > -.if ${MACHINE_CPUARCH} == "powerpc" > -CFLAGS+= -O1 > -.endif > +# LLVM is not strict aliasing safe as of 12/31/2011 > +CFLAGS+= -fno-strict-aliasing Actually, LLVM is strict-aliasing safe, but not for gcc 4.2.1. :) There is some sort of problem with gcc's optimizer that made a few LLVM tests fails mysteriously in the past. At a certain point, these problems went away for x86, but apparently not for non-x86... In any case, this option should only have to be added when the compiler is base gcc. From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 16:24:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 574EC106564A; Sun, 1 Jan 2012 16:24:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 2342C8FC14; Sun, 1 Jan 2012 16:24:47 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LX400000O9B2C00@smtpauth3.wiscmail.wisc.edu>; Sun, 01 Jan 2012 10:24:47 -0600 (CST) Received: from comporellon.tachypleus.net ([unknown] [76.210.61.211]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LX400F6MO99WL20@smtpauth3.wiscmail.wisc.edu>; Sun, 01 Jan 2012 10:24:46 -0600 (CST) Date: Sun, 01 Jan 2012 10:24:45 -0600 From: Nathan Whitehorn In-reply-to: <4F00859C.5020205@FreeBSD.org> To: Dimitry Andric Message-id: <4F0088CD.5010202@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.61.211 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.1.1.161517, SenderIP=76.210.61.211 References: <201201011556.q01FuF5V019342@svn.freebsd.org> <4F00859C.5020205@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111113 Thunderbird/8.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229169 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 16:24:48 -0000 On 01/01/12 10:11, Dimitry Andric wrote: > On 2012-01-01 16:56, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sun Jan 1 15:56:15 2012 >> New Revision: 229169 >> URL: http://svn.freebsd.org/changeset/base/229169 >> >> Log: >> Instead of forcing -O1 on PowerPC for LLVM and clang, fix the actual >> problem by adding -fno-strict-aliasing to CFLAGS. Since this is a >> global >> issue that just happened to manifest on PowerPC, add this to CFLAGS >> unconditionally. >> >> MFC after: 1 week >> >> Modified: >> head/lib/clang/clang.build.mk >> >> Modified: head/lib/clang/clang.build.mk >> ============================================================================== >> >> --- head/lib/clang/clang.build.mk Sun Jan 1 09:12:21 2012 >> (r229168) >> +++ head/lib/clang/clang.build.mk Sun Jan 1 15:56:15 2012 >> (r229169) >> @@ -8,10 +8,8 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG >> -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ >> -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG >> >> -# Correct for gcc miscompilation when compiling on PPC with -O2 >> -.if ${MACHINE_CPUARCH} == "powerpc" >> -CFLAGS+= -O1 >> -.endif >> +# LLVM is not strict aliasing safe as of 12/31/2011 >> +CFLAGS+= -fno-strict-aliasing > > Actually, LLVM is strict-aliasing safe, but not for gcc 4.2.1. :) > > There is some sort of problem with gcc's optimizer that made a few LLVM > tests fails mysteriously in the past. At a certain point, these > problems went away for x86, but apparently not for non-x86... > > In any case, this option should only have to be added when the compiler > is base gcc. Ah, interesting. I'm not quite sure how to express "is compiler base GCC", but I'm guessing you have more experience there. Would you mind fixing that? -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 16:49:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E6E7106564A; Sun, 1 Jan 2012 16:49:36 +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 E10C48FC0A; Sun, 1 Jan 2012 16:49:35 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e165:a097:747b:93eb] (unknown [IPv6:2001:7b8:3a7:0:e165:a097:747b:93eb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3365A5C37; Sun, 1 Jan 2012 17:49:35 +0100 (CET) Message-ID: <4F008EA0.3080800@FreeBSD.org> Date: Sun, 01 Jan 2012 17:49:36 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112221503.pBMF3m0w021930@svn.freebsd.org> <20120101020442.GA94452@zim.MIT.EDU> In-Reply-To: <20120101020442.GA94452@zim.MIT.EDU> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r228801 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 16:49:36 -0000 On 2012-01-01 03:04, David Schultz wrote: > On Thu, Dec 22, 2011, Dimitry Andric wrote: >> Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default >> for our gcc since more than three years (see r181534, which is also in >> stable/9 and stable/8). This flag used to be for the benefit of the old >> in-kernel math emulator, which was removed more than eight years ago. > > Quite the opposite, actually. gcc/freebsd used to be hard-coded to > use -mno-fancy-math-387 by default, which was really only appropriate for > FPUless x86 chips back when FreeBSD supported them. The makefile > setting overrides the old gcc default. The flag isn't "for the > benefit of the in-kernel math emulator"; it's actually to reap the > benefits of *not* having an in-kernel math emulator! > > Do you know if clang has the correct default here, or if it picked up > trunk gcc's bogus default? It doesn't seem to support the flag to > change the behavior, and it seems to default to -mno-fancy-math-387. > (The flag should only affect things when -ffast-math is also specified.) As far as I can see, clang always generates calls to sin(), cos() etc. It never inlines them to direct 387 instructions. Isn't that what we want? In any case, I don't see a quick way of getting it to emit 387 instructions directly. It simply looks like it is not supported. The -funsafe-math-optimizations is not recognized, and the -ffast-math option is accepted, but ignored. From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 17:13:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C9F1065672; Sun, 1 Jan 2012 17:13:26 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 077D58FC0C; Sun, 1 Jan 2012 17:13:25 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id q01HDO1v074168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 1 Jan 2012 18:13:24 +0100 (CET) (envelope-from uqs@freebsd.org) Date: Sun, 1 Jan 2012 18:13:24 +0100 From: Ulrich Spoerlein To: Harti Brandt Message-ID: <20120101171324.GM83814@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , Harti Brandt , Ben Kaduk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112301058.pBUAwFsw010478@svn.freebsd.org> <20111230204653.Y31442@beagle.kn.op.dlr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20111230204653.Y31442@beagle.kn.op.dlr.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r228990 - in head/usr.sbin: IPXrouted adduser bluetooth/btpand bluetooth/sdpd bootparamd/bootparamd bsnmpd/modules/snmp_bridge bsnmpd/modules/snmp_hostres bsnmpd/modules/snmp_wlan bsnmp... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 17:13:26 -0000 Sorry for the delay. On Fri, 2011-12-30 at 20:50:16 +0100, Harti Brandt wrote: > On Fri, 30 Dec 2011, Ben Kaduk wrote: > >On Fri, Dec 30, 2011 at 5:58 AM, Ulrich Spoerlein wrote: > >> Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt > >> ============================================================================== > >> --- head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt     Fri Dec 30 10:45:00 2011        (r228989) > >> +++ head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt     Fri Dec 30 10:58:14 2011        (r228990) > >> @@ -82,8 +82,8 @@ WlanMgmtReasonCode ::= TEXTUAL-CONVENTIO > >>                    associationLeave(8), > >>                    associationNotAuthenticated(9), > >>  -- XXX: TODO - FIXME > >> -                   dissasocPwrcapBad(10), > >> -                   dissasocSuperchanBad(11), > >> +                   disassocPwrcapBad(10), > >> +                   disassocSuperchanBad(11), > > > >This file looks like it might be intended to be machine-readable -- I > >would worry about changing it without test/review. > >Perhaps this spelling "error" is even the reason for the XXX comment above. > > Absolutely. If there is a spelling error in an SNMP MIB outside comments > or description strings it must stay there. Otherwise applications reading > that file will break. > > This is also true for the corresponding .def file. > > harti Neither Google, Bing nor Google Code Search can find any occurrence of any of the two words in either spelling, except in our tree, of course. This leads me to believe that at least no known Open Source project will be affected by the change. But that doesn't say much. Is this a non-backwards compatible change that we can do when going from 9.x to 10.0? I'm fine with backing it out, too, if you think this will actually break anything for third parties. Just say the word. Thanks Uli From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 17:33:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C721106564A; Sun, 1 Jan 2012 17:33:44 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id AB28A8FC0A; Sun, 1 Jan 2012 17:33:43 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id q01HXgYx074783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 1 Jan 2012 18:33:42 +0100 (CET) (envelope-from uqs@freebsd.org) Date: Sun, 1 Jan 2012 18:33:42 +0100 From: Ulrich Spoerlein To: Ben Kaduk Message-ID: <20120101173342.GN83814@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , Ben Kaduk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112301058.pBUAwFsw010478@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228990 - in head/usr.sbin: IPXrouted adduser bluetooth/btpand bluetooth/sdpd bootparamd/bootparamd bsnmpd/modules/snmp_bridge bsnmpd/modules/snmp_hostres bsnmpd/modules/snmp_wlan bsnmp... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 17:33:44 -0000 On Fri, 2011-12-30 at 14:43:22 -0500, Ben Kaduk wrote: > On Fri, Dec 30, 2011 at 5:58 AM, Ulrich Spoerlein wrote: > > Modified: head/usr.sbin/cron/doc/CHANGES > > ============================================================================== > > --- head/usr.sbin/cron/doc/CHANGES      Fri Dec 30 10:45:00 2011        (r228989) > > +++ head/usr.sbin/cron/doc/CHANGES      Fri Dec 30 10:58:14 2011        (r228990) > > @@ -1,3 +1,6 @@ > > +$FreeBSD$ > > +-------- > > + > >  Vixie Cron             Changes from V2 to V3 > >  Paul Vixie > >  29-Dec-1993 > > @@ -20,7 +23,7 @@ be reread whenever it changes. > > > >  I also added a "-e" option to crontab(1).  Nine people also sent me diffs > >  to add this option, but I had already implemented it on my own.  I actually > > -released an interrim version (V2.2, I think) for limited testing, and got a > > +released an interim version (V2.2, I think) for limited testing, and got a > > Should we really be in the business of modifying Vixie's changelog? I'm replying here, but same goes for your comments on the other revision (thanks for all those, btw). Warning, rant ahead: Our current SVN repo is in an inconsistent state thanks to the dubious introduction of svn keywords. There are files in there, converted over via cvs2svn and never touched since, but our presubmit checks want to either see a $FreeBSD$ tag in modified files, or have fbsd:nokeywords set. The latter is kinda a no-brainer for everything under contrib/ but I'm struggling with what to do exactly for files that are non-contrib and may or may not be non-code. Should the keywords be set on $subdir/* or can I punch holes in the web of keywords as I see fit? (e.g. $subdir/{README,CHANGES,foo.txt}) What's the point then anyway? SVN doesn't track files, but changesets. Gah! Oh wait, this ain't about the $FreeBSD$ keyword, but the typo-fix? I'm sure that Vixie won't mind and do believe that correctness of spelling is a worthy goal as we always tout the quality of our documentation. FWIW, I'm not going to touch stuff under contrib/, etc. > >  /* > > - * Delete a rotated logfiles, when using clasic filenames. > > + * Delete a rotated logfiles, when using classic filenames. > > "a logfiles" is inconsistent. Without looking up the implementation, > I'm going to guess that "a rotated logfile" is correct. When proofreading the spell-checked output I focused too narrowly on just the typo that I fixed so that other typos in the same line/sentence mostly went unnoticed. Will do better in the next couple of commits. > >  */ > >  static void > >  delete_clasiclog(const char *archive_dir, const char *namepart, int numlog_c) > > > > Modified: head/usr.sbin/ntp/doc/ntp.conf.5 > > ============================================================================== > > --- head/usr.sbin/ntp/doc/ntp.conf.5    Fri Dec 30 10:45:00 2011        (r228989) > > +++ head/usr.sbin/ntp/doc/ntp.conf.5    Fri Dec 30 10:58:14 2011        (r228990) > > @@ -783,7 +783,7 @@ The remaining files are necessary only f > >  Autokey protocol. > >  .Pp > >  Certificates imported from OpenSSL or public certificate > > -authorities have certian limitations. > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > Hmm, that's unfortunate. > Pulling out a svn client, it looks like: > usr.sbin/pkg_install/lib/plist.c changes a misspelled form to the > still-misspelled "occurrance" (not occurrence) Thanks, will follow up on that! > Thanks for doing this cleanup along with the encoding cleanup! > > -Ben Kaduk > From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 17:49:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 563BD106567C; Sun, 1 Jan 2012 17:49:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id E27378FC1B; Sun, 1 Jan 2012 17:49:01 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q01Hmv03010424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jan 2012 04:48:59 +1100 Date: Mon, 2 Jan 2012 04:48:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <4F008EA0.3080800@FreeBSD.org> Message-ID: <20120102041718.T54509@besplex.bde.org> References: <201112221503.pBMF3m0w021930@svn.freebsd.org> <20120101020442.GA94452@zim.MIT.EDU> <4F008EA0.3080800@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228801 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 17:49:02 -0000 On Sun, 1 Jan 2012, Dimitry Andric wrote: > On 2012-01-01 03:04, David Schultz wrote: >> On Thu, Dec 22, 2011, Dimitry Andric wrote: >>> Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default >>> for our gcc since more than three years (see r181534, which is also in >>> stable/9 and stable/8). This flag used to be for the benefit of the >>> old >>> in-kernel math emulator, which was removed more than eight years ago. >> >> Quite the opposite, actually. gcc/freebsd used to be hard-coded to >> use -mno-fancy-math-387 by default, which was really only appropriate for >> FPUless x86 chips back when FreeBSD supported them. The makefile >> setting overrides the old gcc default. The flag isn't "for the >> benefit of the in-kernel math emulator"; it's actually to reap the >> benefits of *not* having an in-kernel math emulator! >> >> Do you know if clang has the correct default here, or if it picked up >> trunk gcc's bogus default? It doesn't seem to support the flag to >> change the behavior, and it seems to default to -mno-fancy-math-387. >> (The flag should only affect things when -ffast-math is also specified.) > > As far as I can see, clang always generates calls to sin(), cos() etc. > It never inlines them to direct 387 instructions. Isn't that what we > want? Yes (never inlining is what we want, since the i387 is slow and very innacurate near all multiples of pi/2). > In any case, I don't see a quick way of getting it to emit 387 > instructions directly. It simply looks like it is not supported. The > -funsafe-math-optimizations is not recognized, and the -ffast-math > option is accepted, but ignored. -ffast-math acts strangly for gcc too: - on i386 in FreeBSD-10.0-CURRENT, it gives inline sin(). This is prevented by -mno-fancy-math-387. Apparently, -mno-fancy-math-387 is not the default. - on amd64 in FreeBSD-9.0-BETA1, it doesn't give inline sin(), even on a long double arg. However, it does give inline sinl() on a long double arg. I think this doesn't depend on the FreeBSD version. It should depend on the arch -- the i387 keeps growing relatively slower up to at least core2, and there should be some large numbers in the tables to disfavour it more (but there aren't). The tables would also need to know the speed of the library implementation to make the correct decision based on speed. The decision is accidentally correct for amd64, because the library versions are still quite slow for long doubles, but quite fast for doubles provided the arch later than Athlon64, and very fast for floats provided the arch is later than Pentium1. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 18:36:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D081065675; Sun, 1 Jan 2012 18:36:42 +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 A3FCC8FC0C; Sun, 1 Jan 2012 18:36: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 q01Iag6U024991; Sun, 1 Jan 2012 18:36:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01IagBW024985; Sun, 1 Jan 2012 18:36:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201011836.q01IagBW024985@svn.freebsd.org> From: Dimitry Andric Date: Sun, 1 Jan 2012 18:36: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: r229183 - in head/lib/clang: libllvmarminfo libllvmmipsinfo libllvmpowerpcinfo libllvmx86info X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 18:36:42 -0000 Author: dim Date: Sun Jan 1 18:36:42 2012 New Revision: 229183 URL: http://svn.freebsd.org/changeset/base/229183 Log: In several llvm library Makefiles, remove extraneous slashes at the end of SRCDIR definitions. MFC after: 3 days Modified: head/lib/clang/libllvmarminfo/Makefile head/lib/clang/libllvmmipsinfo/Makefile head/lib/clang/libllvmpowerpcinfo/Makefile head/lib/clang/libllvmx86info/Makefile Modified: head/lib/clang/libllvmarminfo/Makefile ============================================================================== --- head/lib/clang/libllvmarminfo/Makefile Sun Jan 1 18:29:37 2012 (r229182) +++ head/lib/clang/libllvmarminfo/Makefile Sun Jan 1 18:36:42 2012 (r229183) @@ -2,7 +2,7 @@ LIB= llvmarminfo -SRCDIR= lib/Target/ARM/TargetInfo/ +SRCDIR= lib/Target/ARM/TargetInfo INCDIR= lib/Target/ARM SRCS= ARMTargetInfo.cpp Modified: head/lib/clang/libllvmmipsinfo/Makefile ============================================================================== --- head/lib/clang/libllvmmipsinfo/Makefile Sun Jan 1 18:29:37 2012 (r229182) +++ head/lib/clang/libllvmmipsinfo/Makefile Sun Jan 1 18:36:42 2012 (r229183) @@ -2,7 +2,7 @@ LIB= llvmmipsinfo -SRCDIR= lib/Target/Mips/TargetInfo/ +SRCDIR= lib/Target/Mips/TargetInfo INCDIR= lib/Target/Mips SRCS= MipsTargetInfo.cpp Modified: head/lib/clang/libllvmpowerpcinfo/Makefile ============================================================================== --- head/lib/clang/libllvmpowerpcinfo/Makefile Sun Jan 1 18:29:37 2012 (r229182) +++ head/lib/clang/libllvmpowerpcinfo/Makefile Sun Jan 1 18:36:42 2012 (r229183) @@ -2,7 +2,7 @@ LIB= llvmpowerpcinfo -SRCDIR= lib/Target/PowerPC/TargetInfo/ +SRCDIR= lib/Target/PowerPC/TargetInfo INCDIR= lib/Target/PowerPC SRCS= PowerPCTargetInfo.cpp Modified: head/lib/clang/libllvmx86info/Makefile ============================================================================== --- head/lib/clang/libllvmx86info/Makefile Sun Jan 1 18:29:37 2012 (r229182) +++ head/lib/clang/libllvmx86info/Makefile Sun Jan 1 18:36:42 2012 (r229183) @@ -2,7 +2,7 @@ LIB= llvmx86info -SRCDIR= lib/Target/X86/TargetInfo/ +SRCDIR= lib/Target/X86/TargetInfo INCDIR= lib/Target/X86 SRCS= X86TargetInfo.cpp From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 18:45:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72B71065672; Sun, 1 Jan 2012 18:45:59 +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 B90388FC0C; Sun, 1 Jan 2012 18:45: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 q01Ijxh6025447; Sun, 1 Jan 2012 18:45:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01IjxQS025445; Sun, 1 Jan 2012 18:45:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201011845.q01IjxQS025445@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 1 Jan 2012 18:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229185 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 18:46:00 -0000 Author: kib Date: Sun Jan 1 18:45:59 2012 New Revision: 229185 URL: http://svn.freebsd.org/changeset/base/229185 Log: Avoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp lock upgrade right after the 'success' label fails. In collaboration with: pho MFC after: 1 week Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Jan 1 18:42:00 2012 (r229184) +++ head/sys/kern/vfs_lookup.c Sun Jan 1 18:45:59 2012 (r229185) @@ -508,12 +508,14 @@ lookup(struct nameidata *ndp) int dvfslocked; /* VFS Giant state for parent */ int tvfslocked; int lkflags_save; + int ni_dvp_unlocked; /* * Setup: break out flag bits into variables. */ dvfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; vfslocked = 0; + ni_dvp_unlocked = 0; ndp->ni_cnd.cn_flags &= ~GIANTHELD; wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); KASSERT(cnp->cn_nameiop == LOOKUP || wantparent, @@ -861,8 +863,10 @@ unionlookup: /* * Symlink code always expects an unlocked dvp. */ - if (ndp->ni_dvp != ndp->ni_vp) + if (ndp->ni_dvp != ndp->ni_vp) { VOP_UNLOCK(ndp->ni_dvp, 0); + ni_dvp_unlocked = 1; + } goto success; } @@ -909,14 +913,17 @@ nextname: VREF(ndp->ni_startdir); } if (!wantparent) { + ni_dvp_unlocked = 2; if (ndp->ni_dvp != dp) vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); VFS_UNLOCK_GIANT(dvfslocked); dvfslocked = 0; - } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) + } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) { VOP_UNLOCK(ndp->ni_dvp, 0); + ni_dvp_unlocked = 1; + } if (cnp->cn_flags & AUDITVNODE1) AUDIT_ARG_VNODE1(dp); @@ -945,10 +952,12 @@ success: return (0); bad2: - if (dp != ndp->ni_dvp) - vput(ndp->ni_dvp); - else - vrele(ndp->ni_dvp); + if (ni_dvp_unlocked != 2) { + if (dp != ndp->ni_dvp && !ni_dvp_unlocked) + vput(ndp->ni_dvp); + else + vrele(ndp->ni_dvp); + } bad: if (!dpunlocked) vput(dp); From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:09:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2811106564A; Sun, 1 Jan 2012 20:09:05 +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 838DE8FC08; Sun, 1 Jan 2012 20:09: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 q01K95dY028502; Sun, 1 Jan 2012 20:09:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01K95IO028499; Sun, 1 Jan 2012 20:09:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201012009.q01K95IO028499@svn.freebsd.org> From: Dimitry Andric Date: Sun, 1 Jan 2012 20:09: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: r229195 - head/contrib/less X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:09:05 -0000 Author: dim Date: Sun Jan 1 20:09:05 2012 New Revision: 229195 URL: http://svn.freebsd.org/changeset/base/229195 Log: Revert r228645, which casts away a number of const conversion warnings in contrib/less. I will fix those more properly in the next commit. Modified: head/contrib/less/command.c head/contrib/less/prompt.c Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Sun Jan 1 19:25:43 2012 (r229194) +++ head/contrib/less/command.c Sun Jan 1 20:09:05 2012 (r229195) @@ -1461,7 +1461,7 @@ commands() error("Command not available", NULL_PARG); break; } - start_mca(A_EXAMINE, "Examine: ", (void*)ml_examine, 0); + start_mca(A_EXAMINE, "Examine: ", ml_examine, 0); c = getcc(); goto again; #else @@ -1491,7 +1491,7 @@ commands() error("WARNING: This file was viewed via LESSOPEN", NULL_PARG); } - start_mca(A_SHELL, "!", (void*)ml_shell, 0); + start_mca(A_SHELL, "!", ml_shell, 0); /* * Expand the editor prototype string * and pass it to the system to execute. @@ -1655,7 +1655,7 @@ commands() error("Command not available", NULL_PARG); break; } - start_mca(A_SHELL, "!", (void*)ml_shell, 0); + start_mca(A_SHELL, "!", ml_shell, 0); c = getcc(); goto again; #else @@ -1706,7 +1706,7 @@ commands() if (badmark(c)) break; pipec = c; - start_mca(A_PIPE, "!", (void*)ml_shell, 0); + start_mca(A_PIPE, "!", ml_shell, 0); c = getcc(); goto again; #else Modified: head/contrib/less/prompt.c ============================================================================== --- head/contrib/less/prompt.c Sun Jan 1 19:25:43 2012 (r229194) +++ head/contrib/less/prompt.c Sun Jan 1 20:09:05 2012 (r229195) @@ -555,7 +555,7 @@ pr_expand(proto, maxwidth) public char * eq_message() { - return (pr_expand((char*)eqproto, 0)); + return (pr_expand(eqproto, 0)); } /* @@ -572,7 +572,7 @@ pr_string() type = (!less_is_more) ? pr_type : pr_type ? 0 : 1; prompt = pr_expand((ch_getflags() & CH_HELPFILE) ? - (char*)hproto : prproto[type], + hproto : prproto[type], sc_width-so_s_width-so_e_width-2); new_file = 0; return (prompt); @@ -584,5 +584,5 @@ pr_string() public char * wait_message() { - return (pr_expand((char*)wproto, sc_width-so_s_width-so_e_width-2)); + return (pr_expand(wproto, sc_width-so_s_width-so_e_width-2)); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:13:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DABC106566C; Sun, 1 Jan 2012 20:13:03 +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 381FD8FC14; Sun, 1 Jan 2012 20:13: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 q01KD35M028665; Sun, 1 Jan 2012 20:13:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01KD3QK028662; Sun, 1 Jan 2012 20:13:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201012013.q01KD3QK028662@svn.freebsd.org> From: Dimitry Andric Date: Sun, 1 Jan 2012 20:13: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: r229196 - head/contrib/less X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:13:03 -0000 Author: dim Date: Sun Jan 1 20:13:02 2012 New Revision: 229196 URL: http://svn.freebsd.org/changeset/base/229196 Log: Redo r228645, but instead of casting away const conversion warnings in contrib/less, add a few const qualifiers in the right places. Suggested by: das MFC after: 1 week Modified: head/contrib/less/command.c head/contrib/less/prompt.c Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Sun Jan 1 20:09:05 2012 (r229195) +++ head/contrib/less/command.c Sun Jan 1 20:13:02 2012 (r229196) @@ -105,7 +105,7 @@ cmd_exec() start_mca(action, prompt, mlist, cmdflags) int action; char *prompt; - void *mlist; + void constant *mlist; int cmdflags; { mca = action; @@ -686,7 +686,7 @@ make_display() static void prompt() { - register char *p; + register char constant *p; if (ungot != NULL) { Modified: head/contrib/less/prompt.c ============================================================================== --- head/contrib/less/prompt.c Sun Jan 1 20:09:05 2012 (r229195) +++ head/contrib/less/prompt.c Sun Jan 1 20:13:02 2012 (r229196) @@ -394,9 +394,9 @@ protochar(c, where, iseditproto) * where to resume parsing the string. * We must keep track of nested IFs and skip them properly. */ - static char * + static char constant * skipcond(p) - register char *p; + register char constant *p; { register int iflevel; @@ -452,9 +452,9 @@ skipcond(p) /* * Decode a char that represents a position on the screen. */ - static char * + static char constant * wherechar(p, wp) - char *p; + char constant *p; int *wp; { switch (*p) @@ -478,10 +478,10 @@ wherechar(p, wp) */ public char * pr_expand(proto, maxwidth) - char *proto; + char constant *proto; int maxwidth; { - register char *p; + register char constant *p; register int c; int where; From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:26:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFD2B1065673; Sun, 1 Jan 2012 20:26:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA2CF8FC0C; Sun, 1 Jan 2012 20:26: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 q01KQBAS029160; Sun, 1 Jan 2012 20:26:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01KQBS5029156; Sun, 1 Jan 2012 20:26:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201012026.q01KQBS5029156@svn.freebsd.org> From: Ed Schouten Date: Sun, 1 Jan 2012 20:26: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: r229198 - in head: share/man/man9 sys/conf sys/libkern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:26:11 -0000 Author: ed Date: Sun Jan 1 20:26:11 2012 New Revision: 229198 URL: http://svn.freebsd.org/changeset/base/229198 Log: Introducing memcchr(3). It seems two of the file system drivers we have in the tree, namely ufs and ext3, use a function called `skpc()'. The meaning of this function does not seem to be documented in FreeBSD, but it turns out one needs to be a VAX programmer to understand what it does. SPKC is an instruction on the VAX that does the opposite of memchr(). It searches for the non-equal character. Add a new function called memcchr() to the tree that has the following advantages over skpc(): - It has a name that makes more sense than skpc(). Just like strcspn() matches the complement of strspn(), memcchr() is the complement of memchr(). - It is faster than skpc(). Similar to our strlen() in libc, it compares entire words, instead of single bytes. It seems that for this routine this yields a sixfold performance increase on amd64. - It has a man page. Added: head/share/man/man9/memcchr.3 (contents, props changed) head/sys/libkern/memcchr.c (contents, props changed) Modified: head/sys/conf/files head/sys/sys/libkern.h Added: head/share/man/man9/memcchr.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/memcchr.3 Sun Jan 1 20:26:11 2012 (r229198) @@ -0,0 +1,59 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 1, 2012 +.Dt MEMCCHR 9 +.Os +.Sh NAME +.Nm memcchr +.Nd locate the complement of a byte in byte string +.Sh SYNOPSIS +.In sys/libkern.h +.Ft void * +.Fn memcchr "const void *b" "int c" "size_t len" +.Sh DESCRIPTION +The +.Fn memcchr +function locates the first occurrence of a byte unequal to +.Fa c +(converted to an +.Vt "unsigned char" ) +in string +.Fa b . +.Sh RETURN VALUES +The +.Fn memcchr +function return a pointer to the byte located, or NULL if no such byte +exists within +.Fa len +bytes. +.Sh SEE ALSO +.Xr memchr 3 +.Sh HISTORY +The +.Fn memcchr +function first appeared in +.Fx 10.0 . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 1 20:18:40 2012 (r229197) +++ head/sys/conf/files Sun Jan 1 20:26:11 2012 (r229198) @@ -2557,6 +2557,7 @@ libkern/inet_ntoa.c standard libkern/inet_ntop.c standard libkern/inet_pton.c standard libkern/mcount.c optional profiling-routine +libkern/memcchr.c standard libkern/memcmp.c standard libkern/qsort.c standard libkern/qsort_r.c standard Added: head/sys/libkern/memcchr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/memcchr.c Sun Jan 1 20:26:11 2012 (r229198) @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 2012 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +/* + * memcchr(): find first character in buffer not matching `c'. + * + * This function performs the complement of memchr(). To provide decent + * performance, this function compares data from the buffer one word at + * a time. + * + * This code is inspired by libc's strlen(), written by Xin Li. + */ + +#if LONG_BIT != 32 && LONG_BIT != 64 +#error Unsupported word size +#endif + +#define LONGPTR_MASK (sizeof(long) - 1) + +#define TESTBYTE \ + do { \ + if (*p != (unsigned char)c) \ + goto done; \ + p++; \ + } while (0) + +void * +memcchr(const void *begin, int c, size_t n) +{ + const unsigned long *lp; + const unsigned char *p, *end; + unsigned long word; + + /* Four or eight repetitions of `c'. */ + word = (unsigned char)c; + word |= word << 8; + word |= word << 16; +#if LONG_BIT >= 64 + word |= word << 32; +#endif + + /* Don't perform memory I/O when passing a zero-length buffer. */ + if (n == 0) + return (NULL); + + /* + * First determine whether there is a character unequal to `c' + * in the first word. As this word may contain bytes before + * `begin', we may execute this loop spuriously. + */ + lp = (const unsigned long *)((uintptr_t)begin & ~LONGPTR_MASK); + end = (const unsigned char *)begin + n; + if (*lp++ != word) + for (p = begin; p < (const unsigned char *)lp;) + TESTBYTE; + + /* Now compare the data one word at a time. */ + for (; (const unsigned char *)lp < end; lp++) { + if (*lp != word) { + p = (const unsigned char *)lp; + TESTBYTE; + TESTBYTE; + TESTBYTE; +#if LONG_BIT >= 64 + TESTBYTE; + TESTBYTE; + TESTBYTE; + TESTBYTE; +#endif + goto done; + } + } + + return (NULL); + +done: + /* + * If the end of the buffer is not word aligned, the previous + * loops may obtain an address that's beyond the end of the + * buffer. + */ + if (p < end) + return (__DECONST(void *, p)); + return (NULL); +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sun Jan 1 20:18:40 2012 (r229197) +++ head/sys/sys/libkern.h Sun Jan 1 20:26:11 2012 (r229198) @@ -92,6 +92,7 @@ int flsl(long); int fnmatch(const char *, const char *, int); int locc(int, char *, u_int); void *memchr(const void *s, int c, size_t n); +void *memcchr(const void *s, int c, size_t n); int memcmp(const void *b1, const void *b2, size_t len); void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:30:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF217106564A; Sun, 1 Jan 2012 20:30:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAFAD8FC0A; Sun, 1 Jan 2012 20:30: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 q01KUmcD029323; Sun, 1 Jan 2012 20:30:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01KUmHP029321; Sun, 1 Jan 2012 20:30:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201012030.q01KUmHP029321@svn.freebsd.org> From: Ed Schouten Date: Sun, 1 Jan 2012 20:30: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: r229199 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:30:48 -0000 Author: ed Date: Sun Jan 1 20:30:48 2012 New Revision: 229199 URL: http://svn.freebsd.org/changeset/base/229199 Log: Fix typo; return -> returns. Modified: head/share/man/man9/memcchr.3 Modified: head/share/man/man9/memcchr.3 ============================================================================== --- head/share/man/man9/memcchr.3 Sun Jan 1 20:26:11 2012 (r229198) +++ head/share/man/man9/memcchr.3 Sun Jan 1 20:30:48 2012 (r229199) @@ -46,7 +46,7 @@ in string .Sh RETURN VALUES The .Fn memcchr -function return a pointer to the byte located, or NULL if no such byte +function returns a pointer to the byte located, or NULL if no such byte exists within .Fa len bytes. From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:47:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89372106564A; Sun, 1 Jan 2012 20:47:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68C9C8FC0A; Sun, 1 Jan 2012 20:47: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 q01KlYOB029882; Sun, 1 Jan 2012 20:47:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01KlYtb029879; Sun, 1 Jan 2012 20:47:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201012047.q01KlYtb029879@svn.freebsd.org> From: Ed Schouten Date: Sun, 1 Jan 2012 20:47: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: r229200 - in head/sys: fs/ext2fs ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:47:34 -0000 Author: ed Date: Sun Jan 1 20:47:33 2012 New Revision: 229200 URL: http://svn.freebsd.org/changeset/base/229200 Log: Migrate ufs and ext2fs from skpc() to memcchr(). While there, remove a useless check from the code. memcchr() always returns characters unequal to 0xff in this case, so inosused[i] ^ 0xff can never be equal to zero. Also, the fact that memcchr() returns a pointer instead of the number of bytes until the end, makes conversion to an offset far more easy. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 1 20:30:48 2012 (r229199) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 1 20:47:33 2012 (r229200) @@ -886,8 +886,8 @@ ext2_nodealloccg(struct inode *ip, int c struct m_ext2fs *fs; struct buf *bp; struct ext2mount *ump; - int error, start, len, loc, map, i; - char *ibp; + int error, start, len; + char *ibp, *loc; ipref--; /* to avoid a lot of (ipref -1) */ if (ipref == -1) ipref = 0; @@ -921,25 +921,19 @@ ext2_nodealloccg(struct inode *ip, int c } start = ipref / NBBY; len = howmany(fs->e2fs->e2fs_ipg - ipref, NBBY); - loc = skpc(0xff, len, &ibp[start]); - if (loc == 0) { + loc = memcchr(&ibp[start], 0xff, len); + if (loc == NULL) { len = start + 1; start = 0; - loc = skpc(0xff, len, &ibp[0]); - if (loc == 0) { + loc = memcchr(&ibp[start], 0xff, len); + if (loc == NULL) { printf("cg = %d, ipref = %lld, fs = %s\n", cg, (long long)ipref, fs->e2fs_fsmnt); panic("ext2fs_nodealloccg: map corrupted"); /* NOTREACHED */ } } - i = start + len - loc; - map = ibp[i] ^ 0xff; - if (map == 0) { - printf("fs = %s\n", fs->e2fs_fsmnt); - panic("ext2fs_nodealloccg: block not in map"); - } - ipref = i * NBBY + ffs(map) - 1; + ipref = (loc - ibp) * NBBY + ffs(~*loc) - 1; gotit: setbit(ibp, ipref); EXT2_LOCK(ump); @@ -1068,7 +1062,8 @@ ext2_vfree(pvp, ino, mode) static daddr_t ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t bpref) { - int start, len, loc, i, map; + char *loc; + int start, len; /* * find the fragment by searching through the free block @@ -1079,25 +1074,19 @@ ext2_mapsearch(struct m_ext2fs *fs, char else start = 0; len = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; - loc = skpc(0xff, len, &bbp[start]); - if (loc == 0) { + loc = memcchr(&bbp[start], 0xff, len); + if (loc == NULL) { len = start + 1; start = 0; - loc = skpc(0xff, len, &bbp[start]); - if (loc == 0) { + loc = memcchr(&bbp[start], 0xff, len); + if (loc == NULL) { printf("start = %d, len = %d, fs = %s\n", start, len, fs->e2fs_fsmnt); panic("ext2fs_alloccg: map corrupted"); /* NOTREACHED */ } } - i = start + len - loc; - map = bbp[i] ^ 0xff; - if (map == 0) { - printf("fs = %s\n", fs->e2fs_fsmnt); - panic("ext2fs_mapsearch: block not in map"); - } - return (i * NBBY + ffs(map) - 1); + return ((loc - bbp) * NBBY + ffs(~*loc) - 1); } /* Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Jan 1 20:30:48 2012 (r229199) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Jan 1 20:47:33 2012 (r229200) @@ -1745,9 +1745,9 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu struct cg *cgp; struct buf *bp, *ibp; struct ufsmount *ump; - u_int8_t *inosused; + u_int8_t *inosused, *loc; struct ufs2_dinode *dp2; - int error, start, len, loc, map, i; + int error, start, len, i; fs = ip->i_fs; ump = ip->i_ump; @@ -1777,25 +1777,19 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu } start = cgp->cg_irotor / NBBY; len = howmany(fs->fs_ipg - cgp->cg_irotor, NBBY); - loc = skpc(0xff, len, &inosused[start]); - if (loc == 0) { + loc = memcchr(&inosused[start], 0xff, len); + if (loc == NULL) { len = start + 1; start = 0; - loc = skpc(0xff, len, &inosused[0]); - if (loc == 0) { + loc = memcchr(&inosused[start], 0xff, len); + if (loc == NULL) { printf("cg = %d, irotor = %ld, fs = %s\n", cg, (long)cgp->cg_irotor, fs->fs_fsmnt); panic("ffs_nodealloccg: map corrupted"); /* NOTREACHED */ } } - i = start + len - loc; - map = inosused[i] ^ 0xff; - if (map == 0) { - printf("fs = %s\n", fs->fs_fsmnt); - panic("ffs_nodealloccg: block not in map"); - } - ipref = i * NBBY + ffs(map) - 1; + ipref = (loc - inosused) * NBBY + ffs(~*loc) - 1; cgp->cg_irotor = ipref; gotit: /* From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:50:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33866106566B; Sun, 1 Jan 2012 20:50:20 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DEE48FC16; Sun, 1 Jan 2012 20:50: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 q01KoJUn030008; Sun, 1 Jan 2012 20:50:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01KoJEH030006; Sun, 1 Jan 2012 20:50:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201012050.q01KoJEH030006@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jan 2012 20:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229201 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:50:20 -0000 Author: jilles Date: Sun Jan 1 20:50:19 2012 New Revision: 229201 URL: http://svn.freebsd.org/changeset/base/229201 Log: sh: Make patmatch() non-recursive. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Jan 1 20:47:33 2012 (r229200) +++ head/bin/sh/expand.c Sun Jan 1 20:50:19 2012 (r229201) @@ -1445,57 +1445,63 @@ int patmatch(const char *pattern, const char *string, int squoted) { const char *p, *q, *end; + const char *bt_p, *bt_q; char c; wchar_t wc, wc2; p = pattern; q = string; + bt_p = NULL; + bt_q = NULL; for (;;) { switch (c = *p++) { case '\0': - goto breakloop; + if (*q != '\0') + goto backtrack; + return 1; case CTLESC: if (squoted && *q == CTLESC) q++; if (*q++ != *p++) - return 0; + goto backtrack; break; case CTLQUOTEMARK: continue; case '?': if (squoted && *q == CTLESC) q++; - if (localeisutf8) + if (*q == '\0') + return 0; + if (localeisutf8) { wc = get_wc(&q); - else + /* + * A '?' does not match invalid UTF-8 but a + * '*' does, so backtrack. + */ + if (wc == 0) + goto backtrack; + } else wc = (unsigned char)*q++; - if (wc == '\0') - return 0; break; case '*': c = *p; while (c == CTLQUOTEMARK || c == '*') c = *++p; - if (c != CTLESC && c != CTLQUOTEMARK && - c != '?' && c != '*' && c != '[') { - while (*q != c) { - if (squoted && *q == CTLESC && - q[1] == c) - break; - if (*q == '\0') - return 0; - if (squoted && *q == CTLESC) - q++; - q++; - } - } - do { - if (patmatch(p, q, squoted)) - return 1; - if (squoted && *q == CTLESC) - q++; - } while (*q++ != '\0'); - return 0; + /* + * If the pattern ends here, we know the string + * matches without needing to look at the rest of it. + */ + if (c == '\0') + return 1; + /* + * First try the shortest match for the '*' that + * could work. We can forget any earlier '*' since + * there is no way having it match more characters + * can help us, given that we are already here. + */ + bt_p = p; + bt_q = q; + break; case '[': { const char *endp; int invert, found; @@ -1507,7 +1513,7 @@ patmatch(const char *pattern, const char for (;;) { while (*endp == CTLQUOTEMARK) endp++; - if (*endp == '\0') + if (*endp == 0) goto dft; /* no matching ] */ if (*endp == CTLESC) endp++; @@ -1522,12 +1528,14 @@ patmatch(const char *pattern, const char found = 0; if (squoted && *q == CTLESC) q++; - if (localeisutf8) + if (*q == '\0') + return 0; + if (localeisutf8) { chr = get_wc(&q); - else + if (chr == 0) + goto backtrack; + } else chr = (unsigned char)*q++; - if (chr == '\0') - return 0; c = *p++; do { if (c == CTLQUOTEMARK) @@ -1568,21 +1576,34 @@ patmatch(const char *pattern, const char } } while ((c = *p++) != ']'); if (found == invert) - return 0; + goto backtrack; break; } dft: default: if (squoted && *q == CTLESC) q++; - if (*q++ != c) + if (*q == '\0') + return 0; + if (*q++ == c) + break; +backtrack: + /* + * If we have a mismatch (other than hitting the end + * of the string), go back to the last '*' seen and + * have it match one additional character. + */ + if (bt_p == NULL) + return 0; + if (squoted && *bt_q == CTLESC) + bt_q++; + if (*bt_q == '\0') return 0; + bt_q++; + p = bt_p; + q = bt_q; break; } } -breakloop: - if (*q != '\0') - return 0; - return 1; } From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:54:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39968106564A; Sun, 1 Jan 2012 20:54:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09F228FC0C; Sun, 1 Jan 2012 20:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q01KsiOU030340; Sun, 1 Jan 2012 20:54:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01Ksiu9030336; Sun, 1 Jan 2012 20:54:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201012054.q01Ksiu9030336@svn.freebsd.org> From: Ed Schouten Date: Sun, 1 Jan 2012 20:54: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: r229204 - in head/sys: conf libkern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:54:45 -0000 Author: ed Date: Sun Jan 1 20:54:44 2012 New Revision: 229204 URL: http://svn.freebsd.org/changeset/base/229204 Log: Remove the now unused skpc() function. It was only used by ufs and ext2 and I have really strong doubts that there are other pieces of code that also use this function. If it turns out that external drivers use this code as well, I'd be happy to migrate or revert. Bump __FreeBSD_version while there. Deleted: head/sys/libkern/skpc.c Modified: head/sys/conf/files head/sys/sys/libkern.h head/sys/sys/param.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 1 20:53:33 2012 (r229203) +++ head/sys/conf/files Sun Jan 1 20:54:44 2012 (r229204) @@ -2564,7 +2564,6 @@ libkern/qsort_r.c standard libkern/random.c standard libkern/rindex.c standard libkern/scanc.c standard -libkern/skpc.c standard libkern/strcasecmp.c standard libkern/strcat.c standard libkern/strcmp.c standard Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sun Jan 1 20:53:33 2012 (r229203) +++ head/sys/sys/libkern.h Sun Jan 1 20:54:44 2012 (r229204) @@ -102,7 +102,6 @@ u_long random(void); char *index(const char *, int); char *rindex(const char *, int); int scanc(u_int, const u_char *, const u_char *, int); -int skpc(int, int, char *); void srandom(u_long); int strcasecmp(const char *, const char *); char *strcat(char * __restrict, const char * __restrict); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jan 1 20:53:33 2012 (r229203) +++ head/sys/sys/param.h Sun Jan 1 20:54:44 2012 (r229204) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 20:59:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC716106566B; Sun, 1 Jan 2012 20:59:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD3478FC0A; Sun, 1 Jan 2012 20:59: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 q01KxgOG030596; Sun, 1 Jan 2012 20:59:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01KxglS030593; Sun, 1 Jan 2012 20:59:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201012059.q01KxglS030593@svn.freebsd.org> From: Ed Schouten Date: Sun, 1 Jan 2012 20:59: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: r229206 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 20:59:43 -0000 Author: ed Date: Sun Jan 1 20:59:42 2012 New Revision: 229206 URL: http://svn.freebsd.org/changeset/base/229206 Log: Fix sloppyness in memcchr() man page. I was considering adding it to libc as well, but last minute I thought it would be good enough to add it to libkern exclusively. I forgot to rename the man page and hook it up. Added: head/share/man/man9/memcchr.9 - copied unchanged from r229199, head/share/man/man9/memcchr.3 Deleted: head/share/man/man9/memcchr.3 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Jan 1 20:57:38 2012 (r229205) +++ head/share/man/man9/Makefile Sun Jan 1 20:59:42 2012 (r229206) @@ -164,6 +164,7 @@ MAN= accept_filter.9 \ mbuf_tags.9 \ MD5.9 \ mdchain.9 \ + memcchr.9 \ memguard.9 \ microseq.9 \ microtime.9 \ Copied: head/share/man/man9/memcchr.9 (from r229199, head/share/man/man9/memcchr.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/memcchr.9 Sun Jan 1 20:59:42 2012 (r229206, copy of r229199, head/share/man/man9/memcchr.3) @@ -0,0 +1,59 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 1, 2012 +.Dt MEMCCHR 9 +.Os +.Sh NAME +.Nm memcchr +.Nd locate the complement of a byte in byte string +.Sh SYNOPSIS +.In sys/libkern.h +.Ft void * +.Fn memcchr "const void *b" "int c" "size_t len" +.Sh DESCRIPTION +The +.Fn memcchr +function locates the first occurrence of a byte unequal to +.Fa c +(converted to an +.Vt "unsigned char" ) +in string +.Fa b . +.Sh RETURN VALUES +The +.Fn memcchr +function returns a pointer to the byte located, or NULL if no such byte +exists within +.Fa len +bytes. +.Sh SEE ALSO +.Xr memchr 3 +.Sh HISTORY +The +.Fn memcchr +function first appeared in +.Fx 10.0 . From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 21:32:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 774B81065670; Sun, 1 Jan 2012 21:32:26 +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 482CD8FC13; Sun, 1 Jan 2012 21:32: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 q01LWQqY031838; Sun, 1 Jan 2012 21:32:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01LWQ8N031837; Sun, 1 Jan 2012 21:32:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201012132.q01LWQ8N031837@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jan 2012 21:32: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: r229211 - head/sys/contrib/xz-embedded X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 21:32:26 -0000 Author: adrian Date: Sun Jan 1 21:32:25 2012 New Revision: 229211 URL: http://svn.freebsd.org/changeset/base/229211 Log: Initial copy of xz-embedded to sys/contrib/. The upcoming geom_compress module (a read-only gzip/ulzma translation layer, similar to what geom_uzip does) will leverage parts of this. Added: head/sys/contrib/xz-embedded/ - copied from r229210, vendor/xz-embedded/dist/ From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 22:15:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F122106566C; Sun, 1 Jan 2012 22:15:39 +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 1A9BC8FC08; Sun, 1 Jan 2012 22:15: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 q01MFceU033468; Sun, 1 Jan 2012 22:15:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01MFcKO033465; Sun, 1 Jan 2012 22:15:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201012215.q01MFcKO033465@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jan 2012 22:15: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: r229219 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 22:15:39 -0000 Author: jilles Date: Sun Jan 1 22:15:38 2012 New Revision: 229219 URL: http://svn.freebsd.org/changeset/base/229219 Log: sh: Remove unused function scopyn(). Modified: head/bin/sh/mystring.c head/bin/sh/mystring.h Modified: head/bin/sh/mystring.c ============================================================================== --- head/bin/sh/mystring.c Sun Jan 1 22:11:22 2012 (r229218) +++ head/bin/sh/mystring.c Sun Jan 1 22:15:38 2012 (r229219) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); * * equal(s1, s2) Return true if strings are equal. * scopy(from, to) Copy a string. - * scopyn(from, to, n) Like scopy, but checks for overflow. * number(s) Convert a string of digits to an integer. * is_number(s) Return true if s is a string of digits. */ @@ -67,24 +66,6 @@ char nullstr[1]; /* zero length string /* - * scopyn - copy a string from "from" to "to", truncating the string - * if necessary. "To" is always nul terminated, even if - * truncation is performed. "Size" is the size of "to". - */ - -void -scopyn(const char *from, char *to, int size) -{ - - while (--size > 0) { - if ((*to++ = *from++) == '\0') - return; - } - *to = '\0'; -} - - -/* * prefix -- see if pfx is a prefix of string. */ Modified: head/bin/sh/mystring.h ============================================================================== --- head/bin/sh/mystring.h Sun Jan 1 22:11:22 2012 (r229218) +++ head/bin/sh/mystring.h Sun Jan 1 22:15:38 2012 (r229219) @@ -35,7 +35,6 @@ #include -void scopyn(const char *, char *, int); int prefix(const char *, const char *); int number(const char *); int is_number(const char *); From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 22:17:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9FB4106566C; Sun, 1 Jan 2012 22:17:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D39018FC0C; Sun, 1 Jan 2012 22:17: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 q01MHC4R033567; Sun, 1 Jan 2012 22:17:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01MHCpN033556; Sun, 1 Jan 2012 22:17:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201012217.q01MHCpN033556@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jan 2012 22:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229220 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2012 22:17:13 -0000 Author: jilles Date: Sun Jan 1 22:17:12 2012 New Revision: 229220 URL: http://svn.freebsd.org/changeset/base/229220 Log: sh: Make various functions static. Modified: head/bin/sh/exec.c head/bin/sh/exec.h head/bin/sh/expand.c head/bin/sh/expand.h head/bin/sh/histedit.c head/bin/sh/input.c head/bin/sh/input.h head/bin/sh/main.c head/bin/sh/main.h head/bin/sh/myhistedit.h Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/exec.c Sun Jan 1 22:17:12 2012 (r229220) @@ -100,6 +100,7 @@ static void tryexec(char *, char **, cha static void printentry(struct tblentry *, int); static struct tblentry *cmdlookup(const char *, int); static void delete_cmd_entry(void); +static void addcmdentry(const char *, struct cmdentry *); @@ -593,7 +594,7 @@ delete_cmd_entry(void) * the same name. */ -void +static void addcmdentry(const char *name, struct cmdentry *entry) { struct tblentry *cmdp; Modified: head/bin/sh/exec.h ============================================================================== --- head/bin/sh/exec.h Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/exec.h Sun Jan 1 22:17:12 2012 (r229220) @@ -70,7 +70,6 @@ void find_command(const char *, struct c int find_builtin(const char *, int *); void hashcd(void); void changepath(const char *); -void addcmdentry(const char *, struct cmdentry *); void defun(const char *, union node *); int unsetfunc(const char *); int typecmd_impl(int, char **, int, const char *); Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/expand.c Sun Jan 1 22:17:12 2012 (r229220) @@ -113,6 +113,7 @@ static void expmeta(char *, char *); static void addfname(char *); static struct strlist *expsort(struct strlist *); static struct strlist *msort(struct strlist *, int); +static int patmatch(const char *, const char *, int); static char *cvtnum(int, char *); static int collate_range_cmp(wchar_t, wchar_t); @@ -1441,7 +1442,7 @@ match_charclass(const char *p, wchar_t c * Returns true if the pattern matches the string. */ -int +static int patmatch(const char *pattern, const char *string, int squoted) { const char *p, *q, *end; Modified: head/bin/sh/expand.h ============================================================================== --- head/bin/sh/expand.h Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/expand.h Sun Jan 1 22:17:12 2012 (r229220) @@ -60,6 +60,5 @@ union node; void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); -int patmatch(const char *, const char *, int); void rmescapes(char *); int casematch(union node *, const char *); Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/histedit.c Sun Jan 1 22:17:12 2012 (r229220) @@ -70,6 +70,8 @@ int displayhist; static FILE *el_in, *el_out, *el_err; static char *fc_replace(const char *, char *, char *); +static int not_fcnumber(const char *); +static int str_to_event(const char *, int); /* * Set history and editing status. Called whenever the status may @@ -425,7 +427,7 @@ fc_replace(const char *s, char *p, char return (dest); } -int +static int not_fcnumber(const char *s) { if (s == NULL) @@ -435,7 +437,7 @@ not_fcnumber(const char *s) return (!is_number(s)); } -int +static int str_to_event(const char *str, int last) { HistEvent he; Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/input.c Sun Jan 1 22:17:12 2012 (r229220) @@ -106,6 +106,7 @@ EditLine *el; /* cookie for editline p static void pushfile(void); static int preadfd(void); +static void popstring(void); #ifdef mkinit INCLUDE "input.h" @@ -372,7 +373,7 @@ pushstring(char *s, int len, void *ap) INTON; } -void +static void popstring(void) { struct strpush *sp = parsefile->strpush; Modified: head/bin/sh/input.h ============================================================================== --- head/bin/sh/input.h Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/input.h Sun Jan 1 22:17:12 2012 (r229220) @@ -53,7 +53,6 @@ int preadbuffer(void); int preadateof(void); void pungetc(void); void pushstring(char *, int, void *); -void popstring(void); void setinputfile(const char *, int); void setinputfd(int, int); void setinputstring(char *, int); Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/main.c Sun Jan 1 22:17:12 2012 (r229220) @@ -79,6 +79,7 @@ int rootshell; struct jmploc main_handler; int localeisutf8, initial_localeisutf8; +static void cmdloop(int); static void read_profile(char *); static char *find_dot_file(char *); @@ -184,7 +185,7 @@ state4: /* XXX ??? - why isn't this befo * loop; it turns on prompting if the shell is interactive. */ -void +static void cmdloop(int top) { union node *n; Modified: head/bin/sh/main.h ============================================================================== --- head/bin/sh/main.h Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/main.h Sun Jan 1 22:17:12 2012 (r229220) @@ -38,4 +38,3 @@ extern int rootshell; /* true if we aren extern struct jmploc main_handler; /* top level exception handler */ void readcmdfile(const char *); -void cmdloop(int); Modified: head/bin/sh/myhistedit.h ============================================================================== --- head/bin/sh/myhistedit.h Sun Jan 1 22:15:38 2012 (r229219) +++ head/bin/sh/myhistedit.h Sun Jan 1 22:17:12 2012 (r229220) @@ -39,6 +39,4 @@ extern int displayhist; void histedit(void); void sethistsize(const char *); void setterm(const char *); -int not_fcnumber(const char *); -int str_to_event(const char *, int); From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 02:14:11 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 967E1106564A; Mon, 2 Jan 2012 02:14:11 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 521198FC0C; Mon, 2 Jan 2012 02:14:11 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q022E87G099845; Sun, 1 Jan 2012 21:14:08 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q022E8P3099844; Sun, 1 Jan 2012 21:14:08 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sun, 1 Jan 2012 21:14:08 -0500 From: David Schultz To: Ed Schouten Message-ID: <20120102021408.GA99780@zim.MIT.EDU> Mail-Followup-To: Ed Schouten , Steve Kargl , Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112291441.pBTEfI8l060127@svn.freebsd.org> <4EFCA6A6.6080103@FreeBSD.org> <20111229183213.GK1895@hoeg.nl> <20111229184934.GA47885@troutmask.apl.washington.edu> <20111229192359.GM1895@hoeg.nl> <20120101025422.GD94452@zim.MIT.EDU> <20120101092925.GZ1895@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120101092925.GZ1895@hoeg.nl> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Andreas Tobler , Steve Kargl Subject: Re: svn commit: r228955 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 02:14:11 -0000 On Sun, Jan 01, 2012, Ed Schouten wrote: > David, > > * David Schultz , 20120101 03:54: > > I'm out of town and don't remember the details of this, but is there a > > reason we couldn't simply have an appropriate #ifdef that uses > > __attribute((__noreturn__)) instead of [[noreturn]]? We have plenty > > of ifdefs in the tree already to work around deficiencies in various > > compilers. Saying "it's the compiler's fault and we're not going to > > work around it" is a significant departure from historical precedent, > > and it punishes the wrong people. Easier than arguing with the GNU > > folks about fixing it, too... > > Right now GCC 4.7 is still an unreleased piece of software. If GCC 4.7 > was a released piece of software, I would of course agree that we should > add the workaround. > > The problem isn't that GCC 4.7 doesn't support [[noreturn]]. The problem > is that GCC only implements parts of C++11, yet it forces the compiler > into C++11 mode while bootstrapping. Even if we add a workaround for > this in sys/cdefs.h, we can likely never ever get rid of it. Because if > someone wants to install GCC 4.7 on a FreeBSD 14.0 box in 2020 to build > an old piece of software, he still needs the workaround. > > But there's nothing serious going on here. The issue is already > discussed in GCC Bugzilla and there is a patch that fixes the build. > Let's just wait to see what happens. Since we're talking about a development version of gcc, I agree. We should wait and see if they fix it. It wouldn't surprise me if we wind up needing some workarounds. After all, after well over a decade, we still have workarounds for gcc's (and clang's) lack of complete C99 support. I doubt the gcc developers are going to agree that they need to dot every "i" and cross every "t" before they declare C++11 support and define __cplusplus to be 201103. From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 03:09:59 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A65A01065672; Mon, 2 Jan 2012 03:09:59 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 103558FC08; Mon, 2 Jan 2012 03:09:58 +0000 (UTC) Received: from lstewart1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 55E3C7E824; Mon, 2 Jan 2012 14:09:56 +1100 (EST) Message-ID: <4F012004.8010508@freebsd.org> Date: Mon, 02 Jan 2012 14:09:56 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111016 Thunderbird/7.0.1 MIME-Version: 1.0 To: Adrian Chadd References: <201112300857.pBU8vxfP004914@svn.freebsd.org> <4EFEB38F.8010709@freebsd.org> In-Reply-To: <4EFEB38F.8010709@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rwatson@freebsd.org Subject: Re: svn commit: r228986 - in head: share/man/man4 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 03:09:59 -0000 On 12/31/11 18:02, Lawrence Stewart wrote: > On 12/31/11 11:13, Adrian Chadd wrote: >> This just broke wlan. Please consider fixing this patch :) >> >> >> Adrian >> >> *** Interface: wlan0: start >> can't re-use a leaf (wlan0)! >> panic: bpfattach tscfgoid >> KDB: enter: panic >> [ thread pid 166 tid 100048 ]Stopped at kdb_enter+0x4c: lui at,0x8048 >> db> >> db> bt >> Tracing pid 166 tid 100048 td 0x80c37900 >> db_trace_thread+30 (?,?,?,?) ra 80074cc0 sp c40075f0 sz 24 >> 80074bac+114 (0,?,ffffffff,?) ra 8007427c sp c4007608 sz 32 >> 80073ef4+388 (?,?,?,?) ra 80074400 sp c4007628 sz 168 >> db_command_loop+70 (?,?,?,?) ra 80076ac4 sp c40076d0 sz 24 >> 800769d0+f4 (?,?,?,?) ra 801b7560 sp c40076e8 sz 424 >> kdb_trap+110 (?,?,?,?) ra 8035c7ec sp c4007890 sz 48 >> trap+bf4 (?,?,?,?) ra 80354560 sp c40078c0 sz 184 >> MipsKernGenException+134 (0,4,803c089c,113) ra 801b72d8 sp c4007978 sz >> 200 >> kdb_enter+4c (?,?,?,?) ra 8017f88c sp c4007a40 sz 24 >> panic+11c (?,0,80706500,0) ra 802304b8 sp c4007a58 sz 40 >> bpfattach2+cc (?,?,?,?) ra 802305e0 sp c4007a80 sz 64 >> bpfattach+10 (?,?,?,?) ra 802448ec sp c4007ac0 sz 24 >> ether_ifattach+d0 (?,?,?,?) ra 8025f0ac sp c4007ad8 sz 32 >> ieee80211_vap_attach+104 (?,?,?,?) ra 8007ffe8 sp c4007af8 sz 96 >> 8007f960+688 (?,?,0,?) ra 8026a39c sp c4007b58 sz 88 >> 8026a22c+170 (?,?,?,?) ra 802430dc sp c4007bb0 sz 88 >> ifc_simple_create+80 (?,?,?,?) ra 80242b04 sp c4007c08 sz 64 >> 80242ab0+54 (?,?,?,?) ra 80242d78 sp c4007c48 sz 40 >> if_clone_create+a8 (?,?,?,?) ra 8023bdd4 sp c4007c70 sz 40 >> ifioctl+3a4 (?,?,80c7f460,80c37900) ra 801d8070 sp c4007c98 sz 144 >> soo_ioctl+3b0 (?,?,?,?) ra 801d2804 sp c4007d28 sz 40 >> kern_ioctl+248 (?,?,?,?) ra 801d29ac sp c4007d50 sz 64 >> sys_ioctl+130 (?,?,?,?) ra 8035c3ec sp c4007d90 sz 56 >> trap+7f4 (?,?,?,?) ra 8035475c sp c4007dc8 sz 184 >> MipsUserGenException+10c (?,?,?,4061d590) ra 0 sp c4007e80 sz 0 >> pid 166 >> db> reset > > I've managed to reproduce this on my wifi enabled laptop with r228986 > MFCed to a 9-stable kernel. I can't reproduce the panic with regular > interfaces, pseudo interfaces (e.g. lo0 and pflog0) or vlans (which also > have a relationship with an underlying physical interface) i.e. this is > VAP/net80211 specific as far as I can tell. > > The problem is that bpfattach2() is being called twice with the same > interface name i.e. "wlan0". > > I added a debug printf and call to kdb_backtrace() after the > SYSCTL_ADD_PROC() call in bpfattach2() to see the code paths which are > calling into the function. Here's what I see when the kernel runs on my > laptop (I've added inline comments between "## ##"): > > Added tscfg OID for interface wlan0 > KDB: stack backtrace: > #0 0xffffffff808680ce at kdb_backtrace+0x5e > #1 0xffffffff808da5b4 at bpfattach2+0xb4 > #2 0xffffffff808fbe06 at ieee80211_vap_setup+0x266 > #3 0xffffffff80740205 at wpi_vap_create+0x95 > #4 0xffffffff809047fb at wlan_clone_create+0x16b > #5 0xffffffff808e6079 at ifc_simple_create+0x89 > #6 0xffffffff808e5cc5 at if_clone_createif+0x65 > #7 0xffffffff808e4546 at ifioctl+0x306 > #8 0xffffffff80879755 at kern_ioctl+0x115 > #9 0xffffffff8087998d at sys_ioctl+0xfd > #10 0xffffffff80b17d60 at amd64_syscall+0x450 > #11 0xffffffff80b03497 at Xfast_syscall+0xf7 > > ## Here it has successfully added the net.bpf.tscfg.wlan0 sysctl entry > for wlan0 ## > > can't re-use a leaf (wlan0)! > > ## Here SYSCTL_ADD_PROC() failed because leaf name is already used ## > > panic: bpfattach tscfgoid > cpuid = 1 > KDB: stack backtrace: > #0 0xffffffff808680ce at kdb_backtrace+0x5e > #1 0xffffffff80832c87 at panic+0x187 > #2 0xffffffff808da6f6 at bpfattach2+0x1f6 > #3 0xffffffff808e72ee at ether_ifattach+0xae > #4 0xffffffff808fd0a5 at ieee80211_vap_attach+0xb5 > #5 0xffffffff8074023c at wpi_vap_create+0xcc > #6 0xffffffff809047fb at wlan_clone_create+0x16b > #7 0xffffffff808e6079 at ifc_simple_create+0x89 > #8 0xffffffff808e5cc5 at if_clone_createif+0x65 > #9 0xffffffff808e4546 at ifioctl+0x306 > #10 0xffffffff80879755 at kern_ioctl+0x115 > #11 0xffffffff8087998d at sys_ioctl+0xfd > #12 0xffffffff80b17d60 at amd64_syscall+0x450 > #13 0xffffffff80b03497 at Xfast_syscall+0xf7 > > > > So after a bit of digging, ieee80211_vap_setup() calls > ieee80211_radiotap_vattach(), which explicitly calls bpfattach2(), and > then a subsequent call to ieee80211_vap_attach() indirectly calls into > bpfattach2() via the call to ether_ifattach(). > > This smells like a net80211 bug to me. I'm guessing, but I would suspect > ieee80211_vap_setup() shouldn't call ieee80211_radiotap_vattach() and > should let ieee80211_vap_attach() handle the BPF attachment via the call > to ether_ifattach(). > > Thoughts? This turns out not to be a bug in net80211, but rather an oversight on my part. I didn't consider the case where multiple DLTs can be attached to BPF with the same interface name. I reverted r228986 and have reworked the patch to instead store the per-interface time stamp configuration OID pointer and config variable in the ifnet. In testing my new patch, I found another problem. BPF maintains a list (bpf_iflist) of bpf_if structs, one per ifnet/dlt combo. Each call to bpf_attach() prepends a new bpf_if struct to the list. bpfdetach() is expected to reclaim all bpf_if structs which reference the specified ifnet from the list when it is called, but currently only removes the first it finds. As far as I can tell, the implementation of bpfdetach() leaks bpf_if references, and has done so since it was introduced in r58273. See here for the function added in r58273: http://svnweb.freebsd.org/base/head/sys/net/bpf.c?revision=58273&view=markup#l1311 I would like to commit something like the following as a fix: http://people.freebsd.org/~lstewart/patches/misc/bpfdetach_bpfif_leakfix_10.x.r229165.patch With the above patch and my revised r228986 patch both applied, I can no longer produce panics on my laptop. Robert, as you committed r58273, I'm hoping you might have some thoughts on this (even if it's almost 12 years later ;). Am I missing something subtle, or is my analysis sensible? Assuming my analysis and patch are sane, would you mind giving it a quick review so I can commit it? Adrian, would you mind applying both the above bpf leakfix patch followed by the revised sysclocksnap/tscfg patch below and testing to make sure your kernel no longer explodes on boot? http://people.freebsd.org/~lstewart/patches/misc/bpf_sysclocksnap_tscfg_postleakfix_10.x.r229165.patch Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 05:21:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 715AB1065676; Mon, 2 Jan 2012 05:21:09 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E92138FC08; Mon, 2 Jan 2012 05:21:08 +0000 (UTC) Received: by ghrr16 with SMTP id r16so6234356ghr.13 for ; Sun, 01 Jan 2012 21:21:08 -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 :content-type:content-transfer-encoding; bh=+sRKxrGAArqnj/00FoYJv65tQKDIOFz6Bow18VmZidI=; b=ERtOOS1RsuYirU86CKF1yeK6HjO09DfkMOR7W5SrAv+HxTJ2YUjoDUzpV+/DjzvaDU KJYtdxRwUtSU+n6zeB562NGeJlGWGX4uVQlpzsDrj3lUA0q7vNBuwHx8Bix/snjXZMHu S6x1YEplnMQyV3+WyLTNQiFWuINS1FrOG5g1U= MIME-Version: 1.0 Received: by 10.236.173.234 with SMTP id v70mr10917903yhl.32.1325481668277; Sun, 01 Jan 2012 21:21:08 -0800 (PST) Received: by 10.236.110.40 with HTTP; Sun, 1 Jan 2012 21:21:08 -0800 (PST) In-Reply-To: <20120101173342.GN83814@acme.spoerlein.net> References: <201112301058.pBUAwFsw010478@svn.freebsd.org> <20120101173342.GN83814@acme.spoerlein.net> Date: Mon, 2 Jan 2012 00:21:08 -0500 Message-ID: From: Ben Kaduk To: Ulrich Spoerlein , Ben Kaduk , 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: r228990 - in head/usr.sbin: IPXrouted adduser bluetooth/btpand bluetooth/sdpd bootparamd/bootparamd bsnmpd/modules/snmp_bridge bsnmpd/modules/snmp_hostres bsnmpd/modules/snmp_wlan bsnmp... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 05:21:09 -0000 On Sun, Jan 1, 2012 at 12:33 PM, Ulrich Spoerlein wrote: > On Fri, 2011-12-30 at 14:43:22 -0500, Ben Kaduk wrote: >> On Fri, Dec 30, 2011 at 5:58 AM, Ulrich Spoerlein wrot= e: >> > Modified: head/usr.sbin/cron/doc/CHANGES >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >> > --- head/usr.sbin/cron/doc/CHANGES =A0 =A0 =A0Fri Dec 30 10:45:00 2011= =A0 =A0 =A0 =A0(r228989) >> > +++ head/usr.sbin/cron/doc/CHANGES =A0 =A0 =A0Fri Dec 30 10:58:14 2011= =A0 =A0 =A0 =A0(r228990) >> > @@ -1,3 +1,6 @@ >> > +$FreeBSD$ >> > +-------- >> > + >> > =A0Vixie Cron =A0 =A0 =A0 =A0 =A0 =A0 Changes from V2 to V3 >> > =A0Paul Vixie >> > =A029-Dec-1993 >> > @@ -20,7 +23,7 @@ be reread whenever it changes. >> > >> > =A0I also added a "-e" option to crontab(1). =A0Nine people also sent = me diffs >> > =A0to add this option, but I had already implemented it on my own. =A0= I actually >> > -released an interrim version (V2.2, I think) for limited testing, and= got a >> > +released an interim version (V2.2, I think) for limited testing, and = got a >> >> Should we really be in the business of modifying Vixie's changelog? > > I'm replying here, but same goes for your comments on the other revision > (thanks for all those, btw). > > Warning, rant ahead: I can handle a rant :) > > Our current SVN repo is in an inconsistent state thanks to the dubious > introduction of svn keywords. There are files in there, converted over > via cvs2svn and never touched since, but our presubmit checks want to > either see a $FreeBSD$ tag in modified files, or have fbsd:nokeywords > set. The latter is kinda a no-brainer for everything under contrib/ but > I'm struggling with what to do exactly for files that are non-contrib > and may or may not be non-code. Should the keywords be set on $subdir/* > or can I punch holes in the web of keywords as I see fit? (e.g. > $subdir/{README,CHANGES,foo.txt}) > > What's the point then anyway? SVN doesn't track files, but changesets. > Gah! I guess I did assume that the $FreeBSD$ keyword was being added because of the presubmit checks, but didn't actually say so. Sorry. It definitely is a grey area in which I don't presume to have an opinion, and I sympathize with your frustration. > > Oh wait, this ain't about the $FreeBSD$ keyword, but the typo-fix? I'm > sure that Vixie won't mind and do believe that correctness of spelling > is a worthy goal as we always tout the quality of our documentation. > I can accept that argument -- I mostly wanted to make sure this wasn't just a mechanical "run aspell over everything" or similar (though a later change did reveal that to not be the case). > FWIW, I'm not going to touch stuff under contrib/, etc. Sounds fine. > >> > =A0/* >> > - * Delete a rotated logfiles, when using clasic filenames. >> > + * Delete a rotated logfiles, when using classic filenames. >> >> "a logfiles" is inconsistent. =A0Without looking up the implementation, >> I'm going to guess that "a rotated logfile" is correct. > > When proofreading the spell-checked output I focused too narrowly on > just the typo that I fixed so that other typos in the same line/sentence > mostly went unnoticed. Will do better in the next couple of commits. It's easy to do -- I actually found myself also doing so a couple times when going through these. (There were quite a number of them, and thanks for going through them all by hand!) -Ben Kaduk From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 06:38:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40EEF1065688; Mon, 2 Jan 2012 06:38:38 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id A6AB98FC13; Mon, 2 Jan 2012 06:38:37 +0000 (UTC) Received: by ghrr16 with SMTP id r16so6244918ghr.13 for ; Sun, 01 Jan 2012 22:38:37 -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=R30geHAIyD45NTBNn6c4YOJSSIF2BxJNw98BGnIpd4g=; b=UEH9zEX5CHaAn8BdngrsapGuXxt8MRWzFlsLtCGARj7O0Z1jV7riFQ4xYXwnyeTLKB NrMqeTzCI1X98XVaLbcyMRbBA1QKLNPWg/ZzM3v+l/aP4G3XSdr80339eBH3pecDWjFU E77mElikrWbFw9fz9HuiuoEki1BupHcNjZjR4= MIME-Version: 1.0 Received: by 10.236.173.40 with SMTP id u28mr15218081yhl.15.1325486316971; Sun, 01 Jan 2012 22:38:36 -0800 (PST) Received: by 10.236.110.40 with HTTP; Sun, 1 Jan 2012 22:38:36 -0800 (PST) In-Reply-To: <20111230200405.GA293@glenbarber.us> References: <201112301058.pBUAwFsw010478@svn.freebsd.org> <20111230195444.GA25204@FreeBSD.org> <20111230200405.GA293@glenbarber.us> Date: Mon, 2 Jan 2012 01:38:36 -0500 Message-ID: From: Ben Kaduk To: Glen Barber Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, Ulrich Spoerlein Subject: Re: svn commit: r228990 - in head/usr.sbin: IPXrouted adduser bluetooth/btpand bluetooth/sdpd bootparamd/bootparamd bsnmpd/modules/snmp_bridge bsnmpd/modules/snmp_hostres bsnmpd/modules/snmp_wlan bsnmp... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 06:38:38 -0000 On Fri, Dec 30, 2011 at 3:04 PM, Glen Barber wrote: > On Fri, Dec 30, 2011 at 07:54:44PM +0000, Alexey Dokuchaev wrote: >> On Fri, Dec 30, 2011 at 02:43:22PM -0500, Ben Kaduk wrote: >> > On Fri, Dec 30, 2011 at 5:58 AM, Ulrich Spoerlein wr= ote: >> > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* is 11 bit wide that gives us upto= 2048 chunks. >> > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* is 11 bit wide that gives us up t= o 2048 chunks. >> > >> > Should be "11 bits", no? >> >> I'm not a native speaker, but I think "11 bit wide" is correct here. =A0= I >> could have probably got into specifics, but simple googling for "16 ton = shit >> dropped on me" yielded 525M results, while the same phrase with "tons" o= nly >> 18,9M. =A0:-^ >> > > Considering the full context, maybe it would be better written as: > > rsp_cs is an 11 bit wide field that gives ... (I'm a native speaker, too.) Were I to seriously wordsmith the comment, I would make it: * The minimum L2CAP MTU is 43 bytes. That means we need * ceiling(65536 / 43) =3D 1525 chunks to transfer the maximum * packet size with minimum MTU. Since the "rsp_cs" field in * fd_idx_t is 11 bits wide, that allows up to 2048 chunks which * is more than sufficient. But it may not be worth worrying about it this much. -Ben From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 09:18:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0461065670; Mon, 2 Jan 2012 09:18:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE488FC0A; Mon, 2 Jan 2012 09:18: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 q029IxIU056986; Mon, 2 Jan 2012 09:18:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q029Ix5E056984; Mon, 2 Jan 2012 09:18:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201020918.q029Ix5E056984@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 2 Jan 2012 09:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229265 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 09:18:59 -0000 Author: bz Date: Mon Jan 2 09:18:58 2012 New Revision: 229265 URL: http://svn.freebsd.org/changeset/base/229265 Log: As I came by and noticed add a comment that inp locking is a bit optistic (read: non-existent) here and should be fixed. Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Jan 2 04:47:38 2012 (r229264) +++ head/sys/netinet/raw_ip.c Mon Jan 2 09:18:58 2012 (r229265) @@ -544,6 +544,8 @@ rip_output(struct mbuf *m, struct socket * * When adding new socket options here, make sure to add access control * checks here as necessary. + * + * XXX-BZ inp locking? */ int rip_ctloutput(struct socket *so, struct sockopt *sopt) From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 12:12:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A068106564A; Mon, 2 Jan 2012 12:12:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 756AC8FC13; Mon, 2 Jan 2012 12:12: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 q02CCBBJ066110; Mon, 2 Jan 2012 12:12:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02CCBLS066089; Mon, 2 Jan 2012 12:12:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201021212.q02CCBLS066089@svn.freebsd.org> From: Ed Schouten Date: Mon, 2 Jan 2012 12:12: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: r229272 - in head/sys: ddb dev/ata dev/mxge dev/uart fs/nfs fs/nwfs fs/smbfs gnu/fs/xfs i386/ibcs2 kern libkern netgraph security/mac_lomac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 12:12:11 -0000 Author: ed Date: Mon Jan 2 12:12:10 2012 New Revision: 229272 URL: http://svn.freebsd.org/changeset/base/229272 Log: Use strchr() and strrchr(). It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel. Modified: head/sys/ddb/db_input.c head/sys/dev/ata/ata-disk.c head/sys/dev/mxge/if_mxge.c head/sys/dev/uart/uart_cpu_sparc64.c head/sys/fs/nfs/nfsport.h head/sys/fs/nwfs/nwfs_vfsops.c head/sys/fs/smbfs/smbfs_vfsops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/gnu/fs/xfs/xfs_vfsops.c head/sys/i386/ibcs2/ibcs2_socksys.c head/sys/i386/ibcs2/ibcs2_stat.c head/sys/kern/kern_intr.c head/sys/kern/kern_ktr.c head/sys/kern/kern_linker.c head/sys/kern/subr_hints.c head/sys/kern/tty_inq.c head/sys/kern/uipc_mqueue.c head/sys/libkern/fnmatch.c head/sys/netgraph/ng_ksocket.c head/sys/security/mac_lomac/mac_lomac.c Modified: head/sys/ddb/db_input.c ============================================================================== --- head/sys/ddb/db_input.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/ddb/db_input.c Mon Jan 2 12:12:10 2012 (r229272) @@ -253,7 +253,7 @@ db_inputchar(c) db_putnchars(BACKUP, db_lc - db_lbuf_start); db_putnchars(BLANK, db_le - db_lbuf_start); db_putnchars(BACKUP, db_le - db_lbuf_start); - db_le = index(db_lbuf_start, '\0'); + db_le = strchr(db_lbuf_start, '\0'); if (db_le[-1] == '\r' || db_le[-1] == '\n') *--db_le = '\0'; db_lc = db_le; Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/dev/ata/ata-disk.c Mon Jan 2 12:12:10 2012 (r229272) @@ -532,8 +532,8 @@ ad_describe(device_t dev) u_int8_t *marker, vendor[64], product[64]; /* try to separate the ATA model string into vendor and model parts */ - if ((marker = index(atadev->param.model, ' ')) || - (marker = index(atadev->param.model, '-'))) { + if ((marker = strchr(atadev->param.model, ' ')) || + (marker = strchr(atadev->param.model, '-'))) { int len = (marker - atadev->param.model); strncpy(vendor, atadev->param.model, len); Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/dev/mxge/if_mxge.c Mon Jan 2 12:12:10 2012 (r229272) @@ -2827,7 +2827,7 @@ mxge_media_init(mxge_softc_t *sc) } for (i = 0; i < 3; i++, ptr++) { - ptr = index(ptr, '-'); + ptr = strchr(ptr, '-'); if (ptr == NULL) { device_printf(sc->dev, "only %d dashes in PC?!?\n", i); Modified: head/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_sparc64.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/dev/uart/uart_cpu_sparc64.c Mon Jan 2 12:12:10 2012 (r229272) @@ -71,7 +71,7 @@ uart_cpu_channel(char *dev) if ((aliases = OF_finddevice("/aliases")) != -1) (void)OF_getprop(aliases, dev, alias, sizeof(alias)); len = strlen(alias); - if ((p = rindex(alias, ':')) == NULL) + if ((p = strrchr(alias, ':')) == NULL) return (0); p++; if (p - alias == len - 1 && (*p == 'a' || *p == 'b')) Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/fs/nfs/nfsport.h Mon Jan 2 12:12:10 2012 (r229272) @@ -712,7 +712,7 @@ MALLOC_DECLARE(M_NEWNFSDROLLBACK); /* * Set this macro to index() or strchr(), whichever is supported. */ -#define STRCHR(s, c) index((s), (c)) +#define STRCHR(s, c) strchr((s), (c)) /* * Set the n_time in the client write rpc, as required. Modified: head/sys/fs/nwfs/nwfs_vfsops.c ============================================================================== --- head/sys/fs/nwfs/nwfs_vfsops.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/fs/nwfs/nwfs_vfsops.c Mon Jan 2 12:12:10 2012 (r229272) @@ -206,10 +206,10 @@ static int nwfs_mount(struct mount *mp) pe = pc+sizeof(mp->mnt_stat.f_mntfromname); bzero(pc, MNAMELEN); *(pc++) = '/'; - pc = index(strncpy(pc, conn->li.server, pe-pc-2),0); + pc = strchr(strncpy(pc, conn->li.server, pe - pc - 2), 0); if (pc < pe-1) { *(pc++) = ':'; - pc=index(strncpy(pc, conn->li.user, pe-pc-2),0); + pc = strchr(strncpy(pc, conn->li.user, pe - pc - 2), 0); if (pc < pe-1) { *(pc++) = '/'; strncpy(pc, nmp->m.mounted_vol, pe-pc-2); Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/fs/smbfs/smbfs_vfsops.c Mon Jan 2 12:12:10 2012 (r229272) @@ -234,10 +234,10 @@ smbfs_mount(struct mount *mp) bzero(pc, MNAMELEN); *pc++ = '/'; *pc++ = '/'; - pc=index(strncpy(pc, vcp->vc_username, pe - pc - 2), 0); + pc = strchr(strncpy(pc, vcp->vc_username, pe - pc - 2), 0); if (pc < pe-1) { *(pc++) = '@'; - pc = index(strncpy(pc, vcp->vc_srvname, pe - pc - 2), 0); + pc = strchr(strncpy(pc, vcp->vc_srvname, pe - pc - 2), 0); if (pc < pe - 1) { *(pc++) = '/'; strncpy(pc, ssp->ss_name, pe - pc - 2); Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/fs/smbfs/smbfs_vnops.c Mon Jan 2 12:12:10 2012 (r229272) @@ -1039,7 +1039,7 @@ smbfs_pathcheck(struct smbmount *smp, co * Backslash characters, being a path delimiter, are prohibited * within a path component even for LOOKUP operations. */ - if (index(name, '\\') != NULL) + if (strchr(name, '\\') != NULL) return ENOENT; if (nameiop == LOOKUP) @@ -1051,20 +1051,20 @@ smbfs_pathcheck(struct smbmount *smp, co */ if (nmlen > 12) return ENAMETOOLONG; - cp = index(name, '.'); + cp = strchr(name, '.'); if (cp == NULL) return error; if (cp == name || (cp - name) > 8) return error; - cp = index(cp + 1, '.'); + cp = strchr(cp + 1, '.'); if (cp != NULL) return error; for (cp = name, i = 0; i < nmlen; i++, cp++) - if (index(badchars83, *cp) != NULL) + if (strchr(badchars83, *cp) != NULL) return error; } for (cp = name, i = 0; i < nmlen; i++, cp++) - if (index(badchars, *cp) != NULL) + if (strchr(badchars, *cp) != NULL) return error; return 0; } Modified: head/sys/gnu/fs/xfs/xfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_vfsops.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/gnu/fs/xfs/xfs_vfsops.c Mon Jan 2 12:12:10 2012 (r229272) @@ -1743,8 +1743,7 @@ xfs_parseargs( while ((this_char = strsep(&options, ",")) != NULL) { if (!*this_char) continue; - - if ((value = index(this_char, '=')) != NULL) + if ((value = strchr(this_char, '=')) != NULL) *value++ = 0; if (!strcmp(this_char, MNTOPT_LOGBUFS)) { Modified: head/sys/i386/ibcs2/ibcs2_socksys.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_socksys.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/i386/ibcs2/ibcs2_socksys.c Mon Jan 2 12:12:10 2012 (r229272) @@ -152,7 +152,7 @@ ibcs2_getipdomainname(td, uap) /* Get the domain name. */ getcredhostname(td->td_ucred, hname, sizeof(hname)); - dptr = index(hname, '.'); + dptr = strchr(hname, '.'); if ( dptr ) dptr++; else @@ -182,7 +182,7 @@ ibcs2_setipdomainname(td, uap) return EINVAL; /* Get the host's unqualified name (strip off the domain) */ - ptr = index(hname, '.'); + ptr = strchr(hname, '.'); if ( ptr != NULL ) { ptr++; *ptr = '\0'; Modified: head/sys/i386/ibcs2/ibcs2_stat.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_stat.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/i386/ibcs2/ibcs2_stat.c Mon Jan 2 12:12:10 2012 (r229272) @@ -212,7 +212,7 @@ ibcs2_utssys(td, uap) IBCS2_UNAME_VERSION, sizeof(sut.version) - 1); getcredhostname(td->td_ucred, machine_name, sizeof(machine_name) - 1); - p = index(machine_name, '.'); + p = strchr(machine_name, '.'); if ( p ) *p = '\0'; strncpy(sut.nodename, machine_name, sizeof(sut.nodename) - 1); Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/kern/kern_intr.c Mon Jan 2 12:12:10 2012 (r229272) @@ -693,9 +693,9 @@ intr_event_describe_handler(struct intr_ * description at that point. If one is not found, find the * end of the name to use as the insertion point. */ - start = index(ih->ih_name, ':'); + start = strchr(ih->ih_name, ':'); if (start == NULL) - start = index(ih->ih_name, 0); + start = strchr(ih->ih_name, 0); /* * See if there is enough remaining room in the string for the @@ -1832,8 +1832,8 @@ DB_SHOW_COMMAND(intr, db_show_intr) struct intr_event *ie; int all, verbose; - verbose = index(modif, 'v') != NULL; - all = index(modif, 'a') != NULL; + verbose = strchr(modif, 'v') != NULL; + all = strchr(modif, 'a') != NULL; TAILQ_FOREACH(ie, &event_list, ie_list) { if (!all && TAILQ_EMPTY(&ie->ie_handlers)) continue; Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/kern/kern_ktr.c Mon Jan 2 12:12:10 2012 (r229272) @@ -341,9 +341,9 @@ DB_SHOW_COMMAND(ktr, db_ktr_all) tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1); tstate.first = -1; db_ktr_verbose = 0; - db_ktr_verbose |= (index(modif, 'v') != NULL) ? 2 : 0; - db_ktr_verbose |= (index(modif, 'V') != NULL) ? 1 : 0; /* just timestap please */ - if (index(modif, 'a') != NULL) { + db_ktr_verbose |= (strchr(modif, 'v') != NULL) ? 2 : 0; + db_ktr_verbose |= (strchr(modif, 'V') != NULL) ? 1 : 0; /* just timestap please */ + if (strchr(modif, 'a') != NULL) { db_disable_pager(); while (cncheckc() != -1) if (db_mach_vtrace() == 0) Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/kern/kern_linker.c Mon Jan 2 12:12:10 2012 (r229272) @@ -1013,7 +1013,7 @@ kern_kldload(struct thread *td, const ch * (kldname.ko, or kldname.ver.ko) treat it as an interface * name. */ - if (index(file, '/') || index(file, '.')) { + if (strchr(file, '/') || strchr(file, '.')) { kldname = file; modname = NULL; } else { @@ -1906,7 +1906,7 @@ linker_search_kld(const char *name) int len; /* qualified at all? */ - if (index(name, '/')) + if (strchr(name, '/')) return (linker_strdup(name)); /* traverse the linker path */ @@ -1927,7 +1927,7 @@ linker_basename(const char *path) { const char *filename; - filename = rindex(path, '/'); + filename = strrchr(path, '/'); if (filename == NULL) return path; if (filename[1]) Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/kern/subr_hints.c Mon Jan 2 12:12:10 2012 (r229272) @@ -133,8 +133,7 @@ res_find(int *line, int *startln, r_name, &r_unit, r_resname, r_value); if (hit && n != 4) { printf("CONFIG: invalid hint '%s'\n", cp); - /* XXX: abuse bogus index() declaration */ - p = index(cp, 'h'); + p = strchr(cp, 'h'); *p = 'H'; hit = 0; } @@ -172,18 +171,18 @@ res_find(int *line, int *startln, s = cp; /* This is a bit of a hack, but at least is reentrant */ /* Note that it returns some !unterminated! strings. */ - s = index(s, '.') + 1; /* start of device */ + s = strchr(s, '.') + 1; /* start of device */ if (ret_name) *ret_name = s; - s = index(s, '.') + 1; /* start of unit */ + s = strchr(s, '.') + 1; /* start of unit */ if (ret_namelen && ret_name) *ret_namelen = s - *ret_name - 1; /* device length */ if (ret_unit) *ret_unit = r_unit; - s = index(s, '.') + 1; /* start of resname */ + s = strchr(s, '.') + 1; /* start of resname */ if (ret_resname) *ret_resname = s; - s = index(s, '=') + 1; /* start of value */ + s = strchr(s, '=') + 1; /* start of value */ if (ret_resnamelen && ret_resname) *ret_resnamelen = s - *ret_resname - 1; /* value len */ if (ret_value) Modified: head/sys/kern/tty_inq.c ============================================================================== --- head/sys/kern/tty_inq.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/kern/tty_inq.c Mon Jan 2 12:12:10 2012 (r229272) @@ -355,7 +355,7 @@ ttyinq_findchar(struct ttyinq *ti, const return (0); while (boff < bend) { - if (index(breakc, tib->tib_data[boff]) && !GETBIT(tib, boff)) { + if (strchr(breakc, tib->tib_data[boff]) && !GETBIT(tib, boff)) { *lastc = tib->tib_data[boff]; return (boff - ti->ti_begin + 1); } Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/kern/uipc_mqueue.c Mon Jan 2 12:12:10 2012 (r229272) @@ -1974,7 +1974,7 @@ kern_kmq_open(struct thread *td, const c * characters. */ len = strlen(path); - if (len < 2 || path[0] != '/' || index(path + 1, '/') != NULL) + if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) return (EINVAL); error = falloc(td, &fp, &fd, 0); @@ -2077,7 +2077,7 @@ sys_kmq_unlink(struct thread *td, struct return (error); len = strlen(path); - if (len < 2 || path[0] != '/' || index(path + 1, '/') != NULL) + if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) return (EINVAL); sx_xlock(&mqfs_data.mi_lock); Modified: head/sys/libkern/fnmatch.c ============================================================================== --- head/sys/libkern/fnmatch.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/libkern/fnmatch.c Mon Jan 2 12:12:10 2012 (r229272) @@ -89,12 +89,12 @@ fnmatch(const char *pattern, const char if (c == EOS) if (flags & FNM_PATHNAME) return ((flags & FNM_LEADING_DIR) || - index(string, '/') == NULL ? + strchr(string, '/') == NULL ? 0 : FNM_NOMATCH); else return (0); else if (c == '/' && flags & FNM_PATHNAME) { - if ((string = index(string, '/')) == NULL) + if ((string = strchr(string, '/')) == NULL) return (FNM_NOMATCH); break; } Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/netgraph/ng_ksocket.c Mon Jan 2 12:12:10 2012 (r229272) @@ -223,7 +223,7 @@ ng_ksocket_sockaddr_parse(const struct n /* Get socket address family followed by a slash */ while (isspace(s[*off])) (*off)++; - if ((t = index(s + *off, '/')) == NULL) + if ((t = strchr(s + *off, '/')) == NULL) return (EINVAL); if ((len = t - (s + *off)) > sizeof(fambuf) - 1) return (EINVAL); @@ -565,14 +565,14 @@ ng_ksocket_newhook(node_p node, hook_p h /* Extract family, type, and protocol from hook name */ snprintf(name, sizeof(name), "%s", name0); s1 = name; - if ((s2 = index(s1, '/')) == NULL) + if ((s2 = strchr(s1, '/')) == NULL) return (EINVAL); *s2++ = '\0'; family = ng_ksocket_parse(ng_ksocket_families, s1, 0); if (family == -1) return (EINVAL); s1 = s2; - if ((s2 = index(s1, '/')) == NULL) + if ((s2 = strchr(s1, '/')) == NULL) return (EINVAL); *s2++ = '\0'; type = ng_ksocket_parse(ng_ksocket_types, s1, 0); Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Mon Jan 2 09:58:39 2012 (r229271) +++ head/sys/security/mac_lomac/mac_lomac.c Mon Jan 2 12:12:10 2012 (r229272) @@ -762,10 +762,10 @@ lomac_parse(struct mac_lomac *ml, char * /* Do we have a range? */ single = string; - range = index(string, '('); + range = strchr(string, '('); if (range == single) single = NULL; - auxsingle = index(string, '['); + auxsingle = strchr(string, '['); if (auxsingle == single) single = NULL; if (range != NULL && auxsingle != NULL) @@ -776,13 +776,13 @@ lomac_parse(struct mac_lomac *ml, char * *range = '\0'; range++; rangelow = range; - rangehigh = index(rangelow, '-'); + rangehigh = strchr(rangelow, '-'); if (rangehigh == NULL) return (EINVAL); rangehigh++; if (*rangelow == '\0' || *rangehigh == '\0') return (EINVAL); - rangeend = index(rangehigh, ')'); + rangeend = strchr(rangehigh, ')'); if (rangeend == NULL) return (EINVAL); if (*(rangeend + 1) != '\0') @@ -798,7 +798,7 @@ lomac_parse(struct mac_lomac *ml, char * /* Nul terminate the end of the single string. */ *auxsingle = '\0'; auxsingle++; - auxsingleend = index(auxsingle, ']'); + auxsingleend = strchr(auxsingle, ']'); if (auxsingleend == NULL) return (EINVAL); if (*(auxsingleend + 1) != '\0') From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 13:03:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9327C1065670; Mon, 2 Jan 2012 13:03:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 824098FC1D; Mon, 2 Jan 2012 13:03: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 q02D3EvJ067934; Mon, 2 Jan 2012 13:03:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02D3ER5067932; Mon, 2 Jan 2012 13:03:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201021303.q02D3ER5067932@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 2 Jan 2012 13:03: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: r229276 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 13:03:14 -0000 Author: bz Date: Mon Jan 2 13:03:13 2012 New Revision: 229276 URL: http://svn.freebsd.org/changeset/base/229276 Log: Remove an uneeded inpcb forward declaration and align the function declaration following to match the style in the rest of the file. MFC after: 3 days Modified: head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Mon Jan 2 13:01:57 2012 (r229275) +++ head/sys/netinet6/in6_var.h Mon Jan 2 13:03:13 2012 (r229276) @@ -791,8 +791,7 @@ void in6_ifremloop(struct ifaddr *); void in6_ifaddloop(struct ifaddr *); int in6_is_addr_deprecated __P((struct sockaddr_in6 *)); -struct inpcb; -int in6_src_ioctl __P((u_long, caddr_t)); +int in6_src_ioctl __P((u_long, caddr_t)); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 16:02:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03253106566C; Mon, 2 Jan 2012 16:02:31 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E600B8FC17; Mon, 2 Jan 2012 16:02: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 q02G2U0E073753; Mon, 2 Jan 2012 16:02:30 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02G2UEF073751; Mon, 2 Jan 2012 16:02:30 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201201021602.q02G2UEF073751@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 2 Jan 2012 16:02: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: r229284 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 16:02:31 -0000 Author: bschmidt Date: Mon Jan 2 16:02:30 2012 New Revision: 229284 URL: http://svn.freebsd.org/changeset/base/229284 Log: MCS32 equals 32, not 8*ic_txstream. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Mon Jan 2 14:45:30 2012 (r229283) +++ head/sys/net80211/ieee80211_ht.c Mon Jan 2 16:02:30 2012 (r229284) @@ -433,7 +433,7 @@ ieee80211_get_suphtrates(struct ieee8021 ADDRATE(i); if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && (ic->ic_htcaps & IEEE80211_HTC_TXMCS32)) - ADDRATE(i); + ADDRATE(32); if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) { if (ic->ic_txstream >= 2) { for (i = 33; i <= 38; i++) From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 17:02:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 395B7106566C; Mon, 2 Jan 2012 17:02:45 +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 E165F8FC08; Mon, 2 Jan 2012 17:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q02H2j6g075922; Mon, 2 Jan 2012 17:02:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02H2jct075917; Mon, 2 Jan 2012 17:02:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201021702.q02H2jct075917@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jan 2012 17:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229288 - in head/sys/cam: ata scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 17:02:46 -0000 Author: mav Date: Mon Jan 2 17:02:45 2012 New Revision: 229288 URL: http://svn.freebsd.org/changeset/base/229288 Log: Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call. cam_periph_runccb() since the beginning checks it and releases device queue. After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double release, so removed code is unreachable now. MFC after: 1 month Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_ses.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Jan 2 16:54:21 2012 (r229287) +++ head/sys/cam/ata/ata_da.c Mon Jan 2 17:02:45 2012 (r229288) @@ -493,13 +493,6 @@ adaclose(struct disk *dp) if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) xpt_print(periph->path, "Synchronize cache failed\n"); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); xpt_release_ccb(ccb); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jan 2 16:54:21 2012 (r229287) +++ head/sys/cam/scsi/scsi_da.c Mon Jan 2 17:02:45 2012 (r229288) @@ -990,13 +990,6 @@ daclose(struct disk *dp) } } - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - xpt_release_ccb(ccb); } @@ -2281,14 +2274,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) goto rc16ok; @@ -2326,14 +2311,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) { block_len = scsi_4btoul(rcap->length); maxsector = scsi_4btoul(rcap->addr); @@ -2360,14 +2337,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) { rc16ok: block_len = scsi_4btoul(rcaplong->length); Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Mon Jan 2 16:54:21 2012 (r229287) +++ head/sys/cam/scsi/scsi_sa.c Mon Jan 2 17:02:45 2012 (r229288) @@ -1853,14 +1853,12 @@ samount(struct cam_periph *periph, int o MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); if (error == ENXIO) { softc->flags &= ~SA_FLAG_TAPE_MOUNTED; scsi_test_unit_ready(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } else if (error) { /* * We don't need to freeze the tape because we @@ -1882,7 +1880,6 @@ samount(struct cam_periph *periph, int o MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) { @@ -1905,7 +1902,6 @@ samount(struct cam_periph *periph, int o FALSE, FALSE, 1, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); /* * In case this doesn't work, do a REWIND instead @@ -1915,7 +1911,6 @@ samount(struct cam_periph *periph, int o FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } if (error) { xpt_release_ccb(ccb); @@ -1945,13 +1940,11 @@ samount(struct cam_periph *periph, int o IO_TIMEOUT); (void) cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); scsi_rewind(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG, FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO, SF_NO_PRINT | SF_RETRY_UA, softc->device_stats); - QFRLS(ccb); if (error) { xpt_print(periph->path, "unable to rewind after test read\n"); @@ -1969,7 +1962,6 @@ samount(struct cam_periph *periph, int o error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO, SF_NO_PRINT | SF_RETRY_UA, softc->device_stats); - QFRLS(ccb); xpt_release_ccb(ccb); if (error != 0) { @@ -2580,7 +2572,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); status = ccb->ccb_h.status & CAM_STATUS_MASK; @@ -2644,7 +2635,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); if (error != 0) goto sagetparamsexit; @@ -2956,7 +2946,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, sense_flags, softc->device_stats); - QFRLS(ccb); if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) { int idx; @@ -3014,7 +3003,6 @@ retry: ccb->ccb_h.retry_count = 1; cam_periph_runccb(ccb, saerror, 0, sense_flags, softc->device_stats); - QFRLS(ccb); } xpt_release_ccb(ccb); @@ -3072,7 +3060,6 @@ saprevent(struct cam_periph *periph, int SSD_FULL_SIZE, SCSIOP_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, sf, softc->device_stats); - QFRLS(ccb); if (error == 0) { if (action == PR_ALLOW) softc->flags &= ~SA_FLAG_TAPE_LOCKED; @@ -3102,9 +3089,6 @@ sarewind(struct cam_periph *periph) error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - xpt_release_ccb(ccb); if (error == 0) softc->fileno = softc->blkno = (daddr_t) 0; @@ -3138,9 +3122,6 @@ saspace(struct cam_periph *periph, int c error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - xpt_release_ccb(ccb); /* @@ -3212,9 +3193,6 @@ sawritefilemarks(struct cam_periph *peri error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - if (error == 0 && nmarks) { struct sa_softc *softc = (struct sa_softc *)periph->softc; nwm = nmarks - softc->last_ctl_resid; @@ -3265,8 +3243,6 @@ sardpos(struct cam_periph *periph, int h softc->dsreg = MTIO_DSREG_RBSY; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); if (error == 0) { if (loc.flags & SA_RPOS_UNCERTAIN) { @@ -3306,8 +3282,6 @@ sasetpos(struct cam_periph *periph, int softc->dsreg = MTIO_DSREG_POS; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); xpt_release_ccb(ccb); /* * Note relative file && block number position as now unknown. @@ -3335,8 +3309,6 @@ saretension(struct cam_periph *periph) error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); xpt_release_ccb(ccb); if (error == 0) softc->fileno = softc->blkno = (daddr_t) 0; @@ -3362,7 +3334,6 @@ sareservereleaseunit(struct cam_periph * error = cam_periph_runccb(ccb, saerror, 0, SF_RETRY_UA | SF_NO_PRINT, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - QFRLS(ccb); xpt_release_ccb(ccb); /* @@ -3394,7 +3365,6 @@ saloadunload(struct cam_periph *periph, softc->dsreg = (load)? MTIO_DSREG_LD : MTIO_DSREG_UNL; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - QFRLS(ccb); xpt_release_ccb(ccb); if (error || load == 0) @@ -3425,8 +3395,6 @@ saerase(struct cam_periph *periph, int l error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); xpt_release_ccb(ccb); return (error); } Modified: head/sys/cam/scsi/scsi_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_ses.c Mon Jan 2 16:54:21 2012 (r229287) +++ head/sys/cam/scsi/scsi_ses.c Mon Jan 2 17:02:45 2012 (r229288) @@ -679,8 +679,6 @@ ses_runcmd(struct ses_softc *ssc, char * bcopy(cdb, ccb->csio.cdb_io.cdb_bytes, cdbl); error = cam_periph_runccb(ccb, seserror, SES_CFLAGS, SES_FLAGS, NULL); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); if (error) { if (dptr) { *dlenp = dlen; From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 19:27:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F646106566C; Mon, 2 Jan 2012 19:27:25 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 621848FC08; Mon, 2 Jan 2012 19:27:24 +0000 (UTC) Received: from DLREXHUB01.intra.dlr.de (172.21.152.130) by dlrexedge01.dlr.de (172.21.163.100) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 2 Jan 2012 20:27:00 +0100 Received: from beagle.kn.op.dlr.de (129.247.178.136) by smtp.dlr.de (172.21.152.151) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 2 Jan 2012 20:27:01 +0100 Date: Mon, 2 Jan 2012 20:26:55 +0100 From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Ulrich Spoerlein In-Reply-To: <20120101171324.GM83814@acme.spoerlein.net> Message-ID: <20120102201549.X41320@beagle.kn.op.dlr.de> References: <201112301058.pBUAwFsw010478@svn.freebsd.org> <20111230204653.Y31442@beagle.kn.op.dlr.de> <20120101171324.GM83814@acme.spoerlein.net> X-OpenPGP-Key: harti@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1964543108-640420677-1325532415=:41320" X-Originating-IP: [129.247.178.136] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Harti Brandt , Ben Kaduk Subject: Re: svn commit: r228990 - in head/usr.sbin: IPXrouted adduser bluetooth/btpand bluetooth/sdpd bootparamd/bootparamd bsnmpd/modules/snmp_bridge bsnmpd/modules/snmp_hostres bsnmpd/modules/snmp_wlan bsnmp... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Harti Brandt List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 19:27:25 -0000 --1964543108-640420677-1325532415=:41320 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: QUOTED-PRINTABLE Hi Uli, On Sun, 1 Jan 2012, Ulrich Spoerlein wrote: US>Sorry for the delay. US> US>On Fri, 2011-12-30 at 20:50:16 +0100, Harti Brandt wrote: US>> On Fri, 30 Dec 2011, Ben Kaduk wrote: US>> >On Fri, Dec 30, 2011 at 5:58 AM, Ulrich Spoerlein w= rote: US>> >> Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-M= IB.txt US>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D US>> >> --- head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt= =9A =9A Fri Dec 30 10:45:00 2011 =9A =9A =9A =9A(r228989) US>> >> +++ head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt= =9A =9A Fri Dec 30 10:58:14 2011 =9A =9A =9A =9A(r228990) US>> >> @@ -82,8 +82,8 @@ WlanMgmtReasonCode ::=3D TEXTUAL-CONVENTIO US>> >> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9AassociationLeave(8), US>> >> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9AassociationNotAuthenticated(= 9), US>> >> =9A-- XXX: TODO - FIXME US>> >> - =9A =9A =9A =9A =9A =9A =9A =9A =9A dissasocPwrcapBad(10), US>> >> - =9A =9A =9A =9A =9A =9A =9A =9A =9A dissasocSuperchanBad(11), US>> >> + =9A =9A =9A =9A =9A =9A =9A =9A =9A disassocPwrcapBad(10), US>> >> + =9A =9A =9A =9A =9A =9A =9A =9A =9A disassocSuperchanBad(11), US>> > US>> >This file looks like it might be intended to be machine-readable -- I US>> >would worry about changing it without test/review. US>> >Perhaps this spelling "error" is even the reason for the XXX comment = above. US>>=20 US>> Absolutely. If there is a spelling error in an SNMP MIB outside commen= ts=20 US>> or description strings it must stay there. Otherwise applications read= ing=20 US>> that file will break. US>>=20 US>> This is also true for the corresponding .def file. US>>=20 US>> harti US> US>Neither Google, Bing nor Google Code Search can find any occurrence of US>any of the two words in either spelling, except in our tree, of course. US>This leads me to believe that at least no known Open Source project will US>be affected by the change. But that doesn't say much. US> US>Is this a non-backwards compatible change that we can do when going from US>9.x to 10.0? I'm fine with backing it out, too, if you think this will US>actually break anything for third parties. Just say the word. Actually there are several RFCs which contain descriptions on doing MIB=20 revisions: RFC 2578, RFC 2579 and RFC 4181. There may be others. 4181=20 contains the following text: "RFC 2579 Section 5 specifies rules that apply to revisions of textual convention definitions. The following guideline corrects an error in these rules: - Bullet (1) allows the labels of named numbers and named bits in SYNTAX clauses of type enumerated INTEGER or BITS to be changed. This can break compilation compatibility, since those labels may be used by DEFVAL clauses in modules that import the definitions of the affected TCs. Therefore, labels of named numbers and named bits MUST NOT be changed when revising IETF MIB modules (except to correct typographical errors), and they SHOULD NOT be changed when revising enterprise MIB modules." So for the given MIB the term "SHOULD NOT" applies. What I would do is: - keep the misspelled definitions and mark them with a comment as=20 deprecated (unfortunately one can formally deprecate MIB objects, but not= =20 integer names). - add correctly spelled definitions - in any case add a revision statement to the MODULE-TYPE macro. Even if you find no open source uses of the MIB, there may be internal=20 uses in companies. I have a number of MIB modules that use FreeBSD modules= =20 (albeit not the WLAN module) that are not intended to be released outside= =20 our institute because they are quite special-purpose and not of use for=20 somebody else. Nevertheless I would try to not break this kind of use. harti --1964543108-640420677-1325532415=:41320-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 20:28:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD226106564A; Mon, 2 Jan 2012 20:28:33 +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 968018FC0C; Mon, 2 Jan 2012 20:28:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q02KSX34085082; Mon, 2 Jan 2012 20:28:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02KSXFH085080; Mon, 2 Jan 2012 20:28:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201022028.q02KSXFH085080@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 2 Jan 2012 20:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229317 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 20:28:33 -0000 Author: hselasky Date: Mon Jan 2 20:28:33 2012 New Revision: 229317 URL: http://svn.freebsd.org/changeset/base/229317 Log: Make sure we probe and attach the root HUB after resume else no devices will appear again. MFC after: 1 day Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Mon Jan 2 19:55:59 2012 (r229316) +++ head/sys/dev/usb/controller/usb_controller.c Mon Jan 2 20:28:33 2012 (r229317) @@ -473,10 +473,18 @@ usb_bus_resume(struct usb_proc_msg *pm) if (bus->methods->set_hw_power != NULL) (bus->methods->set_hw_power) (bus); + /* restore USB configuration to index 0 */ err = usbd_set_config_index(udev, 0); if (err) device_printf(bus->bdev, "Could not configure root HUB\n"); + /* probe and attach */ + err = usb_probe_and_attach(udev, USB_IFACE_INDEX_ANY); + if (err) { + device_printf(bus->bdev, "Could not probe and " + "attach root HUB\n"); + } + usbd_enum_unlock(udev); USB_BUS_LOCK(bus); From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 21:01:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D683106564A; Mon, 2 Jan 2012 21:01:17 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 00C0A8FC13; Mon, 2 Jan 2012 21:01:16 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.1.339.1; Mon, 2 Jan 2012 15:50:24 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id DF8CA33C02; Mon, 2 Jan 2012 15:50:23 -0500 (EST) Date: Mon, 2 Jan 2012 15:50:23 -0500 From: Ed Maste To: Hans Petter Selasky Message-ID: <20120102205023.GA24820@sandvine.com> References: <201201022028.q02KSXFH085080@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201201022028.q02KSXFH085080@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: r229317 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 21:01:17 -0000 On Mon, Jan 02, 2012 at 08:28:33PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Jan 2 20:28:33 2012 > New Revision: 229317 > URL: http://svn.freebsd.org/changeset/base/229317 > > Log: > Make sure we probe and attach the root HUB after > resume else no devices will appear again. This fixes my problem with USB devices after resume - Thanks! -Ed From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 21:57:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E76E1065670; Mon, 2 Jan 2012 21:57:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EAC08FC08; Mon, 2 Jan 2012 21:57:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q02LvxP4089387; Mon, 2 Jan 2012 21:57:59 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02Lvxmi089384; Mon, 2 Jan 2012 21:57:59 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201022157.q02Lvxmi089384@svn.freebsd.org> From: Robert Watson Date: Mon, 2 Jan 2012 21:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229319 - in head: share/man/man5 share/mk tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 21:57:59 -0000 Author: rwatson Date: Mon Jan 2 21:57:58 2012 New Revision: 229319 URL: http://svn.freebsd.org/changeset/base/229319 Log: Add WITHOUT_CAPSICUM src.conf(5) define, which can be used to compile out use of Capsicum by userspace applications. MFC after: 3 weeks Sponsored by: Google, Inc. Added: head/tools/build/options/WITHOUT_CAPSICUM (contents, props changed) Modified: head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Jan 2 20:39:59 2012 (r229318) +++ head/share/man/man5/src.conf.5 Mon Jan 2 21:57:58 2012 (r229319) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd December 2, 2011 +.Dd December 30, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -251,6 +251,9 @@ Set to build some programs without optio .\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr calendar 1 . +.It Va WITHOUT_CAPSICUM +.\" $FreeBSD$ +Set to not build Capsicum support into system programs. .It Va WITHOUT_CDDL .\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb Set to not build code licensed under Sun's CDDL. @@ -821,7 +824,7 @@ Set to not build .Xr ppp 8 and related programs. .It Va WITHOUT_PROFILE -.\" from FreeBSD: head/tools/build/options/WITH_PROFILE 228143 2011-11-29 19:46:17Z fjoe +.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe Set to avoid compiling profiled libraries. .It Va WITHOUT_QUOTAS .\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jan 2 20:39:59 2012 (r229318) +++ head/share/mk/bsd.own.mk Mon Jan 2 21:57:58 2012 (r229319) @@ -322,6 +322,7 @@ __DEFAULT_YES_OPTIONS = \ BSNMP \ BZIP2 \ CALENDAR \ + CAPSICUM \ CDDL \ CPP \ CRYPT \ Added: head/tools/build/options/WITHOUT_CAPSICUM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_CAPSICUM Mon Jan 2 21:57:58 2012 (r229319) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build Capsicum support into system programs. From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 22:42:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF9301065677; Mon, 2 Jan 2012 22:42:53 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C60B8FC0A; Mon, 2 Jan 2012 22:42:53 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so18027974obb.13 for ; Mon, 02 Jan 2012 14:42:52 -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=9Oct8IdXaioou1/618V8W5+jQXLhVp+ctt6PFrQGgds=; b=BQSLmsqJfCAtLF8XZ0sMqsufCAsDUBHS25TgKesdJiMSFJ5Bmj35jD7/a5gcvfQZJk YUW1msEnNf0ya+5kJVU3hHf/Jy4fYlhzxxUIZUGCQ7A4+ed1rzoI9rgZt5aij6pgBj59 ErjC6NqSOJaUZ2tRQF7eI6tu3YBr3Qjx/F8HQ= MIME-Version: 1.0 Received: by 10.182.187.37 with SMTP id fp5mr17935532obc.21.1325544172926; Mon, 02 Jan 2012 14:42:52 -0800 (PST) Received: by 10.182.152.6 with HTTP; Mon, 2 Jan 2012 14:42:52 -0800 (PST) In-Reply-To: <201112191535.pBJFZ6hY063597@svn.freebsd.org> References: <201112191535.pBJFZ6hY063597@svn.freebsd.org> Date: Mon, 2 Jan 2012 14:42:52 -0800 Message-ID: From: Garrett Cooper To: Hans Petter Selasky 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: r228711 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 22:42:53 -0000 On Mon, Dec 19, 2011 at 7:35 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Dec 19 15:35:05 2011 > New Revision: 228711 > URL: http://svn.freebsd.org/changeset/base/228711 > > Log: > =A0Add code to wait for USB shutdown to be executed at system shutdown. > =A0Add sysctl which can be used to skip this waiting. > > =A0MFC after: =A0 =A03 days > > Modified: > =A0head/sys/dev/usb/controller/usb_controller.c > > Modified: head/sys/dev/usb/controller/usb_controller.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/usb/controller/usb_controller.c =A0 =A0 =A0 =A0Mon Dec 1= 9 14:55:14 2011 =A0 =A0 =A0 =A0(r228710) > +++ head/sys/dev/usb/controller/usb_controller.c =A0 =A0 =A0 =A0Mon Dec 1= 9 15:35:05 2011 =A0 =A0 =A0 =A0(r228711) > @@ -87,7 +87,12 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug > =A0static int usb_no_boot_wait =3D 0; > =A0TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); > =A0SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boo= t_wait, 0, > - =A0 =A0"No device enumerate waiting at boot."); > + =A0 =A0"No USB device enumerate waiting at boot."); > + > +static int usb_no_shutdown_wait =3D 0; > +TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); > +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RDTUN, &usb_no_s= hutdown_wait, 0, > + =A0 =A0"No USB device waiting at system shutdown."); > > =A0static devclass_t usb_devclass; > > @@ -277,11 +282,20 @@ usb_shutdown(device_t dev) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); > =A0 =A0 =A0 =A0} > > + =A0 =A0 =A0 device_printf(bus->bdev, "Controller shutdown\n"); > + > =A0 =A0 =A0 =A0USB_BUS_LOCK(bus); > =A0 =A0 =A0 =A0usb_proc_msignal(&bus->explore_proc, > =A0 =A0 =A0 =A0 =A0 =A0&bus->shutdown_msg[0], &bus->shutdown_msg[1]); > + =A0 =A0 =A0 if (usb_no_shutdown_wait =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* wait for shutdown callback to be execute= d */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_proc_mwait(&bus->explore_proc, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &bus->shutdown_msg[0], &bus->shutdo= wn_msg[1]); > + =A0 =A0 =A0 } > =A0 =A0 =A0 =A0USB_BUS_UNLOCK(bus); > > + =A0 =A0 =A0 device_printf(bus->bdev, "Controller shutdown complete\n"); > + These printouts are a bit chatty. Could they be put under USB_DEBUG ? Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 22:58:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5FC106564A; Mon, 2 Jan 2012 22:58:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4C7A8FC16; Mon, 2 Jan 2012 22:58:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q02MwWKl092155; Mon, 2 Jan 2012 22:58:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02MwW44092153; Mon, 2 Jan 2012 22:58:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201022258.q02MwW44092153@svn.freebsd.org> From: Ed Schouten Date: Mon, 2 Jan 2012 22:58: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: r229332 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 22:58:32 -0000 Author: ed Date: Mon Jan 2 22:58:32 2012 New Revision: 229332 URL: http://svn.freebsd.org/changeset/base/229332 Log: Remove extraneous semicolons. These macros are supposed to be invoked as regular functions, so remove them. Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Mon Jan 2 22:26:26 2012 (r229331) +++ head/include/stdatomic.h Mon Jan 2 22:58:32 2012 (r229332) @@ -106,13 +106,13 @@ enum memory_order { #if defined(__CLANG_ATOMICS) #define atomic_thread_fence(order) __atomic_thread_fence(order) -#define atomic_signal_fence(order) __asm volatile ("" : : : "memory"); +#define atomic_signal_fence(order) __asm volatile ("" : : : "memory") #elif defined(__GNUC_ATOMICS) #define atomic_thread_fence(order) __atomic_thread_fence(order) #define atomic_signal_fence(order) __atomic_signal_fence(order) #else #define atomic_thread_fence(order) __sync_synchronize() -#define atomic_signal_fence(order) __asm volatile ("" : : : "memory"); +#define atomic_signal_fence(order) __asm volatile ("" : : : "memory") #endif /* From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 22:59:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FC42106564A; Mon, 2 Jan 2012 22:59:51 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id 6D67B8FC15; Mon, 2 Jan 2012 22:59:50 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 224762331; Mon, 02 Jan 2012 23:59:48 +0100 From: Hans Petter Selasky To: Garrett Cooper Date: Mon, 2 Jan 2012 23:57:21 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201112191535.pBJFZ6hY063597@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201201022357.22021.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r228711 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 22:59:51 -0000 On Monday 02 January 2012 23:42:52 Garrett Cooper wrote: > On Mon, Dec 19, 2011 at 7:35 AM, Hans Petter Selasky > > wrote: > > Author: hselasky > > Date: Mon Dec 19 15:35:05 2011 > > New Revision: 228711 > > URL: http://svn.freebsd.org/changeset/base/228711 > > > > Log: > > Add code to wait for USB shutdown to be executed at system shutdown. > > Add sysctl which can be used to skip this waiting. > > > > MFC after: 3 days > > > > Modified: > > head/sys/dev/usb/controller/usb_controller.c > > > > Modified: head/sys/dev/usb/controller/usb_controller.c > > ========================================================================= > > ===== --- head/sys/dev/usb/controller/usb_controller.c Mon Dec 19 > > 14:55:14 2011 (r228710) +++ > > head/sys/dev/usb/controller/usb_controller.c Mon Dec 19 15:35:05 > > 2011 (r228711) @@ -87,7 +87,12 @@ SYSCTL_INT(_hw_usb_ctrl, > > OID_AUTO, debug > > static int usb_no_boot_wait = 0; > > TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); > > SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, > > &usb_no_boot_wait, 0, - "No device enumerate waiting at boot."); > > + "No USB device enumerate waiting at boot."); > > + > > +static int usb_no_shutdown_wait = 0; > > +TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); > > +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RDTUN, > > &usb_no_shutdown_wait, 0, + "No USB device waiting at system > > shutdown."); > > > > static devclass_t usb_devclass; > > > > @@ -277,11 +282,20 @@ usb_shutdown(device_t dev) > > return (0); > > } > > > > + device_printf(bus->bdev, "Controller shutdown\n"); > > + > > USB_BUS_LOCK(bus); > > usb_proc_msignal(&bus->explore_proc, > > &bus->shutdown_msg[0], &bus->shutdown_msg[1]); > > + if (usb_no_shutdown_wait == 0) { > > + /* wait for shutdown callback to be executed */ > > + usb_proc_mwait(&bus->explore_proc, > > + &bus->shutdown_msg[0], &bus->shutdown_msg[1]); > > + } > > USB_BUS_UNLOCK(bus); > > > > + device_printf(bus->bdev, "Controller shutdown complete\n"); > > + > > These printouts are a bit chatty. Could they be put under USB_DEBUG ? Yes, I can do that if others agree too. --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 00:22:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10FB01065670; Tue, 3 Jan 2012 00:22:09 +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 EFDF38FC13; Tue, 3 Jan 2012 00:22: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 q030M8BU096431; Tue, 3 Jan 2012 00:22:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q030M80s096429; Tue, 3 Jan 2012 00:22:08 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201201030022.q030M80s096429@svn.freebsd.org> From: Glen Barber Date: Tue, 3 Jan 2012 00:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229353 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 00:22:09 -0000 Author: gjb (doc committer) Date: Tue Jan 3 00:22:08 2012 New Revision: 229353 URL: http://svn.freebsd.org/changeset/base/229353 Log: Trivial standardization to a few comments in kern.pre.mk. Submitted by: arundel MFC after: 3 days Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jan 3 00:12:06 2012 (r229352) +++ head/sys/conf/kern.pre.mk Tue Jan 3 00:22:08 2012 (r229353) @@ -71,10 +71,10 @@ INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath # ... and the same for the NgATM stuff INCLUDES+= -I$S/contrib/ngatm -# .. and the same for twa +# ... and the same for twa INCLUDES+= -I$S/dev/twa -# ... and XFS +# ... and the same for XFS INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs # ... and the same for cxgb and cxgbe From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 00:41:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2BA41065672; Tue, 3 Jan 2012 00:41:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2438FC20; Tue, 3 Jan 2012 00:41:32 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so21306110vbb.13 for ; Mon, 02 Jan 2012 16:41:32 -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=l1xG4N2C6llgOcPuyNb6pr7ssGhn0xbJin4iG9jZR7c=; b=vAVuwYge1cDjqKsluFRQXo9l/YFjSTrtOl/lRxyZIeqtROMaHcAXu3tGPpu08IQi62 07JFS6D1AJ85N4w5IZMl7eUfVNXfM1NBlpJy+jWYc1ehFsNZFiLsXUjvJ5OYs5q9jLU1 4gSzOnvQt6DB3oPEAINsyUFuNRQO03XjRM79Q= MIME-Version: 1.0 Received: by 10.52.33.99 with SMTP id q3mr23600106vdi.100.1325551292539; Mon, 02 Jan 2012 16:41:32 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Mon, 2 Jan 2012 16:41:32 -0800 (PST) In-Reply-To: <201201021602.q02G2UEF073751@svn.freebsd.org> References: <201201021602.q02G2UEF073751@svn.freebsd.org> Date: Mon, 2 Jan 2012 16:41:32 -0800 X-Google-Sender-Auth: KYgF1TQ1vgG-Ja2fTurBL7RekEY Message-ID: From: Adrian Chadd To: Bernhard Schmidt 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: r229284 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 00:41:33 -0000 On 2 January 2012 08:02, Bernhard Schmidt wrote: > Author: bschmidt > Date: Mon Jan =A02 16:02:30 2012 > New Revision: 229284 > URL: http://svn.freebsd.org/changeset/base/229284 > > Log: > =A0MCS32 equals 32, not 8*ic_txstream. Good catch! Can you MFC it to 9/8 ? Adrian From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 01:07:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9476710656D2; Tue, 3 Jan 2012 01:07:32 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9CF7F8FC21; Tue, 3 Jan 2012 01:07:31 +0000 (UTC) Received: by eekc50 with SMTP id c50so18544676eek.13 for ; Mon, 02 Jan 2012 17:07:30 -0800 (PST) Received: by 10.14.35.101 with SMTP id t77mr20158234eea.21.1325552850332; Mon, 02 Jan 2012 17:07:30 -0800 (PST) Received: from amy.lab.techwires.net (dslb-088-067-219-219.pools.arcor-ip.net. [88.67.219.219]) by mx.google.com with ESMTPS id e12sm48006191eea.5.2012.01.02.17.07.29 (version=SSLv3 cipher=OTHER); Mon, 02 Jan 2012 17:07:29 -0800 (PST) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Adrian Chadd Date: Tue, 3 Jan 2012 02:07:34 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.0-PRERELEASE; KDE/4.7.3; amd64; ; ) References: <201201021602.q02G2UEF073751@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201030207.34599.bschmidt@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229284 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 01:07:32 -0000 On Tuesday 03 January 2012 01:41:32 Adrian Chadd wrote: > On 2 January 2012 08:02, Bernhard Schmidt wrote: > > Author: bschmidt > > Date: Mon Jan 2 16:02:30 2012 > > New Revision: 229284 > > URL: http://svn.freebsd.org/changeset/base/229284 > > > > Log: > > MCS32 equals 32, not 8*ic_txstream. > > Good catch! Can you MFC it to 9/8 ? Sure, after the usual MFC period. -- Bernhard From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 03:29:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD8F61065673; Tue, 3 Jan 2012 03:29:01 +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 B7C128FC0A; Tue, 3 Jan 2012 03:29:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q033T1CT003058; Tue, 3 Jan 2012 03:29:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q033T1wF003056; Tue, 3 Jan 2012 03:29:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201030329.q033T1wF003056@svn.freebsd.org> From: Alan Cox Date: Tue, 3 Jan 2012 03:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229363 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 03:29:01 -0000 Author: alc Date: Tue Jan 3 03:29:01 2012 New Revision: 229363 URL: http://svn.freebsd.org/changeset/base/229363 Log: Don't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and tmpfs_nocacheread(). It is both unnecessary and a pessimization. It results in either the page being zeroed twice or zeroed first and then overwritten by an I/O operation. MFC after: 3 weeks Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jan 3 01:07:02 2012 (r229362) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jan 3 03:29:01 2012 (r229363) @@ -442,7 +442,7 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p VM_OBJECT_LOCK(tobj); vm_object_pip_add(tobj, 1); m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { error = vm_pager_get_pages(tobj, &m, 1, 0); @@ -666,7 +666,7 @@ nocache: VM_OBJECT_LOCK(tobj); vm_object_pip_add(tobj, 1); tpg = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (tpg->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { error = vm_pager_get_pages(tobj, &tpg, 1, 0); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 07:05:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2EF61065670; Tue, 3 Jan 2012 07:05:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 877F58FC0A; Tue, 3 Jan 2012 07:05: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 q0375VsM009799; Tue, 3 Jan 2012 07:05:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0375V2b009794; Tue, 3 Jan 2012 07:05:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201030705.q0375V2b009794@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 07:05: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: r229366 - in head/sys: conf libkern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 07:05:31 -0000 Author: ed Date: Tue Jan 3 07:05:30 2012 New Revision: 229366 URL: http://svn.freebsd.org/changeset/base/229366 Log: Implement extensions on top of standards instead of the other way around. Now that index() and rindex() have become unused, simply turn them into wrappers around strchr() and strrchr(), respectively. Added: head/sys/libkern/strchr.c - copied, changed from r229111, head/sys/libkern/index.c head/sys/libkern/strrchr.c - copied, changed from r229111, head/sys/libkern/rindex.c Deleted: head/sys/libkern/index.c head/sys/libkern/rindex.c Modified: head/sys/conf/files head/sys/sys/libkern.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 3 04:12:40 2012 (r229365) +++ head/sys/conf/files Tue Jan 3 07:05:30 2012 (r229366) @@ -2551,7 +2551,6 @@ libkern/iconv_converter_if.m optional li libkern/iconv_ucs.c optional libiconv libkern/iconv_xlat.c optional libiconv libkern/iconv_xlat16.c optional libiconv -libkern/index.c standard libkern/inet_aton.c standard libkern/inet_ntoa.c standard libkern/inet_ntop.c standard @@ -2562,10 +2561,10 @@ libkern/memcmp.c standard libkern/qsort.c standard libkern/qsort_r.c standard libkern/random.c standard -libkern/rindex.c standard libkern/scanc.c standard libkern/strcasecmp.c standard libkern/strcat.c standard +libkern/strchr.c standard libkern/strcmp.c standard libkern/strcpy.c standard libkern/strcspn.c standard @@ -2576,6 +2575,7 @@ libkern/strlen.c standard libkern/strncmp.c standard libkern/strncpy.c standard libkern/strnlen.c standard +libkern/strrchr.c standard libkern/strsep.c standard libkern/strspn.c standard libkern/strstr.c standard Copied and modified: head/sys/libkern/strchr.c (from r229111, head/sys/libkern/index.c) ============================================================================== --- head/sys/libkern/index.c Sat Dec 31 14:57:52 2011 (r229111, copy source) +++ head/sys/libkern/strchr.c Tue Jan 3 07:05:30 2012 (r229366) @@ -33,14 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * index() is also present as the strchr() in the kernel; it does exactly the - * same thing as it's userland equivalent. - */ char * -index(p, ch) - const char *p; - int ch; +strchr(const char *p, int ch) { union { const char *cp; Copied and modified: head/sys/libkern/strrchr.c (from r229111, head/sys/libkern/rindex.c) ============================================================================== --- head/sys/libkern/rindex.c Sat Dec 31 14:57:52 2011 (r229111, copy source) +++ head/sys/libkern/strrchr.c Tue Jan 3 07:05:30 2012 (r229366) @@ -33,14 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * rindex() is also present as the strrchr() in the kernel; it does exactly the - * same thing as it's userland equivalent. - */ char * -rindex(p, ch) - const char *p; - int ch; +strrchr(const char *p, int ch) { union { const char *cp; Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Tue Jan 3 04:12:40 2012 (r229365) +++ head/sys/sys/libkern.h Tue Jan 3 07:05:30 2012 (r229366) @@ -99,12 +99,11 @@ void qsort(void *base, size_t nmemb, si void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *)); u_long random(void); -char *index(const char *, int); -char *rindex(const char *, int); int scanc(u_int, const u_char *, const u_char *, int); void srandom(u_long); int strcasecmp(const char *, const char *); char *strcat(char * __restrict, const char * __restrict); +char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char * __restrict, const char * __restrict) __pure; @@ -116,6 +115,7 @@ int strncasecmp(const char *, const cha int strncmp(const char *, const char *, size_t); char *strncpy(char * __restrict, const char * __restrict, size_t); size_t strnlen(const char *, size_t); +char *strrchr(const char *, int); char *strsep(char **, const char *delim); size_t strspn(const char *, const char *); char *strstr(const char *, const char *); @@ -164,15 +164,17 @@ memset(void *b, int c, size_t len) #endif static __inline char * -strchr(const char *p, int ch) +index(const char *p, int ch) { - return (index(p, ch)); + + return (strchr(p, ch)); } static __inline char * -strrchr(const char *p, int ch) +rindex(const char *p, int ch) { - return (rindex(p, ch)); + + return (strrchr(p, ch)); } /* fnmatch() return values. */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 07:06:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6CA91065670; Tue, 3 Jan 2012 07:06:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B59E88FC08; Tue, 3 Jan 2012 07:06: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 q0376Zco009873; Tue, 3 Jan 2012 07:06:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0376Zad009871; Tue, 3 Jan 2012 07:06:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201030706.q0376Zad009871@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 07:06: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: r229367 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 07:06:35 -0000 Author: ed Date: Tue Jan 3 07:06:35 2012 New Revision: 229367 URL: http://svn.freebsd.org/changeset/base/229367 Log: Add support for strong aliasing of symbols in i386 assembly. This macro is a literal copy from the MIPS version of . Modified: head/sys/i386/include/asm.h Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Tue Jan 3 07:05:30 2012 (r229366) +++ head/sys/i386/include/asm.h Tue Jan 3 07:06:35 2012 (r229367) @@ -89,6 +89,13 @@ #define ENTRY(x) _ENTRY(x) #endif +/* + * STRONG_ALIAS: create a strong alias. + */ +#define STRONG_ALIAS(alias,sym) \ + .globl alias; \ + alias = sym + #define RCSID(x) .text; .asciz x #undef __FBSDID From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 07:14:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B47BB106566B; Tue, 3 Jan 2012 07:14:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FEE38FC0C; Tue, 3 Jan 2012 07:14: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 q037E2js010139; Tue, 3 Jan 2012 07:14:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q037E2qq010125; Tue, 3 Jan 2012 07:14:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201030714.q037E2qq010125@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 07:14: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: r229368 - in head: lib/libc lib/libc/arm/string lib/libc/i386/string lib/libc/mips/string lib/libc/string lib/libstand sys/boot/userboot/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 07:14:02 -0000 Author: ed Date: Tue Jan 3 07:14:01 2012 New Revision: 229368 URL: http://svn.freebsd.org/changeset/base/229368 Log: Merge index() and strchr() together. As I looked through the C library, I noticed the FreeBSD MIPS port has a hand-written version of index(). This is nice, if it weren't for the fact that most applications call strchr() instead. Also, on the other architectures index() and strchr() are identical, meaning we have two identical pieces of code in the C library and statically linked applications. Solve this by naming the actual file strchr.[cS] and let it use __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do the same for rindex()/strrchr(). This seems to make the C libraries and static binaries slightly smaller, but this reduction in size seems negligible. Added: head/lib/libc/mips/string/strchr.S - copied, changed from r229111, head/lib/libc/mips/string/index.S head/lib/libc/mips/string/strrchr.S - copied, changed from r229111, head/lib/libc/mips/string/rindex.S Replaced: head/lib/libc/string/strchr.c - copied, changed from r229111, head/lib/libc/string/index.c head/lib/libc/string/strrchr.c - copied, changed from r229111, head/lib/libc/string/rindex.c Deleted: head/lib/libc/i386/string/index.S head/lib/libc/i386/string/rindex.S head/lib/libc/mips/string/index.S head/lib/libc/mips/string/rindex.S head/lib/libc/string/index.c head/lib/libc/string/rindex.c Modified: head/lib/libc/Makefile head/lib/libc/arm/string/Makefile.inc head/lib/libc/i386/string/Makefile.inc head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strrchr.S head/lib/libc/mips/string/Makefile.inc head/lib/libc/string/Makefile.inc head/lib/libstand/Makefile head/sys/boot/userboot/libstand/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/Makefile Tue Jan 3 07:14:01 2012 (r229368) @@ -127,8 +127,8 @@ SRCS+= ${_src} KQSRCS= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c -KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \ - strcat.c strcmp.c strcpy.c strlen.c strncpy.c +KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c mcount.c strcat.c strchr.c \ + strcmp.c strcpy.c strlen.c strncpy.c strrchr.c libkern: libkern.gen libkern.${LIBC_ARCH} Modified: head/lib/libc/arm/string/Makefile.inc ============================================================================== --- head/lib/libc/arm/string/Makefile.inc Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/arm/string/Makefile.inc Tue Jan 3 07:14:01 2012 (r229368) @@ -1,7 +1,6 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -MDSRCS+=bcmp.c bcopy.S bzero.S ffs.S index.c memchr.c memcmp.S memcpy.S \ - memmove.S memset.S rindex.c strcat.c strchr.c strcmp.S strcpy.c \ - strlen.S strncmp.S strrchr.c swab.c wcschr.c wcscmp.c wcslen.c \ - wmemchr.c +MDSRCS+=bcmp.c bcopy.S bzero.S ffs.S memchr.c memcmp.S memcpy.S \ + memmove.S memset.S strcat.c strchr.c strcmp.S strcpy.c strlen.S \ + strncmp.S strrchr.c swab.c wcschr.c wcscmp.c wcslen.c wmemchr.c Modified: head/lib/libc/i386/string/Makefile.inc ============================================================================== --- head/lib/libc/i386/string/Makefile.inc Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/i386/string/Makefile.inc Tue Jan 3 07:14:01 2012 (r229368) @@ -1,7 +1,6 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memcpy.S \ - memmove.S memset.S rindex.S strcat.S strchr.S strcmp.S strcpy.S \ - strncmp.S strrchr.S swab.S wcschr.S wcscmp.S wcslen.S \ - wmemchr.S +MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S memchr.S memcmp.S memcpy.S memmove.S \ + memset.S strcat.S strchr.S strcmp.S strcpy.S strncmp.S strrchr.S \ + swab.S wcschr.S wcscmp.S wcslen.S wmemchr.S Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/i386/string/strchr.S Tue Jan 3 07:14:01 2012 (r229368) @@ -63,4 +63,6 @@ L2: ret END(strchr) +STRONG_ALIAS(index, strchr) + .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/i386/string/strrchr.S Tue Jan 3 07:14:01 2012 (r229368) @@ -64,4 +64,6 @@ L2: ret END(strrchr) +STRONG_ALIAS(rindex, strrchr) + .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/mips/string/Makefile.inc ============================================================================== --- head/lib/libc/mips/string/Makefile.inc Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/mips/string/Makefile.inc Tue Jan 3 07:14:01 2012 (r229368) @@ -1,8 +1,8 @@ # $NetBSD: Makefile.inc,v 1.2 2000/10/10 21:51:54 jeffs Exp $ # $FreeBSD$ -SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.c memset.c \ +SRCS+= bcmp.S bcopy.S bzero.S ffs.S memchr.c memcmp.c memset.c \ memcpy.S memmove.S \ - rindex.S strcat.c strcmp.S strcpy.c strcspn.c strlen.S \ - strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ + strcat.c strchr.S strcmp.S strcpy.c strcspn.c strlen.S \ + strncat.c strncmp.c strncpy.c strrchr.S strpbrk.c strsep.c \ strspn.c strstr.c swab.c Copied and modified: head/lib/libc/mips/string/strchr.S (from r229111, head/lib/libc/mips/string/index.S) ============================================================================== --- head/lib/libc/mips/string/index.S Sat Dec 31 14:57:52 2011 (r229111, copy source) +++ head/lib/libc/mips/string/strchr.S Tue Jan 3 07:14:01 2012 (r229368) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); .abicalls #endif -LEAF(index) +LEAF(strchr) 1: lbu a2, 0(a0) # get a byte PTR_ADDU a0, a0, 1 @@ -56,4 +56,6 @@ notfnd: fnd: PTR_SUBU v0, a0, 1 j ra -END(index) +END(strchr) + +STRONG_ALIAS(index, strchr) Copied and modified: head/lib/libc/mips/string/strrchr.S (from r229111, head/lib/libc/mips/string/rindex.S) ============================================================================== --- head/lib/libc/mips/string/rindex.S Sat Dec 31 14:57:52 2011 (r229111, copy source) +++ head/lib/libc/mips/string/strrchr.S Tue Jan 3 07:14:01 2012 (r229368) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); .abicalls #endif -LEAF(rindex) +LEAF(strrchr) move v0, zero # default if not found 1: lbu a3, 0(a0) # get a byte @@ -54,4 +54,6 @@ LEAF(rindex) 2: bne a3, zero, 1b # continue if not end j ra -END(rindex) +END(strrchr) + +STRONG_ALIAS(rindex, strrchr) Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libc/string/Makefile.inc Tue Jan 3 07:14:01 2012 (r229368) @@ -7,8 +7,8 @@ CFLAGS+= -I${.CURDIR}/locale # machine-independent string sources MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \ - index.c memccpy.c memchr.c memrchr.c memcmp.c \ - memcpy.c memmem.c memmove.c memset.c rindex.c \ + memccpy.c memchr.c memrchr.c memcmp.c \ + memcpy.c memmem.c memmove.c memset.c \ stpcpy.c stpncpy.c strcasecmp.c \ strcat.c strcasestr.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c \ strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c \ Copied and modified: head/lib/libc/string/strchr.c (from r229111, head/lib/libc/string/index.c) ============================================================================== --- head/lib/libc/string/index.c Sat Dec 31 14:57:52 2011 (r229111, copy source) +++ head/lib/libc/string/strchr.c Tue Jan 3 07:14:01 2012 (r229368) @@ -34,19 +34,10 @@ static char sccsid[] = "@(#)index.c 8.1 __FBSDID("$FreeBSD$"); #include - -#ifdef STRCHR #include char * -strchr -#else -#include - -char * -index -#endif -(const char *p, int ch) +strchr(const char *p, int ch) { char c; @@ -59,3 +50,5 @@ index } /* NOTREACHED */ } + +__strong_reference(strchr, index); Copied and modified: head/lib/libc/string/strrchr.c (from r229111, head/lib/libc/string/rindex.c) ============================================================================== --- head/lib/libc/string/rindex.c Sat Dec 31 14:57:52 2011 (r229111, copy source) +++ head/lib/libc/string/strrchr.c Tue Jan 3 07:14:01 2012 (r229368) @@ -34,19 +34,10 @@ static char sccsid[] = "@(#)rindex.c 8.1 __FBSDID("$FreeBSD$"); #include - -#ifdef STRRCHR #include char * -strrchr -#else -#include - -char * -rindex -#endif -(const char *p, int ch) +strrchr(const char *p, int ch) { char *save; char c; @@ -60,3 +51,5 @@ rindex } /* NOTREACHED */ } + +__strong_reference(strrchr, rindex); Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Tue Jan 3 07:06:35 2012 (r229367) +++ head/lib/libstand/Makefile Tue Jan 3 07:14:01 2012 (r229368) @@ -54,10 +54,10 @@ SRCS+= ntoh.c .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ - memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ - strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ - strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ + memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ + strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif .if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen @@ -65,10 +65,9 @@ SRCS+= divsi3.S .endif .if ${MACHINE_CPUARCH} == "ia64" .PATH: ${.CURDIR}/../libc/ia64/string -SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \ - memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \ - strcmp.c strcpy.c strcspn.c strlen.c \ - strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ +SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ + memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ + strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ strspn.c strstr.c strtok.c swab.c .PATH: ${.CURDIR}/../libc/ia64/gen Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Tue Jan 3 07:06:35 2012 (r229367) +++ head/sys/boot/userboot/libstand/Makefile Tue Jan 3 07:14:01 2012 (r229368) @@ -60,10 +60,10 @@ SRCS+= ntoh.c .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ - memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ - strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ - strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ + memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ + strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC}/arm/gen From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 09:42:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D8381065672; Tue, 3 Jan 2012 09:42:32 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3C78FC13; Tue, 3 Jan 2012 09:42: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 q039gWcK015260; Tue, 3 Jan 2012 09:42:32 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q039gWv9015258; Tue, 3 Jan 2012 09:42:32 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201201030942.q039gWv9015258@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 3 Jan 2012 09:42: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: r229375 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 09:42:32 -0000 Author: bschmidt Date: Tue Jan 3 09:42:31 2012 New Revision: 229375 URL: http://svn.freebsd.org/changeset/base/229375 Log: Don't rely on MCS7 being at index 7 while determining the amount of antennas to use. Not all APs enable all MCS rates. Poked by: Lucius Windschuh MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Jan 3 09:42:08 2012 (r229374) +++ head/sys/dev/iwn/if_iwn.c Tue Jan 3 09:42:31 2012 (r229375) @@ -2128,7 +2128,7 @@ iwn_newassoc(struct ieee80211_node *ni, plcp |= IWN_RFLAG_SGI; } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) plcp |= IWN_RFLAG_SGI; - if (i > 7) + if (RV(ni->ni_htrates.rs_rates[i]) > 7) plcp |= IWN_RFLAG_ANT(txant1 | txant2); else plcp |= IWN_RFLAG_ANT(txant1); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 10:01:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1D78106566C; Tue, 3 Jan 2012 10:01:12 +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 E0A248FC17; Tue, 3 Jan 2012 10:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03A1Co7016126; Tue, 3 Jan 2012 10:01:12 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03A1C0K016124; Tue, 3 Jan 2012 10:01:12 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201031001.q03A1C0K016124@svn.freebsd.org> From: Kevin Lo Date: Tue, 3 Jan 2012 10:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229379 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 10:01:13 -0000 Author: kevlo Date: Tue Jan 3 10:01:12 2012 New Revision: 229379 URL: http://svn.freebsd.org/changeset/base/229379 Log: Add support for Intel EG20T serial ports Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Tue Jan 3 09:51:34 2012 (r229378) +++ head/sys/dev/uart/uart_bus_pci.c Tue Jan 3 10:01:12 2012 (r229379) @@ -112,6 +112,10 @@ static struct pci_id pci_ns8250_ids[] = 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, +{ 0x8086, 0x8811, 0xffff, 0, "Intel EG20T Serial Port 0", 0x10 }, +{ 0x8086, 0x8812, 0xffff, 0, "Intel EG20T Serial Port 1", 0x10 }, +{ 0x8086, 0x8813, 0xffff, 0, "Intel EG20T Serial Port 2", 0x10 }, +{ 0x8086, 0x8814, 0xffff, 0, "Intel EG20T Serial Port 3", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 11:08:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68B98106568E; Tue, 3 Jan 2012 11:08:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57AAC8FC12; Tue, 3 Jan 2012 11:08: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 q03B8xJt020839; Tue, 3 Jan 2012 11:08:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03B8xh8020837; Tue, 3 Jan 2012 11:08:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201031108.q03B8xh8020837@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 11:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229384 - head/usr.sbin/quotaon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 11:08:59 -0000 Author: ed Date: Tue Jan 3 11:08:58 2012 New Revision: 229384 URL: http://svn.freebsd.org/changeset/base/229384 Log: Simply use getprogname() to obtain the name of the process. Modified: head/usr.sbin/quotaon/quotaon.c Modified: head/usr.sbin/quotaon/quotaon.c ============================================================================== --- head/usr.sbin/quotaon/quotaon.c Tue Jan 3 10:36:38 2012 (r229383) +++ head/usr.sbin/quotaon/quotaon.c Tue Jan 3 11:08:58 2012 (r229384) @@ -75,13 +75,11 @@ int main(int argc, char **argv) { struct fstab *fs; - char *whoami; + const char *whoami; long argnum, done = 0; int ch, i, offmode = 0, errs = 0; - whoami = rindex(*argv, '/') + 1; - if (whoami == (char *)1) - whoami = *argv; + whoami = getprogname(); if (strcmp(whoami, "quotaoff") == 0) offmode++; else if (strcmp(whoami, "quotaon") != 0) From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 11:10:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1631065670; Tue, 3 Jan 2012 11:10:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB89F8FC0A; Tue, 3 Jan 2012 11:10: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 q03BAFRA020920; Tue, 3 Jan 2012 11:10:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03BAF62020918; Tue, 3 Jan 2012 11:10:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201031110.q03BAF62020918@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 11:10: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: r229385 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 11:10:15 -0000 Author: ed Date: Tue Jan 3 11:10:15 2012 New Revision: 229385 URL: http://svn.freebsd.org/changeset/base/229385 Log: Fix subtle typo: compare against idx -- not index. In this contest, index refers to the index(3) function. In this case it doesn't really harm, as this function is never called with idx == NULL. MFC after: 2 weeks Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Tue Jan 3 11:08:58 2012 (r229384) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Tue Jan 3 11:10:15 2012 (r229385) @@ -469,7 +469,7 @@ snmp_leaf_insert(struct snmp_toolinfo *s static int32_t snmp_index_insert(struct snmp_idxlist *headp, struct index *idx) { - if (headp == NULL || index == NULL) + if (headp == NULL || idx == NULL) return (-1); STAILQ_INSERT_TAIL(headp, idx, link); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 11:13:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5333B106564A; Tue, 3 Jan 2012 11:13:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4203D8FC17; Tue, 3 Jan 2012 11:13: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 q03BD8xd021048; Tue, 3 Jan 2012 11:13:08 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03BD8Vw021046; Tue, 3 Jan 2012 11:13:08 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201031113.q03BD8Vw021046@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 11:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229386 - head/usr.bin/talk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 11:13:08 -0000 Author: ed Date: Tue Jan 3 11:13:07 2012 New Revision: 229386 URL: http://svn.freebsd.org/changeset/base/229386 Log: Remove hand-written version of strcspn(). The code searches for the first occurence of @, : or !. Upon failure, it returns the index of \0. This is exactly what strcspn() does. Modified: head/usr.bin/talk/get_names.c Modified: head/usr.bin/talk/get_names.c ============================================================================== --- head/usr.bin/talk/get_names.c Tue Jan 3 11:10:15 2012 (r229385) +++ head/usr.bin/talk/get_names.c Tue Jan 3 11:13:07 2012 (r229386) @@ -80,8 +80,7 @@ get_names(int argc, char *argv[]) gethostname(hostname, sizeof (hostname)); my_machine_name = hostname; /* check for, and strip out, the machine name of the target */ - for (cp = argv[1]; *cp && !index("@:!", *cp); cp++) - ; + cp = argv[1] + strcspn(argv[1], "@:!"); if (*cp == '\0') { /* this is a local to local talk */ his_name = argv[1]; From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 15:49:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8141A1065676; Tue, 3 Jan 2012 15:49:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1C26D8FC14; Tue, 3 Jan 2012 15:49:35 +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 mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q03FnWVf026382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Jan 2012 02:49:33 +1100 Date: Wed, 4 Jan 2012 02:49:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <201201030714.q037E2qq010125@svn.freebsd.org> Message-ID: <20120104013401.S6960@besplex.bde.org> References: <201201030714.q037E2qq010125@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229368 - in head: lib/libc lib/libc/arm/string lib/libc/i386/string lib/libc/mips/string lib/libc/string lib/libstand sys/boot/userboot/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 15:49:36 -0000 On Tue, 3 Jan 2012, Ed Schouten wrote: > Log: > Merge index() and strchr() together. > > As I looked through the C library, I noticed the FreeBSD MIPS port has a > hand-written version of index(). This is nice, if it weren't for the > fact that most applications call strchr() instead. > > Also, on the other architectures index() and strchr() are identical, > meaning we have two identical pieces of code in the C library and > statically linked applications. Only in statically linked applications that used both, since they weren't actually identical -- they were intentionally put in separate object files to avoid this problem. (In asm, you don't need symbol magic to declare strong aliases, but just use 2 .globl labels together. But this is usually wrong since it doesn't keep things separate enough. Some files use #include to implement the multiple copies. For example, amd64 and i386 don't bother optimizing memcpy() over memmove(), but make it a copy in a separate file. The i386 index.S and strchr.S were not so good -- they duplicated the code.) > Solve this by naming the actual file strchr.[cS] and let it use > __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do > the same for rindex()/strrchr(). This breaks the Standard C namespace. When they are in the same object file, there is no way to get the standard name without getting the nonstandard name. So the following C-standard-conforming C program now gets a linkage error (multiple definition of `index'), at least with static linkage: #include int index; void foo(const char *p) { return strchr(p, '1'); } When they were in separate object files, the nonstandard name just added to the general pollution in the libc runtime in a way that doesn't seem to cause any problems in practice, since it is orthogonal to any uses of the name in a conforming application. We mostly use weak references in libraries, to avoid problems like this. In libc, there were just 2 __strong_reference()s and 111 __weak_reference()s. One of the oldest weak references is from __vfscanf to vfscanf. This is used to implement a bug in C90: C90 doesn't have vfscanf, so it must not be in libc in a way that conflicts with any application symbol named vfscanf. libc needs vfscanf's functionality internally, and doesn't want to duplicate the whole thing. So it puts the functionality in __vfscanf and always uses that internally, and provides the duplication solely as a weak symbol. The symbol remains weak, and C90 remains sort of supported, although the bug is fixed in C99 (it has vfscanf). There are also _many_ (but not nearly all?) POSIX symbols that are handled as weak references. Internally, they have names like _open and weak symbols like `open' (for some reason, both _open and `open' are shown by nm as weak). These are implemented more magically using include/*namespace.h and macros in asm files. I got the count of 111 by grepping for the C macro. This missed all the asm macros. Grepping for ' W ' in libc.a shows 1024 weak references. That's almost 30% of all symbols (there are 2195 ' T ' symbols). nm doesn't seem to provide a way to show what the symbols are aliases for. It is worse for strong symbols (shows them both as ' T '). > > This seems to make the C libraries and static binaries slightly smaller, > but this reduction in size seems negligible. Duplication of the object file (except for the global symbols) is best, and may be required, even for the example of memcpy being identical to memmove given above. It is useful to be able to put a breakpoint at memcpy without having it trigger when memmove is called, and the C standard might require memcpy and memmove to have different addresses. Similarly for profiling. You want logically different functions to have different addresses. I wonder if gprof knows enough about symbols to prefer strchr over index if they are strong aliases for each other. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 15:53:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C228106566C; Tue, 3 Jan 2012 15:53:32 +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 371E28FC0C; Tue, 3 Jan 2012 15:53:31 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 02C45700; Tue, 3 Jan 2012 16:53:28 +0100 (CET) Date: Tue, 3 Jan 2012 16:52:21 +0100 From: Pawel Jakub Dawidek To: Ed Schouten Message-ID: <20120103155221.GB1663@garage.freebsd.pl> References: <201201012026.q01KQBS5029156@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <201201012026.q01KQBS5029156@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229198 - in head: share/man/man9 sys/conf sys/libkern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 15:53:32 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 01, 2012 at 08:26:11PM +0000, Ed Schouten wrote: > Author: ed > Date: Sun Jan 1 20:26:11 2012 > New Revision: 229198 > URL: http://svn.freebsd.org/changeset/base/229198 >=20 > Log: > Introducing memcchr(3). > =20 > It seems two of the file system drivers we have in the tree, namely ufs > and ext3, use a function called `skpc()'. The meaning of this function > does not seem to be documented in FreeBSD, but it turns out one needs to > be a VAX programmer to understand what it does. > =20 > SPKC is an instruction on the VAX that does the opposite of memchr(). It > searches for the non-equal character. Add a new function called > memcchr() to the tree that has the following advantages over skpc(): > =20 > - It has a name that makes more sense than skpc(). Just like strcspn() > matches the complement of strspn(), memcchr() is the complement of > memchr(). > =20 > - It is faster than skpc(). Similar to our strlen() in libc, it compares > entire words, instead of single bytes. It seems that for this routine > this yields a sixfold performance increase on amd64. > =20 > - It has a man page. >=20 > Added: > head/share/man/man9/memcchr.3 (contents, props changed) Shouldn't this be memcchr.9? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8DJDUACgkQForvXbEpPzSUlgCfRU8b0la4rX2k3GmkU+uBsj5q 14UAoLti0y6TJbXigPmK7JWM6Xu4V28Z =Czu1 -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 16:22:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7C4C106564A; Tue, 3 Jan 2012 16:22:29 +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 C66848FC13; Tue, 3 Jan 2012 16:22: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 q03GMTpi031426; Tue, 3 Jan 2012 16:22:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03GMTIs031422; Tue, 3 Jan 2012 16:22:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201031622.q03GMTIs031422@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jan 2012 16:22: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: r229390 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 16:22:29 -0000 Author: jhb Date: Tue Jan 3 16:22:29 2012 New Revision: 229390 URL: http://svn.freebsd.org/changeset/base/229390 Log: Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that do not modify the queues they iterate over. Submitted by: glebius Modified: head/sys/netinet/igmp.c head/sys/netinet6/in6.c head/sys/netinet6/mld6.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Jan 3 13:16:47 2012 (r229389) +++ head/sys/netinet/igmp.c Tue Jan 3 16:22:29 2012 (r229390) @@ -1642,7 +1642,7 @@ igmp_fasttimo_vnet(void) struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; struct igmp_ifinfo *igi; - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct in_multi *inm; int loop, uri_fasthz; @@ -1709,8 +1709,7 @@ igmp_fasttimo_vnet(void) } IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, - tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; @@ -3321,7 +3320,7 @@ igmp_v3_merge_state_changes(struct in_mu static void igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi) { - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in_multi *inm; int retval, loop; @@ -3335,7 +3334,7 @@ igmp_v3_dispatch_general_query(struct ig ifp = igi->igi_ifp; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jan 3 13:16:47 2012 (r229389) +++ head/sys/netinet6/in6.c Tue Jan 3 16:22:29 2012 (r229390) @@ -1325,7 +1325,7 @@ in6_purgeaddr(struct ifaddr *ifa) struct sockaddr_in6 mltaddr, mltmask; int plen, error; struct rtentry *rt; - struct ifaddr *ifa0, *nifa; + struct ifaddr *ifa0; if (ifa->ifa_carp) (*carp_detach_p)(ifa); @@ -1336,7 +1336,7 @@ in6_purgeaddr(struct ifaddr *ifa) * address routes */ IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifa0, &ifp->if_addrhead, ifa_link, nifa) { + TAILQ_FOREACH(ifa0, &ifp->if_addrhead, ifa_link) { if ((ifa0->ifa_addr->sa_family != AF_INET6) || memcmp(&satosin6(ifa0->ifa_addr)->sin6_addr, &ia->ia_addr.sin6_addr, Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue Jan 3 13:16:47 2012 (r229389) +++ head/sys/netinet6/mld6.c Tue Jan 3 16:22:29 2012 (r229390) @@ -2976,7 +2976,7 @@ mld_v2_merge_state_changes(struct in6_mu static void mld_v2_dispatch_general_query(struct mld_ifinfo *mli) { - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in6_multi *inm; int retval; @@ -2990,7 +2990,7 @@ mld_v2_dispatch_general_query(struct mld ifp = mli->mli_ifp; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6 || ifma->ifma_protospec == NULL) continue; From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 17:04:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48A161065673; Tue, 3 Jan 2012 17:04:10 +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 37B7B8FC0A; Tue, 3 Jan 2012 17:04:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03H4A6G033111; Tue, 3 Jan 2012 17:04:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03H4ALs033109; Tue, 3 Jan 2012 17:04:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201031704.q03H4ALs033109@svn.freebsd.org> From: Alexander Motin Date: Tue, 3 Jan 2012 17:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229395 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 17:04:10 -0000 Author: mav Date: Tue Jan 3 17:04:09 2012 New Revision: 229395 URL: http://svn.freebsd.org/changeset/base/229395 Log: Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control sector size same as acd driver does. Together with r228808 and r228847 this allows existing multimedia/vlc to play Audio CDs via CAM cd driver. PR: ports/162190 MFC after: 1 week Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Jan 3 16:54:47 2012 (r229394) +++ head/sys/cam/scsi/scsi_cd.c Tue Jan 3 17:04:09 2012 (r229395) @@ -2685,6 +2685,16 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdsetspeed(periph, CDR_MAX_SPEED, *(u_int32_t *)addr); cam_periph_unlock(periph); break; + case CDRIOCGETBLOCKSIZE: + *(int *)addr = softc->params.blksize; + break; + case CDRIOCSETBLOCKSIZE: + if (*(int *)addr <= 0) { + error = EINVAL; + break; + } + softc->disk->d_sectorsize = softc->params.blksize = *(int *)addr; + break; case DVDIOCSENDKEY: case DVDIOCREPORTKEY: { struct dvd_authinfo *authinfo; From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 17:31:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5DDA1065675; Tue, 3 Jan 2012 17:31:27 +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 A55B08FC17; Tue, 3 Jan 2012 17:31: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 q03HVRDL034180; Tue, 3 Jan 2012 17:31:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03HVRkK034178; Tue, 3 Jan 2012 17:31:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201031731.q03HVRkK034178@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jan 2012 17:31: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: r229400 - head/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 17:31:27 -0000 Author: jhb Date: Tue Jan 3 17:31:27 2012 New Revision: 229400 URL: http://svn.freebsd.org/changeset/base/229400 Log: Improve the cscope target's handling of MD directories. Automatically include the MACHINE_CPUARCH directory if it differents from MACHINE when building an index for a single machine. Also, include the 'x86' directory when building an index for i386, pc98, or amd64. MFC after: 1 week Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Tue Jan 3 17:19:57 2012 (r229399) +++ head/sys/Makefile Tue Jan 3 17:31:27 2012 (r229400) @@ -13,10 +13,18 @@ CSCOPEDIRS= boot bsm cam cddl compat con netgraph netinet netinet6 netipsec netipx netnatm netncp \ netsmb nfs nfsclient nfsserver nlm opencrypto \ pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} +.if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) -CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86 +CSCOPE_ARCHDIR = amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86 .else -CSCOPE_ARCHDIR ?= ${MACHINE} +CSCOPE_ARCHDIR = ${MACHINE} +.if ${MACHINE} != ${MACHINE_CPUARCH} +CSCOPE_ARCHDIR += ${MACHINE_CPUARCH} +.endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CSCOPE_ARCHDIR += x86 +.endif +.endif .endif # Loadable kernel modules From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 18:20:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7502C106566B; Tue, 3 Jan 2012 18:20:21 +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 0F7DD8FC12; Tue, 3 Jan 2012 18:20:21 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 329672A28DF2; Tue, 3 Jan 2012 19:20:20 +0100 (CET) Date: Tue, 3 Jan 2012 19:20:20 +0100 From: Ed Schouten To: Bruce Evans Message-ID: <20120103182020.GH1895@hoeg.nl> References: <201201030714.q037E2qq010125@svn.freebsd.org> <20120104013401.S6960@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXqTiZo38oDXuAlq" Content-Disposition: inline In-Reply-To: <20120104013401.S6960@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: r229368 - in head: lib/libc lib/libc/arm/string lib/libc/i386/string lib/libc/mips/string lib/libc/string lib/libstand sys/boot/userboot/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 18:20:21 -0000 --OXqTiZo38oDXuAlq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Bruce, * Bruce Evans , 20120103 16:49: > This breaks the Standard C namespace. When they are in the same object > file, there is no way to get the standard name without getting the > nonstandard name. So the following C-standard-conforming C program > now gets a linkage error (multiple definition of `index'), at least with > static linkage: >=20 > #include > int index; > void foo(const char *p) { return strchr(p, '1'); } Though I sympathize, this problem is not just limited to strchr(). There are other portions of the C library that use index() as well. For example, if you use , ttyslot(), one of the exec*() functions or the NIS functions, you already get index() linked into your binary. > [...] and the C > standard might require memcpy and memmove to have different addresses. I just skimmed through the standard, and if I haven't overlooked anything, no such requirement is made. Also, I can imagine a compiler with good support for link-time optimisation can already merge equal pieces of code together, making it even harder to reason about inequality of function addresses. Still, I am willing to address the issues you raised. index() and rindex() aren't that important nowadays and I have a patchset ready in my home directory that converts almost all apps in the base system to use strchr() anyway. As I don't feel like polluting the MI strchr() implementations with index()/rindex() support, would it be okay if I implement index() and rindex() as simple C functions that call into strchr() and strrchr()? --=20 Ed Schouten WWW: http://80386.nl/ --OXqTiZo38oDXuAlq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPA0bjAAoJEG5e2P40kaK7Dp8P/jK/y1yO5Yw4ztVPkhTx2S/K 5+reKjaGBEa6/wvSB3ytoEME6pMIrc4sgs/aKSYVufRaV6MDcVQ2e4llH1oWR9Zg JPNW2S6WYeC0JV0Y3gpXzoIuPaH2W8wYBEVWyhRj0W1+CbUL34NtfJWATsNQxkST Y+vFGCI7Ry3KtllVgJ/IC0N3c9m2EsOh+O0/yLwAS4f/GXjKpQEJsgOuR1EBWUQU tHiRTIzZp6S1upiPTWG5hY0UlvNJfe1jPJ09g8uGrS22a61gLiweTp8nO/VszrLS lIv/4YGt2ycX4UWeEGmfuKng+7qp1NhO2VyWupgLJtCreVbn6I5Y/zhELdfhJPuU hK2MGP2BlkNAK/yylY2IZZa8T7Hnt7SYolb0CT72D1xvJb1FR900Hwq0EKp4YySF 4PdpV5jdK8qINUzVA+zooNwvnvmvdsI0rL1wV5tX0ikkzjTTqjEYLA5aqMn9y4U5 UT3+Dmd12j6c8Uu/NMrnyrbdlqqcRx1ftfONO9meNeYeckuGIZ6klrTHJxgkcb6c oE2Cr++xV1KQLjmbp+biB5xT6mX0J/Sn8TyfYwn34G3E1RVm7ZDh17bJSrjqVXYn TwFBy7199cl9IeSlROCDe6vjKozVUvhCP+zzN4HHFwHscNswUki+xpda7rXX9i5D Qec9D+T7+9EYxezDWCAM =qvDX -----END PGP SIGNATURE----- --OXqTiZo38oDXuAlq-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 18:40:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F54D106566C; Tue, 3 Jan 2012 18:40:42 +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 F2A448FC08; Tue, 3 Jan 2012 18:40: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 q03IefBd036491; Tue, 3 Jan 2012 18:40:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03Iefc5036489; Tue, 3 Jan 2012 18:40:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201031840.q03Iefc5036489@svn.freebsd.org> From: Dimitry Andric Date: Tue, 3 Jan 2012 18:40: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: r229401 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 18:40:42 -0000 Author: dim Date: Tue Jan 3 18:40:41 2012 New Revision: 229401 URL: http://svn.freebsd.org/changeset/base/229401 Log: In sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was passed to resource_list_add(). The rid that was just returned by bus_alloc_resource_any() should have been used instead. Reviewed by: jhb MFC after: 1 week Modified: head/sys/dev/if_ndis/if_ndis_pccard.c Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Tue Jan 3 17:31:27 2012 (r229400) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Tue Jan 3 18:40:41 2012 (r229401) @@ -207,7 +207,7 @@ ndis_attach_pccard(dev) goto fail; } sc->ndis_rescnt++; - resource_list_add(&sc->ndis_rl, SYS_RES_IOPORT, rid, + resource_list_add(&sc->ndis_rl, SYS_RES_IOPORT, sc->ndis_io_rid, rman_get_start(sc->ndis_res_io), rman_get_end(sc->ndis_res_io), rman_get_size(sc->ndis_res_io)); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 18:49:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF90106566B; Tue, 3 Jan 2012 18:49:39 +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 AC6218FC0C; Tue, 3 Jan 2012 18:49: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 q03IndEK036919; Tue, 3 Jan 2012 18:49:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03IndxI036917; Tue, 3 Jan 2012 18:49:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201031849.q03IndxI036917@svn.freebsd.org> From: Dimitry Andric Date: Tue, 3 Jan 2012 18:49: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: r229402 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 18:49:39 -0000 Author: dim Date: Tue Jan 3 18:49:39 2012 New Revision: 229402 URL: http://svn.freebsd.org/changeset/base/229402 Log: In sys/compat/linux/linux_ioctl.c, work around a warning when a pointer is compared to an integer, by casting the pointer to l_uintptr_t. No functional difference on both i386 and amd64. Reviewed by: ed, jhb MFC after: 1 week Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Tue Jan 3 18:40:41 2012 (r229401) +++ head/sys/compat/linux/linux_ioctl.c Tue Jan 3 18:49:39 2012 (r229402) @@ -2182,7 +2182,7 @@ linux_ifconf(struct thread *td, struct i CURVNET_SET(TD_TO_VNET(td)); /* handle the 'request buffer size' case */ - if (ifc.ifc_buf == PTROUT(NULL)) { + if ((l_uintptr_t)ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 18:52:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372FD1065672; Tue, 3 Jan 2012 18:52:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 221AF8FC0C; Tue, 3 Jan 2012 18:52: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 q03Iq0it037083; Tue, 3 Jan 2012 18:52:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03IpxJW037031; Tue, 3 Jan 2012 18:51:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201031851.q03IpxJW037031@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 18:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229403 - in head: games/fortune/fortune lib/libc/gen lib/libc/net lib/libcam lib/libstand lib/libutil libexec/mknetid libexec/rlogind sbin/bsdlabel sbin/dump sbin/fsck_ffs sbin/ipfw sb... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 18:52:00 -0000 Author: ed Date: Tue Jan 3 18:51:58 2012 New Revision: 229403 URL: http://svn.freebsd.org/changeset/base/229403 Log: Replace index() and rindex() calls with strchr() and strrchr(). The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls. Modified: head/games/fortune/fortune/fortune.c head/lib/libc/gen/exec.c head/lib/libc/gen/getttyent.c head/lib/libc/gen/timezone.c head/lib/libc/net/gethostbynis.c head/lib/libc/net/getnetbynis.c head/lib/libcam/camlib.c head/lib/libstand/bootp.c head/lib/libutil/quotafile.c head/libexec/mknetid/parse_group.c head/libexec/rlogind/rlogind.c head/sbin/bsdlabel/bsdlabel.c head/sbin/dump/main.c head/sbin/fsck_ffs/pass2.c head/sbin/ipfw/main.c head/sbin/shutdown/shutdown.c head/sys/boot/common/interp_parse.c head/sys/boot/ofw/common/main.c head/sys/boot/ofw/libofw/ofw_net.c head/usr.bin/cksum/cksum.c head/usr.bin/compress/compress.c head/usr.bin/finger/finger.c head/usr.bin/hexdump/display.c head/usr.bin/hexdump/hexdump.c head/usr.bin/hexdump/hexsyntax.c head/usr.bin/hexdump/parse.c head/usr.bin/locate/locate/fastfind.c head/usr.bin/locate/locate/util.c head/usr.bin/netstat/if.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/sctp.c head/usr.bin/rlogin/rlogin.c head/usr.bin/rpcgen/rpc_main.c head/usr.bin/systat/devs.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.bin/tftp/main.c head/usr.bin/tr/str.c head/usr.bin/tset/map.c head/usr.bin/tset/term.c head/usr.bin/tset/wrterm.c head/usr.sbin/bootparamd/bootparamd/bootparamd.c head/usr.sbin/config/main.c head/usr.sbin/config/mkmakefile.c head/usr.sbin/inetd/inetd.c head/usr.sbin/ipfwpcap/ipfwpcap.c head/usr.sbin/mtree/spec.c head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/rwhod/rwhod.c head/usr.sbin/sade/variable.c Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/games/fortune/fortune/fortune.c Tue Jan 3 18:51:58 2012 (r229403) @@ -683,7 +683,7 @@ all_forts(FILEDESC *fp, char *offensive) obscene->fd = fd; obscene->inf = NULL; obscene->path = offensive; - if ((sp = rindex(offensive, '/')) == NULL) + if ((sp = strrchr(offensive, '/')) == NULL) obscene->name = offensive; else obscene->name = ++sp; @@ -785,7 +785,7 @@ is_fortfile(const char *file, char **dat } } - if ((sp = rindex(file, '/')) == NULL) + if ((sp = strrchr(file, '/')) == NULL) sp = file; else sp++; @@ -797,7 +797,7 @@ is_fortfile(const char *file, char **dat DPRINTF(2, (stderr, "FALSE (check fortunes only)\n")); return (FALSE); } - if ((sp = rindex(sp, '.')) != NULL) { + if ((sp = strrchr(sp, '.')) != NULL) { sp++; for (i = 0; suflist[i] != NULL; i++) if (strcmp(sp, suflist[i]) == 0) { Modified: head/lib/libc/gen/exec.c ============================================================================== --- head/lib/libc/gen/exec.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libc/gen/exec.c Tue Jan 3 18:51:58 2012 (r229403) @@ -159,7 +159,7 @@ execvPe(const char *name, const char *pa eacces = 0; /* If it's an absolute or relative path name, it's easy. */ - if (index(name, '/')) { + if (strchr(name, '/')) { bp = name; cur = NULL; goto retry; Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libc/gen/getttyent.c Tue Jan 3 18:51:58 2012 (r229403) @@ -78,7 +78,7 @@ getttyent(void) if (!fgets(p = line, lbsize, tf)) return (NULL); /* extend buffer if line was too big, and retry */ - while (!index(p, '\n') && !feof(tf)) { + while (!strchr(p, '\n') && !feof(tf)) { i = strlen(p); lbsize += MALLOCCHUNK; if ((p = realloc(line, lbsize)) == NULL) { @@ -148,7 +148,7 @@ getttyent(void) tty.ty_comment = p; if (*p == 0) tty.ty_comment = 0; - if ( (p = index(p, '\n')) ) + if ((p = strchr(p, '\n'))) *p = '\0'; return (&tty); } @@ -196,7 +196,7 @@ static char * value(char *p) { - return ((p = index(p, '=')) ? ++p : NULL); + return ((p = strchr(p, '=')) ? ++p : NULL); } int Modified: head/lib/libc/gen/timezone.c ============================================================================== --- head/lib/libc/gen/timezone.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libc/gen/timezone.c Tue Jan 3 18:51:58 2012 (r229403) @@ -59,7 +59,7 @@ timezone(int zone, int dst) *end; if ( (beg = getenv("TZNAME")) ) { /* set in environment */ - if ( (end = index(beg, ',')) ) {/* "PST,PDT" */ + if ((end = strchr(beg, ','))) { /* "PST,PDT" */ if (dst) return(++end); *end = '\0'; Modified: head/lib/libc/net/gethostbynis.c ============================================================================== --- head/lib/libc/net/gethostbynis.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libc/net/gethostbynis.c Tue Jan 3 18:51:58 2012 (r229403) @@ -91,7 +91,7 @@ _gethostbynis(const char *name, char *ma free(result); result = (char *)&ypbuf; - if ((cp = index(result, '\n'))) + if ((cp = strchr(result, '\n'))) *cp = '\0'; cp = strpbrk(result, " \t"); Modified: head/lib/libc/net/getnetbynis.c ============================================================================== --- head/lib/libc/net/getnetbynis.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libc/net/getnetbynis.c Tue Jan 3 18:51:58 2012 (r229403) @@ -80,7 +80,7 @@ _getnetbynis(const char *name, char *map free(result); result = (char *)&ypbuf; - if ((cp = index(result, '\n'))) + if ((cp = strchr(result, '\n'))) *cp = '\0'; cp = strpbrk(result, " \t"); Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libcam/camlib.c Tue Jan 3 18:51:58 2012 (r229403) @@ -137,7 +137,7 @@ cam_get_device(const char *path, char *d */ if (*tmpstr == '/') { tmpstr2 = tmpstr; - tmpstr = (char *)rindex(tmpstr2, '/'); + tmpstr = strrchr(tmpstr2, '/'); if ((tmpstr != NULL) && (*tmpstr != '\0')) tmpstr++; } Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libstand/bootp.c Tue Jan 3 18:51:58 2012 (r229403) @@ -703,13 +703,13 @@ setenv_(u_char *cp, u_char *ep, struct u_char *s = NULL; /* semicolon ? */ /* skip leading whitespace */ - while (*endv && index(" \t\n\r", *endv)) + while (*endv && strchr(" \t\n\r", *endv)) endv++; - vp = index(endv, '='); /* find name=value separator */ + vp = strchr(endv, '='); /* find name=value separator */ if (!vp) break; *vp++ = 0; - if (op->fmt == __ILIST && (s = index(vp, ';'))) + if (op->fmt == __ILIST && (s = strchr(vp, ';'))) *s++ = '\0'; setenv(endv, vp, 1); vp = s; /* prepare for next round */ Modified: head/lib/libutil/quotafile.c ============================================================================== --- head/lib/libutil/quotafile.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/lib/libutil/quotafile.c Tue Jan 3 18:51:58 2012 (r229403) @@ -84,7 +84,7 @@ hasquota(struct fstab *fs, int type, cha } strcpy(buf, fs->fs_mntops); for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) { - if ((cp = index(opt, '='))) + if ((cp = strchr(opt, '='))) *cp++ = '\0'; if (type == USRQUOTA && strcmp(opt, usrname) == 0) break; Modified: head/libexec/mknetid/parse_group.c ============================================================================== --- head/libexec/mknetid/parse_group.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/libexec/mknetid/parse_group.c Tue Jan 3 18:51:58 2012 (r229403) @@ -114,7 +114,7 @@ grscan(int search, int gid) return(0); bp = line; /* skip lines that are too big */ - if (!index(line, '\n')) { + if (!strchr(line, '\n')) { int ch; while ((ch = getc(_gr_fp)) != '\n' && ch != EOF) Modified: head/libexec/rlogind/rlogind.c ============================================================================== --- head/libexec/rlogind/rlogind.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/libexec/rlogind/rlogind.c Tue Jan 3 18:51:58 2012 (r229403) @@ -543,16 +543,17 @@ extern char **environ; void setup_term(int fd) { - char *cp = index(term+ENVSIZE, '/'); + char *cp; char *speed; struct termios tt, def; + cp = strchr(term + ENVSIZE, '/'); #ifndef notyet tcgetattr(fd, &tt); if (cp) { *cp++ = '\0'; speed = cp; - cp = index(speed, '/'); + cp = strchr(speed, '/'); if (cp) *cp++ = '\0'; cfsetspeed(&tt, atoi(speed)); @@ -567,7 +568,7 @@ setup_term(int fd) if (cp) { *cp++ = '\0'; speed = cp; - cp = index(speed, '/'); + cp = strchr(speed, '/'); if (cp) *cp++ = '\0'; tcgetattr(fd, &tt); Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sbin/bsdlabel/bsdlabel.c Tue Jan 3 18:51:58 2012 (r229403) @@ -782,12 +782,12 @@ getasciilabel(FILE *f, struct disklabel lp->d_sbsize = 0; /* XXX */ while (fgets(line, sizeof(line) - 1, f)) { lineno++; - if ((cp = index(line,'\n')) != 0) + if ((cp = strchr(line,'\n')) != 0) *cp = '\0'; cp = skip(line); if (cp == NULL) continue; - tp = index(cp, ':'); + tp = strchr(cp, ':'); if (tp == NULL) { fprintf(stderr, "line %d: syntax error\n", lineno); errors++; Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sbin/dump/main.c Tue Jan 3 18:51:58 2012 (r229403) @@ -290,7 +290,7 @@ main(int argc, char *argv[]) tape = strchr(host, ':'); *tape++ = '\0'; #ifdef RDUMP - if (index(tape, '\n')) { + if (strchr(tape, '\n')) { (void)fprintf(stderr, "invalid characters in tape\n"); exit(X_STARTUP); } Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sbin/fsck_ffs/pass2.c Tue Jan 3 18:51:58 2012 (r229403) @@ -613,7 +613,7 @@ fix_extraneous(struct inoinfo *inp, stru printf(" (IGNORED)\n"); return (0); } - if ((cp = rindex(oldname, '/')) == NULL) { + if ((cp = strchr(oldname, '/')) == NULL) { printf(" (IGNORED)\n"); return (0); } Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sbin/ipfw/main.c Tue Jan 3 18:51:58 2012 (r229403) @@ -122,9 +122,9 @@ ipfw_main(int oldac, char **oldav) break; if (copy) { arg[j++] = arg[i]; - copy = !index("," WHITESP, arg[i]); + copy = !strchr("," WHITESP, arg[i]); } else { - copy = !index(WHITESP, arg[i]); + copy = !strchr(WHITESP, arg[i]); if (copy) arg[j++] = arg[i]; } @@ -141,7 +141,7 @@ ipfw_main(int oldac, char **oldav) * processing, this is just the number of blanks plus 1. */ for (i = 0, ac = 1; i < l; i++) - if (index(WHITESP, arg[i]) != NULL) + if (strchr(WHITESP, arg[i]) != NULL) ac++; /* @@ -162,7 +162,7 @@ ipfw_main(int oldac, char **oldav) */ av_p = (char *)&av[ac+1]; for (ac = 1, i = j = 0; i < l; i++) { - if (index(WHITESP, arg[i]) != NULL || i == l-1) { + if (strchr(WHITESP, arg[i]) != NULL || i == l-1) { if (i == l-1) i++; bcopy(arg+j, av_p, i-j); @@ -240,7 +240,7 @@ ipfw_main(int oldac, char **oldav) " ipfw sysctl -a\n"); return 0; } - s = index(av[2], '='); + s = strchr(av[2], '='); if (s == NULL) { s = !strcmp(av[2], "-a") ? NULL : av[2]; sysctlbyname(s, NULL, NULL, NULL, 0); Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sbin/shutdown/shutdown.c Tue Jan 3 18:51:58 2012 (r229403) @@ -123,7 +123,7 @@ main(int argc, char **argv) * Test for the special case where the utility is called as * "poweroff", for which it runs 'shutdown -p now'. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/sys/boot/common/interp_parse.c ============================================================================== --- head/sys/boot/common/interp_parse.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sys/boot/common/interp_parse.c Tue Jan 3 18:51:58 2012 (r229403) @@ -137,7 +137,7 @@ parse(int *argc, char ***argv, char *str case VAR: if (token) { - PARSE_FAIL((q = index(p, token)) == NULL); + PARSE_FAIL((q = strchr(p, token)) == NULL); } else { q = p; while (*q && !isspace(*q)) Modified: head/sys/boot/ofw/common/main.c ============================================================================== --- head/sys/boot/ofw/common/main.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sys/boot/ofw/common/main.c Tue Jan 3 18:51:58 2012 (r229403) @@ -133,7 +133,7 @@ main(int (*openfirm)(void *)) printf("Memory: %lldKB\n", memsize() / 1024); OF_getprop(chosen, "bootpath", bootpath, 64); - ch = index(bootpath, ':'); + ch = strchr(bootpath, ':'); *ch = '\0'; printf("Booted from: %s\n", bootpath); Modified: head/sys/boot/ofw/libofw/ofw_net.c ============================================================================== --- head/sys/boot/ofw/libofw/ofw_net.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/sys/boot/ofw/libofw/ofw_net.c Tue Jan 3 18:51:58 2012 (r229403) @@ -185,7 +185,7 @@ ofwn_init(struct iodesc *desc, void *mac int pathlen; pathlen = OF_getprop(chosen, "bootpath", path, 64); - if ((ch = index(path, ':')) != NULL) + if ((ch = strchr(path, ':')) != NULL) *ch = '\0'; netdev = OF_finddevice(path); #ifdef __sparc64__ Modified: head/usr.bin/cksum/cksum.c ============================================================================== --- head/usr.bin/cksum/cksum.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/cksum/cksum.c Tue Jan 3 18:51:58 2012 (r229403) @@ -68,7 +68,7 @@ main(int argc, char **argv) int (*cfncn)(int, uint32_t *, off_t *); void (*pfncn)(char *, uint32_t, off_t); - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/usr.bin/compress/compress.c ============================================================================== --- head/usr.bin/compress/compress.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/compress/compress.c Tue Jan 3 18:51:58 2012 (r229403) @@ -75,7 +75,7 @@ main(int argc, char *argv[]) char *p, newname[MAXPATHLEN]; cat = 0; - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; @@ -141,7 +141,7 @@ main(int argc, char *argv[]) compress(*argv, "/dev/stdout", bits); break; } - if ((p = rindex(*argv, '.')) != NULL && + if ((p = strrchr(*argv, '.')) != NULL && !strcmp(p, ".Z")) { cwarnx("%s: name already has trailing .Z", *argv); @@ -164,7 +164,7 @@ main(int argc, char *argv[]) break; } len = strlen(*argv); - if ((p = rindex(*argv, '.')) == NULL || + if ((p = strrchr(*argv, '.')) == NULL || strcmp(p, ".Z")) { if (len > sizeof(newname) - 3) { cwarnx("%s: name too long", *argv); Modified: head/usr.bin/finger/finger.c ============================================================================== --- head/usr.bin/finger/finger.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/finger/finger.c Tue Jan 3 18:51:58 2012 (r229403) @@ -287,7 +287,7 @@ userlist(int argc, char **argv) /* Pull out all network requests. */ for (ap = p = argv, np = nargv; *p; ++p) - if (index(*p, '@')) + if (strchr(*p, '@')) *np++ = *p; else *ap++ = *p; Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/hexdump/display.c Tue Jan 3 18:51:58 2012 (r229403) @@ -220,7 +220,7 @@ bpad(PR *pr) pr->cchar[0] = 's'; pr->cchar[1] = '\0'; for (p1 = pr->fmt; *p1 != '%'; ++p1); - for (p2 = ++p1; *p1 && index(spec, *p1); ++p1); + for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1); while ((*p2++ = *p1++)); } Modified: head/usr.bin/hexdump/hexdump.c ============================================================================== --- head/usr.bin/hexdump/hexdump.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/hexdump/hexdump.c Tue Jan 3 18:51:58 2012 (r229403) @@ -61,7 +61,7 @@ main(int argc, char *argv[]) (void)setlocale(LC_ALL, ""); - if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od")) + if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od")) newsyntax(argc, &argv); else oldsyntax(argc, &argv); Modified: head/usr.bin/hexdump/hexsyntax.c ============================================================================== --- head/usr.bin/hexdump/hexsyntax.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/hexdump/hexsyntax.c Tue Jan 3 18:51:58 2012 (r229403) @@ -54,7 +54,7 @@ newsyntax(int argc, char ***argvp) char *p, **argv; argv = *argvp; - if ((p = rindex(argv[0], 'h')) != NULL && + if ((p = strrchr(argv[0], 'h')) != NULL && strcmp(p, "hd") == 0) { /* "Canonical" format, implies -C. */ add("\"%08.8_Ax\n\""); Modified: head/usr.bin/hexdump/parse.c ============================================================================== --- head/usr.bin/hexdump/parse.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/hexdump/parse.c Tue Jan 3 18:51:58 2012 (r229403) @@ -58,7 +58,7 @@ addfile(char *name) if ((fp = fopen(name, "r")) == NULL) err(1, "%s", name); while (fgets(buf, sizeof(buf), fp)) { - if (!(p = index(buf, '\n'))) { + if (!(p = strchr(buf, '\n'))) { warnx("line too long"); while ((ch = getchar()) != '\n' && ch != EOF); continue; @@ -167,7 +167,7 @@ size(FS *fs) * skip any special chars -- save precision in * case it's a %s format. */ - while (index(spec + 1, *++fmt)); + while (strchr(spec + 1, *++fmt)); if (*fmt == '.' && isdigit(*++fmt)) { prec = atoi(fmt); while (isdigit(*++fmt)); @@ -243,10 +243,10 @@ rewrite(FS *fs) if (fu->bcnt) { sokay = USEBCNT; /* Skip to conversion character. */ - for (++p1; index(spec, *p1); ++p1); + for (++p1; strchr(spec, *p1); ++p1); } else { /* Skip any special chars, field width. */ - while (index(spec + 1, *++p1)); + while (strchr(spec + 1, *++p1)); if (*p1 == '.' && isdigit(*++p1)) { sokay = USEPREC; prec = atoi(p1); Modified: head/usr.bin/locate/locate/fastfind.c ============================================================================== --- head/usr.bin/locate/locate/fastfind.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/locate/locate/fastfind.c Tue Jan 3 18:51:58 2012 (r229403) @@ -167,7 +167,7 @@ fastfind /* find optimal (last) char for searching */ for (p = pathpart; *p != '\0'; p++) - if (index(LOCATE_REG, *p) != NULL) + if (strchr(LOCATE_REG, *p) != NULL) break; if (*p == '\0') Modified: head/usr.bin/locate/locate/util.c ============================================================================== --- head/usr.bin/locate/locate/util.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/locate/locate/util.c Tue Jan 3 18:51:58 2012 (r229403) @@ -162,7 +162,7 @@ patprep(name) /* skip trailing metacharacters */ for (; p >= name; p--) - if (index(LOCATE_REG, *p) == NULL) + if (strchr(LOCATE_REG, *p) == NULL) break; /* @@ -172,7 +172,7 @@ patprep(name) * |----< p */ if (p >= name && - (index(p, '[') != NULL || index(p, ']') != NULL)) { + (strchr(p, '[') != NULL || strchr(p, ']') != NULL)) { for (p = name; *p != '\0'; p++) if (*p == ']' || *p == '[') break; @@ -183,7 +183,7 @@ patprep(name) * '*\*[a-z]' * |-------< p */ - if (p >= name && index(LOCATE_REG, *p) != NULL) + if (p >= name && strchr(LOCATE_REG, *p) != NULL) p = name - 1; } @@ -193,7 +193,7 @@ patprep(name) else { for (endmark = p; p >= name; p--) - if (index(LOCATE_REG, *p) != NULL) + if (strchr(LOCATE_REG, *p) != NULL) break; for (++p; (p <= endmark) && subp < (globfree + sizeof(globfree));) Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/netstat/if.c Tue Jan 3 18:51:58 2012 (r229403) @@ -256,7 +256,7 @@ intpr(int interval1, u_long ifnetaddr, v ifnetaddr = (u_long)TAILQ_NEXT(&ifnet, if_link); if (interface != 0 && strcmp(name, interface) != 0) continue; - cp = index(name, '\0'); + cp = strchr(name, '\0'); if (pfunc) { (*pfunc)(name); Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/netstat/inet.c Tue Jan 3 18:51:58 2012 (r229403) @@ -1247,7 +1247,7 @@ inetprint(struct in_addr *in, int port, sprintf(line, "%s.", inetname(in)); else sprintf(line, "%.*s.", (Aflag && !num_port) ? 12 : 16, inetname(in)); - cp = index(line, '\0'); + cp = strchr(line, '\0'); if (!num_port && port) sp = getservbyport((int)port, proto); if (sp || port == 0) Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/netstat/inet6.c Tue Jan 3 18:51:58 2012 (r229403) @@ -1100,7 +1100,7 @@ inet6print(struct in6_addr *in6, int por sprintf(line, "%.*s.", Wflag ? 39 : (Aflag && !numeric) ? 12 : 16, inet6name(in6)); - cp = index(line, '\0'); + cp = strchr(line, '\0'); if (!numeric && port) GETSERVBYPORT6(port, proto, sp); if (sp || port == 0) @@ -1129,7 +1129,7 @@ inet6name(struct in6_addr *in6p) if (first && !numeric_addr) { first = 0; if (gethostname(domain, MAXHOSTNAMELEN) == 0 && - (cp = index(domain, '.'))) + (cp = strchr(domain, '.'))) (void) strcpy(domain, cp + 1); else domain[0] = 0; @@ -1138,7 +1138,7 @@ inet6name(struct in6_addr *in6p) if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) { hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6); if (hp) { - if ((cp = index(hp->h_name, '.')) && + if ((cp = strchr(hp->h_name, '.')) && !strcmp(cp + 1, domain)) *cp = 0; cp = hp->h_name; Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/netstat/sctp.c Tue Jan 3 18:51:58 2012 (r229403) @@ -162,7 +162,7 @@ inet6name(struct in6_addr *in6p) if (first && !numeric_addr) { first = 0; if (gethostname(domain, MAXHOSTNAMELEN) == 0 && - (cp = index(domain, '.'))) + (cp = strchr(domain, '.'))) (void) strcpy(domain, cp + 1); else domain[0] = 0; @@ -171,7 +171,7 @@ inet6name(struct in6_addr *in6p) if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) { hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6); if (hp) { - if ((cp = index(hp->h_name, '.')) && + if ((cp = strchr(hp->h_name, '.')) && !strcmp(cp + 1, domain)) *cp = 0; cp = hp->h_name; @@ -209,7 +209,7 @@ sctp_print_address(union sctp_sockstore sprintf(line, "%.*s.", Wflag ? 39 : 16, ""); break; } - cp = index(line, '\0'); + cp = strchr(line, '\0'); if (!num_port && port) sp = getservbyport((int)port, "sctp"); if (sp || port == 0) Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/rlogin/rlogin.c Tue Jan 3 18:51:58 2012 (r229403) @@ -142,7 +142,7 @@ main(int argc, char *argv[]) one = 1; host = localname = user = NULL; - if ((p = rindex(argv[0], '/'))) + if ((p = strrchr(argv[0], '/'))) ++p; else p = argv[0]; Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/rpcgen/rpc_main.c Tue Jan 3 18:51:58 2012 (r229403) @@ -64,10 +64,6 @@ static void clnt_output(const char *, co static char *generate_guard(const char *); static void c_initialize(void); -#if !defined(__FreeBSD__) && !defined(__NetBSD__) -char * rindex(); -#endif - static void usage(void); static void options_usage(void); static int do_registers(int, const char **); @@ -233,7 +229,7 @@ extendfile(const char *path, const char const char *p; const char *file; - if ((file = rindex(path, '/')) == NULL) + if ((file = strrchr(path, '/')) == NULL) file = path; else file++; @@ -821,7 +817,7 @@ static void mkfile_output(struct command if (allfiles){ mkftemp = xmalloc(strlen("makefile.") + strlen(cmd->infile) + 1); - temp = (char *)rindex(cmd->infile, '.'); + temp = strrchr(cmd->infile, '.'); strcpy(mkftemp, "makefile."); (void) strncat(mkftemp, cmd->infile, (temp - cmd->infile)); Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/systat/devs.c Tue Jan 3 18:51:58 2012 (r229403) @@ -265,7 +265,7 @@ dsselect(const char *args, devstat_selec specified_devices = (char **)malloc(sizeof(char *)); tmpstr = tmpstr1 = strdup(args); - cp = index(tmpstr1, '\n'); + cp = strchr(tmpstr1, '\n'); if (cp) *cp = '\0'; for (;;) { Modified: head/usr.bin/systat/netcmds.c ============================================================================== --- head/usr.bin/systat/netcmds.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/systat/netcmds.c Tue Jan 3 18:51:58 2012 (r229403) @@ -131,7 +131,7 @@ changeitems(const char *args, int onoff) struct in_addr in; tmpstr = tmpstr1 = strdup(args); - cp = index(tmpstr1, '\n'); + cp = strchr(tmpstr1, '\n'); if (cp) *cp = '\0'; for (;;tmpstr1 = cp) { Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/systat/netstat.c Tue Jan 3 18:51:58 2012 (r229403) @@ -554,7 +554,7 @@ inetprint(struct sockaddr *sa, const cha break; } snprintf(line, sizeof(line), "%.*s.", 16, inetname(sa)); - cp = index(line, '\0'); + cp = strchr(line, '\0'); if (!nflag && port) sp = getservbyport(port, proto); if (sp || port == 0) @@ -564,7 +564,7 @@ inetprint(struct sockaddr *sa, const cha snprintf(cp, sizeof(line) - (cp - line), "%d", ntohs((u_short)port)); /* pad to full column to clear any garbage */ - cp = index(line, '\0'); + cp = strchr(line, '\0'); while (cp - line < 22) *cp++ = ' '; line[22] = '\0'; Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/tftp/main.c Tue Jan 3 18:51:58 2012 (r229403) @@ -437,16 +437,16 @@ put(int argc, char *argv[]) return; } targ = argv[argc - 1]; - if (rindex(argv[argc - 1], ':')) { + if (strrchr(argv[argc - 1], ':')) { char *lcp; for (n = 1; n < argc - 1; n++) - if (index(argv[n], ':')) { + if (strchr(argv[n], ':')) { putusage(argv[0]); return; } lcp = argv[argc - 1]; - targ = rindex(lcp, ':'); + targ = strrchr(lcp, ':'); *targ++ = 0; if (lcp[0] == '[' && lcp[strlen(lcp) - 1] == ']') { lcp[strlen(lcp) - 1] = '\0'; @@ -477,7 +477,7 @@ put(int argc, char *argv[]) } /* this assumes the target is a directory */ /* on a remote unix system. hmmmm. */ - cp = index(targ, '\0'); + cp = strchr(targ, '\0'); *cp++ = '/'; for (n = 1; n < argc - 1; n++) { strcpy(cp, tail(argv[n])); @@ -532,7 +532,7 @@ get(int argc, char *argv[]) } if (!connected) { for (n = 1; n < argc ; n++) - if (rindex(argv[n], ':') == 0) { + if (strrchr(argv[n], ':') == 0) { printf("No remote host specified and " "no host given for file '%s'\n", argv[n]); getusage(argv[0]); @@ -540,7 +540,7 @@ get(int argc, char *argv[]) } } for (n = 1; n < argc ; n++) { - src = rindex(argv[n], ':'); + src = strrchr(argv[n], ':'); if (src == NULL) src = argv[n]; else { @@ -681,7 +681,7 @@ tail(char *filename) char *s; while (*filename) { - s = rindex(filename, '/'); + s = strrchr(filename, '/'); if (s == NULL) break; if (s[1]) Modified: head/usr.bin/tr/str.c ============================================================================== --- head/usr.bin/tr/str.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/tr/str.c Tue Jan 3 18:51:58 2012 (r229403) @@ -161,7 +161,7 @@ bracket(STR *s) repeat: if ((p = strpbrk(s->str + 2, "*]")) == NULL) return (0); - if (p[0] != '*' || index(p, ']') == NULL) + if (p[0] != '*' || strchr(p, ']') == NULL) return (0); s->str += 1; genseq(s); Modified: head/usr.bin/tset/map.c ============================================================================== --- head/usr.bin/tset/map.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/tset/map.c Tue Jan 3 18:51:58 2012 (r229403) @@ -132,7 +132,7 @@ next: if (*arg == ':') { goto badmopt; ++arg; } else { /* Optional baudrate. */ - arg = index(p = arg, ':'); + arg = strchr(p = arg, ':'); if (arg == NULL) goto badmopt; *arg++ = '\0'; Modified: head/usr.bin/tset/term.c ============================================================================== --- head/usr.bin/tset/term.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/tset/term.c Tue Jan 3 18:51:58 2012 (r229403) @@ -74,7 +74,7 @@ get_termcap_entry(char *userarg, char ** /* Try ttyname(3); check for dialup or other mapping. */ if ((ttypath = ttyname(STDERR_FILENO))) { - if ((p = rindex(ttypath, '/'))) + if ((p = strrchr(ttypath, '/'))) ++p; else p = ttypath; @@ -146,7 +146,7 @@ askuser(const char *dflt) return (dflt); } - if ((p = index(answer, '\n'))) + if ((p = strchr(answer, '\n'))) *p = '\0'; if (answer[0]) return (answer); Modified: head/usr.bin/tset/wrterm.c ============================================================================== --- head/usr.bin/tset/wrterm.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.bin/tset/wrterm.c Tue Jan 3 18:51:58 2012 (r229403) @@ -56,7 +56,7 @@ wrtermcap(char *bp) char *t, *sep; /* Find the end of the terminal names. */ - if ((t = index(bp, ':')) == NULL) + if ((t = strchr(bp, ':')) == NULL) errx(1, "termcap names not colon terminated"); *t++ = '\0'; Modified: head/usr.sbin/bootparamd/bootparamd/bootparamd.c ============================================================================== --- head/usr.sbin/bootparamd/bootparamd/bootparamd.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/bootparamd/bootparamd/bootparamd.c Tue Jan 3 18:51:58 2012 (r229403) @@ -114,7 +114,7 @@ bp_getfile_res * bp_getfile_arg *getfile; struct svc_req *req; { - char *where, *index(); + char *where; static bp_getfile_res res; if (debug) @@ -133,7 +133,7 @@ struct svc_req *req; askname[sizeof(askname)-1] = 0; if (getthefile(askname, getfile->file_id,buffer,sizeof(buffer))) { - if ( (where = index(buffer,':')) ) { + if ( (where = strchr(buffer,':')) ) { /* buffer is re-written to contain the name of the info of file */ strncpy(hostname, buffer, where - buffer); hostname[where - buffer] = '\0'; Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/config/main.c Tue Jan 3 18:51:58 2012 (r229403) @@ -626,7 +626,7 @@ remember(const char *file) else s = ns(file); - if (index(s, '_') && strncmp(s, "opt_", 4) != 0) { + if (strchr(s, '_') && strncmp(s, "opt_", 4) != 0) { free(s); return; } Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/config/mkmakefile.c Tue Jan 3 18:51:58 2012 (r229403) @@ -206,12 +206,12 @@ makehints(void) err(1, "%s", hint->hint_name); while (fgets(line, BUFSIZ, ifp) != 0) { /* zap trailing CR and/or LF */ - while ((s = rindex(line, '\n')) != NULL) + while ((s = strrchr(line, '\n')) != NULL) *s = '\0'; - while ((s = rindex(line, '\r')) != NULL) + while ((s = strrchr(line, '\r')) != NULL) *s = '\0'; /* remove # comments */ - s = index(line, '#'); + s = strchr(line, '#'); if (s) *s = '\0'; /* remove any whitespace and " characters */ @@ -268,12 +268,12 @@ makeenv(void) if (ifp) { while (fgets(line, BUFSIZ, ifp) != 0) { /* zap trailing CR and/or LF */ - while ((s = rindex(line, '\n')) != NULL) + while ((s = strrchr(line, '\n')) != NULL) *s = '\0'; - while ((s = rindex(line, '\r')) != NULL) + while ((s = strrchr(line, '\r')) != NULL) *s = '\0'; /* remove # comments */ - s = index(line, '#'); + s = strchr(line, '#'); if (s) *s = '\0'; /* remove any whitespace and " characters */ @@ -689,7 +689,7 @@ tail(char *fn) { char *cp; - cp = rindex(fn, '/'); + cp = strrchr(fn, '/'); if (cp == 0) return (fn); return (cp+1); Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/inetd/inetd.c Tue Jan 3 18:51:58 2012 (r229403) @@ -1764,7 +1764,7 @@ more: sep->se_rpc_lowvers = 0; memcpy(&sep->se_ctrladdr4, bind_sa4, sizeof(sep->se_ctrladdr4)); - if ((versp = rindex(sep->se_service, '/'))) { + if ((versp = strrchr(sep->se_service, '/'))) { *versp++ = '\0'; switch (sscanf(versp, "%u-%u", &sep->se_rpc_lowvers, @@ -1936,7 +1936,7 @@ more: } else sep->se_group = NULL; sep->se_server = newstr(sskip(&cp)); - if ((sep->se_server_name = rindex(sep->se_server, '/'))) + if ((sep->se_server_name = strrchr(sep->se_server, '/'))) sep->se_server_name++; if (strcmp(sep->se_server, "internal") == 0) { struct biltin *bi; Modified: head/usr.sbin/ipfwpcap/ipfwpcap.c ============================================================================== --- head/usr.sbin/ipfwpcap/ipfwpcap.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/ipfwpcap/ipfwpcap.c Tue Jan 3 18:51:58 2012 (r229403) @@ -87,7 +87,7 @@ okay(int pn) char *p, numbuf[80]; if (pidfile[0] == '\0') { - p = rindex(prog, '/'); + p = strrchr(prog, '/'); p = (p == NULL) ? prog : p + 1; snprintf(pidfile, sizeof pidfile, Modified: head/usr.sbin/mtree/spec.c ============================================================================== --- head/usr.sbin/mtree/spec.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/mtree/spec.c Tue Jan 3 18:51:58 2012 (r229403) @@ -73,7 +73,7 @@ mtree_readspec(FILE *fi) continue; /* Find end of line. */ - if ((p = index(buf, '\n')) == NULL) + if ((p = strchr(buf, '\n')) == NULL) errx(1, "line %d too long", lineno); /* See if next line is continuation line. */ @@ -118,7 +118,7 @@ mtree_readspec(FILE *fi) continue; } - if (index(p, '/')) + if (strchr(p, '/')) errx(1, "line %d: slash character in file name", lineno); Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/newsyslog/newsyslog.c Tue Jan 3 18:51:58 2012 (r229403) @@ -1710,7 +1710,7 @@ do_rotate(const struct conf_entry *ent) } else { /* relative */ /* get directory part of logfile */ strlcpy(dirpart, ent->log, sizeof(dirpart)); - if ((p = rindex(dirpart, '/')) == NULL) + if ((p = strrchr(dirpart, '/')) == NULL) dirpart[0] = '\0'; else *(p + 1) = '\0'; @@ -1722,7 +1722,7 @@ do_rotate(const struct conf_entry *ent) createdir(ent, dirpart); /* get filename part of logfile */ - if ((p = rindex(ent->log, '/')) == NULL) + if ((p = strrchr(ent->log, '/')) == NULL) strlcpy(namepart, ent->log, sizeof(namepart)); else strlcpy(namepart, p + 1, sizeof(namepart)); @@ -2255,7 +2255,7 @@ age_old_log(char *file) } else { /* relative */ /* get directory part of logfile */ strlcpy(tmp, file, sizeof(tmp)); - if ((p = rindex(tmp, '/')) == NULL) + if ((p = strrchr(tmp, '/')) == NULL) tmp[0] = '\0'; else *(p + 1) = '\0'; @@ -2265,7 +2265,7 @@ age_old_log(char *file) strlcat(tmp, "/", sizeof(tmp)); /* get filename part of logfile */ - if ((p = rindex(file, '/')) == NULL) + if ((p = strrchr(file, '/')) == NULL) strlcat(tmp, file, sizeof(tmp)); else strlcat(tmp, p + 1, sizeof(tmp)); Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/rwhod/rwhod.c Tue Jan 3 18:51:58 2012 (r229403) @@ -227,7 +227,7 @@ main(int argc, char *argv[]) syslog(LOG_ERR, "gethostname: %m"); exit(1); } - if ((cp = index(myname, '.')) != NULL) + if ((cp = strchr(myname, '.')) != NULL) *cp = '\0'; strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1); mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0'; Modified: head/usr.sbin/sade/variable.c ============================================================================== --- head/usr.sbin/sade/variable.c Tue Jan 3 18:49:39 2012 (r229402) +++ head/usr.sbin/sade/variable.c Tue Jan 3 18:51:58 2012 (r229403) @@ -83,7 +83,7 @@ variable_set(char *var, int dirty) else if (!*var) msgDebug("Warning: Zero length name & value passed to variable_set()\n"); SAFE_STRCPY(tmp, var); - if ((cp = index(tmp, '=')) == NULL) + if ((cp = strchr(tmp, '=')) == NULL) msgFatal("Invalid variable format: %s", var); *(cp++) = '\0'; make_variable(tmp, string_skipwhite(cp), dirty); @@ -123,7 +123,7 @@ variable_unset(char *var) Variable *vp; char name[512], *cp; - if ((cp = index(var, '=')) != NULL) + if ((cp = strchr(var, '=')) != NULL) sstrncpy(name, var, cp - var); else SAFE_STRCPY(name, var); @@ -189,14 +189,14 @@ variable_check2(char *data) if (data == NULL) return -1; SAFE_STRCPY(tmp, data); - if ((cp = index(tmp, '=')) != NULL) { + if ((cp = strchr(tmp, '=')) != NULL) { *(cp++) = '\0'; if (*cp == '"') { /* smash quotes if present */ ++cp; - if ((cp3 = index(cp, '"')) != NULL) + if ((cp3 = strchr(cp, '"')) != NULL) *cp3 = '\0'; } - else if ((cp3 = index(cp, ',')) != NULL) + else if ((cp3 = strchr(cp, ',')) != NULL) *cp3 = '\0'; cp2 = variable_get(tmp); if (cp2 != NULL) { @@ -305,7 +305,7 @@ pvariable_set(char *var) msgDebug("Warning: Zero length name & value passed to variable_set()\n"); /* Add a trivial namespace to whatever name the caller chooses. */ SAFE_STRCPY(tmp, "SYSINSTALL_PVAR"); - if (index(var, '=') == NULL) + if (strchr(var, '=') == NULL) msgFatal("Invalid variable format: %s", var); strlcat(tmp, var, 1024); p = strchr(tmp, '='); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 19:09:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4AE6106566C; Tue, 3 Jan 2012 19:09:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89AE68FC14; Tue, 3 Jan 2012 19:09: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 q03J92g6037885; Tue, 3 Jan 2012 19:09:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03J92Y4037882; Tue, 3 Jan 2012 19:09:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201031909.q03J92Y4037882@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 3 Jan 2012 19:09: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: r229407 - head/sys/fs/ntfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 19:09:02 -0000 Author: pfg Date: Tue Jan 3 19:09:01 2012 New Revision: 229407 URL: http://svn.freebsd.org/changeset/base/229407 Log: Minor cleanups to ntfs code bzero -> memset rename variables to avoid shadowing. PR: 142401 Obtained from: NetBSD Approved by jhb (mentor) Modified: head/sys/fs/ntfs/ntfs_compr.c head/sys/fs/ntfs/ntfs_subr.c Modified: head/sys/fs/ntfs/ntfs_compr.c ============================================================================== --- head/sys/fs/ntfs/ntfs_compr.c Tue Jan 3 19:01:54 2012 (r229406) +++ head/sys/fs/ntfs/ntfs_compr.c Tue Jan 3 19:09:01 2012 (r229407) @@ -42,7 +42,7 @@ int ntfs_uncompblock( - u_int8_t * buf, + u_int8_t * dbuf, u_int8_t * cbuf) { u_int32_t ctag; @@ -60,8 +60,8 @@ ntfs_uncompblock( dprintf(("ntfs_uncompblock: len: %x instead of %d\n", len, 0xfff)); } - memcpy(buf, cbuf + 2, len + 1); - bzero(buf + len + 1, NTFS_COMPBLOCK_SIZE - 1 - len); + memcpy(dbuf, cbuf + 2, len + 1); + memset(dbuf + len + 1, 0, NTFS_COMPBLOCK_SIZE - 1 - len); return len + 3; } cpos = 2; @@ -78,12 +78,12 @@ ntfs_uncompblock( boff = -1 - (GET_UINT16(cbuf + cpos) >> dshift); blen = 3 + (GET_UINT16(cbuf + cpos) & lmask); for (j = 0; (j < blen) && (pos < NTFS_COMPBLOCK_SIZE); j++) { - buf[pos] = buf[pos + boff]; + dbuf[pos] = dbuf[pos + boff]; pos++; } cpos += 2; } else { - buf[pos++] = cbuf[cpos++]; + dbuf[pos++] = cbuf[cpos++]; } ctag >>= 1; } Modified: head/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- head/sys/fs/ntfs/ntfs_subr.c Tue Jan 3 19:01:54 2012 (r229406) +++ head/sys/fs/ntfs/ntfs_subr.c Tue Jan 3 19:09:01 2012 (r229407) @@ -1636,7 +1636,7 @@ ntfs_readntvattr_plain( for(; remains; remains--) uiomove("", 1, uio); } else - bzero(data, tocopy); + memset(data, 0, tocopy); data = data + tocopy; } cnt++; @@ -1783,7 +1783,7 @@ ntfs_readattr( uiomove("", 1, uio); } else - bzero(data, tocopy); + memset(data, 0, tocopy); } else { error = ntfs_uncompunit(ntmp, uup, cup); if (error) From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 19:10:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96096106566C; Tue, 3 Jan 2012 19:10:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8555F8FC0A; Tue, 3 Jan 2012 19:10: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 q03JAbKQ037982; Tue, 3 Jan 2012 19:10:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03JAbY6037980; Tue, 3 Jan 2012 19:10:37 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201031910.q03JAbY6037980@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 3 Jan 2012 19:10: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: r229408 - head/sys/mips/cavium/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 19:10:37 -0000 Author: gonzo Date: Tue Jan 3 19:10:37 2012 New Revision: 229408 URL: http://svn.freebsd.org/changeset/base/229408 Log: - Octeon-SDK strictly requires multi_count to be zero for full and low speed devices. Modified: head/sys/mips/cavium/usb/octusb.c Modified: head/sys/mips/cavium/usb/octusb.c ============================================================================== --- head/sys/mips/cavium/usb/octusb.c Tue Jan 3 19:09:01 2012 (r229407) +++ head/sys/mips/cavium/usb/octusb.c Tue Jan 3 19:10:37 2012 (r229408) @@ -169,7 +169,7 @@ octusb_host_alloc_endpoint(struct octusb (td->qh->ep_num & UE_DIR_IN) ? CVMX_USB_DIRECTION_IN : CVMX_USB_DIRECTION_OUT, td->qh->ep_interval, - td->qh->ep_mult, + (td->qh->dev_speed == USB_SPEED_HIGH) ? td->qh->ep_mult : 0, td->qh->hs_hub_addr, td->qh->hs_hub_port); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 19:41:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB52106566C; Tue, 3 Jan 2012 19:41:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39E418FC12; Tue, 3 Jan 2012 19:41: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 q03JfbBS039429; Tue, 3 Jan 2012 19:41:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03JfboX039426; Tue, 3 Jan 2012 19:41:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201031941.q03JfboX039426@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 19:41: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: r229413 - in head/contrib/compiler-rt: . lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 19:41:37 -0000 Author: ed Date: Tue Jan 3 19:41:36 2012 New Revision: 229413 URL: http://svn.freebsd.org/changeset/base/229413 Log: Import compiler-rt r147467. The compiler-rt shipped with FreeBSD is now based on unmodified upstream sources. Modified: head/contrib/compiler-rt/LICENSE.TXT head/contrib/compiler-rt/lib/trampoline_setup.c Directory Properties: head/contrib/compiler-rt/ (props changed) Modified: head/contrib/compiler-rt/LICENSE.TXT ============================================================================== --- head/contrib/compiler-rt/LICENSE.TXT Tue Jan 3 19:39:27 2012 (r229412) +++ head/contrib/compiler-rt/LICENSE.TXT Tue Jan 3 19:41:36 2012 (r229413) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal Modified: head/contrib/compiler-rt/lib/trampoline_setup.c ============================================================================== --- head/contrib/compiler-rt/lib/trampoline_setup.c Tue Jan 3 19:39:27 2012 (r229412) +++ head/contrib/compiler-rt/lib/trampoline_setup.c Tue Jan 3 19:41:36 2012 (r229413) @@ -44,4 +44,4 @@ void __trampoline_setup(uint32_t* trampO /* clear instruction cache */ __clear_cache(trampOnStack, &trampOnStack[10]); } -#endif /* __ppc__ */ +#endif /* __ppc__ && !defined(__powerpc64__) */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 19:44:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33540106564A; Tue, 3 Jan 2012 19:44: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 0841F8FC12; Tue, 3 Jan 2012 19:44: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 q03JiaCw039561; Tue, 3 Jan 2012 19:44:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03Jia46039559; Tue, 3 Jan 2012 19:44:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201031944.q03Jia46039559@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jan 2012 19:44: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: r229414 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 19:44:37 -0000 Author: jhb Date: Tue Jan 3 19:44:36 2012 New Revision: 229414 URL: http://svn.freebsd.org/changeset/base/229414 Log: Grab a reference on the matching interface address (ifa) in the handling of the SIOC[DG]LIFADDR icotls before dropping the IF_ADDR_LOCK() and release the reference after using it. This prevents the address from being potentially freed out from under the ioctl handler. Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jan 3 19:41:36 2012 (r229413) +++ head/sys/netinet6/in6.c Tue Jan 3 19:44:36 2012 (r229414) @@ -1767,6 +1767,8 @@ in6_lifaddr_ioctl(struct socket *so, u_l if (IN6_ARE_ADDR_EQUAL(&candidate, &match)) break; } + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_UNLOCK(ifp); if (!ifa) return EADDRNOTAVAIL; @@ -1779,16 +1781,20 @@ in6_lifaddr_ioctl(struct socket *so, u_l bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin6_len); error = sa6_recoverscope( (struct sockaddr_in6 *)&iflr->addr); - if (error != 0) + if (error != 0) { + ifa_free(ifa); return (error); + } if ((ifp->if_flags & IFF_POINTOPOINT) != 0) { bcopy(&ia->ia_dstaddr, &iflr->dstaddr, ia->ia_dstaddr.sin6_len); error = sa6_recoverscope( (struct sockaddr_in6 *)&iflr->dstaddr); - if (error != 0) + if (error != 0) { + ifa_free(ifa); return (error); + } } else bzero(&iflr->dstaddr, sizeof(iflr->dstaddr)); @@ -1796,6 +1802,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); iflr->flags = ia->ia6_flags; /* XXX */ + ifa_free(ifa); return 0; } else { @@ -1819,6 +1826,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l ia->ia_prefixmask.sin6_len); ifra.ifra_flags = ia->ia6_flags; + ifa_free(ifa); return in6_control(so, SIOCDIFADDR_IN6, (caddr_t)&ifra, ifp, td); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 19:47:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96FD4106566C; Tue, 3 Jan 2012 19:47:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857CF8FC13; Tue, 3 Jan 2012 19:47:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03JlXh4039686; Tue, 3 Jan 2012 19:47:33 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03JlXnx039684; Tue, 3 Jan 2012 19:47:33 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201031947.q03JlXnx039684@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 3 Jan 2012 19:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 19:47:33 -0000 Author: pfg Date: Tue Jan 3 19:47:32 2012 New Revision: 229415 URL: http://svn.freebsd.org/changeset/base/229415 Log: Integrate the line drawing algorithm from the book "Graphic Gems 1". http://www.graphicsgems.org/ At the time it claimed to be 3-4 times faster than the traditional algorithm. PR: 18769 Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Tue Jan 3 19:44:36 2012 (r229414) +++ head/lib/libvgl/simple.c Tue Jan 3 19:47:32 2012 (r229415) @@ -198,36 +198,205 @@ get_planar: return 0; /* XXX black? */ } + /* + * Symmetric Double Step Line Algorithm by Brian Wyvill from + * "Graphics Gems", Academic Press, 1990. + */ + +#define SL_SWAP(a,b) {a^=b; b^=a; a^=b;} +#define SL_ABSOLUTE(i,j,k) ( (i-j)*(k = ( (i-j)<0 ? -1 : 1))) + +void +plot(VGLBitmap * object, int x, int y, int flag, byte color) +{ + /* non-zero flag indicates the pixels need swapping back. */ + if (flag) + VGLSetXY(object, y, x, color); + else + VGLSetXY(object, x, y, color); +} + + void VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color) { - int d, x, y, ax, ay, sx, sy, dx, dy; + int dx, dy, incr1, incr2, D, x, y, xend, c, pixels_left; + int sign_x, sign_y, step, reverse, i; - dx = x2-x1; ax = ABS(dx)<<1; sx = SGN(dx); x = x1; - dy = y2-y1; ay = ABS(dy)<<1; sy = SGN(dy); y = y1; + dx = SL_ABSOLUTE(x2, x1, sign_x); + dy = SL_ABSOLUTE(y2, y1, sign_y); + /* decide increment sign by the slope sign */ + if (sign_x == sign_y) + step = 1; + else + step = -1; + + if (dy > dx) { /* chooses axis of greatest movement (make dx) */ + SL_SWAP(x1, y1); + SL_SWAP(x2, y2); + SL_SWAP(dx, dy); + reverse = 1; + } else + reverse = 0; + /* note error check for dx==0 should be included here */ + if (x1 > x2) { /* start from the smaller coordinate */ + x = x2; + y = y2; + x1 = x1; + y1 = y1; + } else { + x = x1; + y = y1; + x1 = x2; + y1 = y2; + } + + + /* Note dx=n implies 0 - n or (dx+1) pixels to be set */ + /* Go round loop dx/4 times then plot last 0,1,2 or 3 pixels */ + /* In fact (dx-1)/4 as 2 pixels are already plotted */ + xend = (dx - 1) / 4; + pixels_left = (dx - 1) % 4; /* number of pixels left over at the + * end */ + plot(object, x, y, reverse, color); + if (pixels_left < 0) + return; /* plot only one pixel for zero length + * vectors */ + plot(object, x1, y1, reverse, color); /* plot first two points */ + incr2 = 4 * dy - 2 * dx; + if (incr2 < 0) { /* slope less than 1/2 */ + c = 2 * dy; + incr1 = 2 * c; + D = incr1 - dx; + + for (i = 0; i < xend; i++) { /* plotting loop */ + ++x; + --x1; + if (D < 0) { + /* pattern 1 forwards */ + plot(object, x, y, reverse, color); + plot(object, ++x, y, reverse, color); + /* pattern 1 backwards */ + plot(object, x1, y1, reverse, color); + plot(object, --x1, y1, reverse, color); + D += incr1; + } else { + if (D < c) { + /* pattern 2 forwards */ + plot(object, x, y, reverse, color); + plot(object, ++x, y += step, reverse, + color); + /* pattern 2 backwards */ + plot(object, x1, y1, reverse, color); + plot(object, --x1, y1 -= step, reverse, + color); + } else { + /* pattern 3 forwards */ + plot(object, x, y += step, reverse, color); + plot(object, ++x, y, reverse, color); + /* pattern 3 backwards */ + plot(object, x1, y1 -= step, reverse, + color); + plot(object, --x1, y1, reverse, color); + } + D += incr2; + } + } /* end for */ - if (ax>ay) { /* x dominant */ - d = ay-(ax>>1); - for (;;) { - VGLSetXY(object, x, y, color); - if (x==x2) - break; - if (d>=0) { - y += sy; d -= ax; + /* plot last pattern */ + if (pixels_left) { + if (D < 0) { + plot(object, ++x, y, reverse, color); /* pattern 1 */ + if (pixels_left > 1) + plot(object, ++x, y, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1, reverse, color); + } else { + if (D < c) { + plot(object, ++x, y, reverse, color); /* pattern 2 */ + if (pixels_left > 1) + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1, reverse, color); + } else { + /* pattern 3 */ + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 1) + plot(object, ++x, y, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1 -= step, reverse, color); + } } - x += sx; d += ay; - } + } /* end if pixels_left */ } - else { /* y dominant */ - d = ax-(ay>>1); - for (;;) { - VGLSetXY(object, x, y, color); - if (y==y2) - break; - if (d>=0) { - x += sx; d -= ay; + /* end slope < 1/2 */ + else { /* slope greater than 1/2 */ + c = 2 * (dy - dx); + incr1 = 2 * c; + D = incr1 + dx; + for (i = 0; i < xend; i++) { + ++x; + --x1; + if (D > 0) { + /* pattern 4 forwards */ + plot(object, x, y += step, reverse, color); + plot(object, ++x, y += step, reverse, color); + /* pattern 4 backwards */ + plot(object, x1, y1 -= step, reverse, color); + plot(object, --x1, y1 -= step, reverse, color); + D += incr1; + } else { + if (D < c) { + /* pattern 2 forwards */ + plot(object, x, y, reverse, color); + plot(object, ++x, y += step, reverse, + color); + + /* pattern 2 backwards */ + plot(object, x1, y1, reverse, color); + plot(object, --x1, y1 -= step, reverse, + color); + } else { + /* pattern 3 forwards */ + plot(object, x, y += step, reverse, color); + plot(object, ++x, y, reverse, color); + /* pattern 3 backwards */ + plot(object, x1, y1 -= step, reverse, color); + plot(object, --x1, y1, reverse, color); + } + D += incr2; + } + } /* end for */ + /* plot last pattern */ + if (pixels_left) { + if (D > 0) { + plot(object, ++x, y += step, reverse, color); /* pattern 4 */ + if (pixels_left > 1) + plot(object, ++x, y += step, reverse, + color); + if (pixels_left > 2) + plot(object, --x1, y1 -= step, reverse, + color); + } else { + if (D < c) { + plot(object, ++x, y, reverse, color); /* pattern 2 */ + if (pixels_left > 1) + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1, reverse, color); + } else { + /* pattern 3 */ + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 1) + plot(object, ++x, y, reverse, color); + if (pixels_left > 2) { + if (D > c) /* step 3 */ + plot(object, --x1, y1 -= step, reverse, color); + else /* step 2 */ + plot(object, --x1, y1, reverse, color); + } + } } - y += sy; d += ax; } } } From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 20:17:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 431A4106566B; Tue, 3 Jan 2012 20:17:36 +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 327908FC12; Tue, 3 Jan 2012 20:17: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 q03KHaOV040725; Tue, 3 Jan 2012 20:17:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03KHZ0Z040723; Tue, 3 Jan 2012 20:17:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201032017.q03KHZ0Z040723@svn.freebsd.org> From: Xin LI Date: Tue, 3 Jan 2012 20:17: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: r229416 - head/sys/dev/tws X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:17:36 -0000 Author: delphij Date: Tue Jan 3 20:17:35 2012 New Revision: 229416 URL: http://svn.freebsd.org/changeset/base/229416 Log: Don't forget to release queue lock when allocation of memory failed. Submitted by: Sascha Wildner Obtained from: DragonFly MFC after: 2 weeks Modified: head/sys/dev/tws/tws.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Tue Jan 3 19:47:32 2012 (r229415) +++ head/sys/dev/tws/tws.c Tue Jan 3 20:17:35 2012 (r229416) @@ -685,6 +685,7 @@ tws_init_reqs(struct tws_softc *sc, u_in { if (bus_dmamap_create(sc->data_tag, 0, &sc->reqs[i].dma_map)) { /* log a ENOMEM failure msg here */ + mtx_unlock(&sc->q_lock); return(FAILURE); } sc->reqs[i].cmd_pkt = &cmd_buf[i]; From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 20:34:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48C9F106564A; Tue, 3 Jan 2012 20:34:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C72A8FC0A; Tue, 3 Jan 2012 20:34: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 q03KYrC2041609; Tue, 3 Jan 2012 20:34:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03KYrrb041606; Tue, 3 Jan 2012 20:34:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201032034.q03KYrrb041606@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jan 2012 20:34: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: r229420 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:34:53 -0000 Author: jhb Date: Tue Jan 3 20:34:52 2012 New Revision: 229420 URL: http://svn.freebsd.org/changeset/base/229420 Log: When cancelling multicast timers on an interface, don't release the reference on a group in the leaving state while iterating over the loop. Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach() of placing the groups to free on pending release list and then releasing the references after dropping the IF_ADDR_LOCK. This closes an ugly race where the code was dropping the lock in the middle of iterating over the list. It also fixes some additional potential use-after-free bugs since the cancellation routine also applied other changes to the group after dropping the reference. Now those changes are performed before the reference is dropped and the group is potentially freed. Prodded to fix by: glebius Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet/igmp.c head/sys/netinet6/mld6.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Jan 3 20:28:17 2012 (r229419) +++ head/sys/netinet/igmp.c Tue Jan 3 20:34:52 2012 (r229420) @@ -2003,7 +2003,7 @@ igmp_v3_cancel_link_timers(struct igmp_i { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct in_multi *inm; + struct in_multi *inm, *tinm; CTR3(KTR_IGMPV3, "%s: cancel v3 timers on ifp %p(%s)", __func__, igi->igi_ifp, igi->igi_ifp->if_xname); @@ -2049,14 +2049,8 @@ igmp_v3_cancel_link_timers(struct igmp_i * transition to REPORTING to ensure the host leave * message is sent upstream to the old querier -- * transition to NOT would lose the leave and race. - * - * SMPNG: Must drop and re-acquire IF_ADDR_LOCK - * around inm_release_locked(), as it is not - * a recursive mutex. */ - IF_ADDR_UNLOCK(ifp); - inm_release_locked(inm); - IF_ADDR_LOCK(ifp); + SLIST_INSERT_HEAD(&igi->igi_relinmhead, inm, inm_nrele); /* FALLTHROUGH */ case IGMP_G_QUERY_PENDING_MEMBER: case IGMP_SG_QUERY_PENDING_MEMBER: @@ -2075,6 +2069,10 @@ igmp_v3_cancel_link_timers(struct igmp_i _IF_DRAIN(&inm->inm_scq); } IF_ADDR_UNLOCK(ifp); + SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { + SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele); + inm_release_locked(inm); + } } /* Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue Jan 3 20:28:17 2012 (r229419) +++ head/sys/netinet6/mld6.c Tue Jan 3 20:34:52 2012 (r229420) @@ -1656,7 +1656,7 @@ mld_v2_cancel_link_timers(struct mld_ifi { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct in6_multi *inm; + struct in6_multi *inm, *tinm; CTR3(KTR_MLD, "%s: cancel v2 timers on ifp %p(%s)", __func__, mli->mli_ifp, mli->mli_ifp->if_xname); @@ -1695,14 +1695,9 @@ mld_v2_cancel_link_timers(struct mld_ifi * If we are leaving the group and switching * version, we need to release the final * reference held for issuing the INCLUDE {}. - * - * SMPNG: Must drop and re-acquire IF_ADDR_LOCK - * around in6m_release_locked(), as it is not - * a recursive mutex. */ - IF_ADDR_UNLOCK(ifp); - in6m_release_locked(inm); - IF_ADDR_LOCK(ifp); + SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm, + in6m_nrele); /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: case MLD_SG_QUERY_PENDING_MEMBER: @@ -1720,6 +1715,10 @@ mld_v2_cancel_link_timers(struct mld_ifi } } IF_ADDR_UNLOCK(ifp); + SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, in6m_nrele, tinm) { + SLIST_REMOVE_HEAD(&mli->mli_relinmhead, in6m_nrele); + in6m_release_locked(inm); + } } /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 20:51:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97F941065672; Tue, 3 Jan 2012 20:51:26 +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 8727F8FC16; Tue, 3 Jan 2012 20:51: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 q03KpQ9n042433; Tue, 3 Jan 2012 20:51:26 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03KpQrj042431; Tue, 3 Jan 2012 20:51:26 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201032051.q03KpQrj042431@svn.freebsd.org> From: Dimitry Andric Date: Tue, 3 Jan 2012 20:51: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: r229423 - head/sys/dev/qlxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:51:26 -0000 Author: dim Date: Tue Jan 3 20:51:26 2012 New Revision: 229423 URL: http://svn.freebsd.org/changeset/base/229423 Log: In sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue. Clang complained the variable 'val' was uninitialized when used. Instead, 'sig' should have been printed. Reviewed by: davidcs MFC after: 1 week Modified: head/sys/dev/qlxgb/qla_misc.c Modified: head/sys/dev/qlxgb/qla_misc.c ============================================================================== --- head/sys/dev/qlxgb/qla_misc.c Tue Jan 3 20:50:48 2012 (r229422) +++ head/sys/dev/qlxgb/qla_misc.c Tue Jan 3 20:51:26 2012 (r229423) @@ -407,7 +407,7 @@ qla_crb_init(qla_host_t *ha) addr_val_t *addr_val_map, *avmap; qla_rd_flash32(ha, 0, &sig); - QL_DPRINT2((ha->pci_dev, "%s: val[0] = 0x%08x\n", __func__, val)); + QL_DPRINT2((ha->pci_dev, "%s: val[0] = 0x%08x\n", __func__, sig)); qla_rd_flash32(ha, 4, &val); QL_DPRINT2((ha->pci_dev, "%s: val[4] = 0x%08x\n", __func__, val)); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 20:53:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18AE106564A; Tue, 3 Jan 2012 20:53:07 +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 9052B8FC14; Tue, 3 Jan 2012 20:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03Kr7SP042562; Tue, 3 Jan 2012 20:53:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03Kr7de042560; Tue, 3 Jan 2012 20:53:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201032053.q03Kr7de042560@svn.freebsd.org> From: Dimitry Andric Date: Tue, 3 Jan 2012 20:53: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: r229425 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:53:07 -0000 Author: dim Date: Tue Jan 3 20:53:07 2012 New Revision: 229425 URL: http://svn.freebsd.org/changeset/base/229425 Log: In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the the number of links against LINK_MAX (which is INT16_MAX), not against UINT32_MAX. Otherwise, the constant would implicitly be converted to -1. Reviewed by: pjd MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jan 3 20:52:05 2012 (r229424) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jan 3 20:53:07 2012 (r229425) @@ -2698,7 +2698,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i links = zp->z_links + 1; else links = zp->z_links; - vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */ + vap->va_nlink = MIN(links, LINK_MAX); /* nlink_t limit! */ vap->va_size = zp->z_size; #ifdef sun vap->va_rdev = vp->v_rdev; From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 20:53:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29E6F106568F; Tue, 3 Jan 2012 20:53:59 +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 F322D8FC14; Tue, 3 Jan 2012 20:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03KrwW5042661; Tue, 3 Jan 2012 20:53:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03KrwAk042659; Tue, 3 Jan 2012 20:53:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201032053.q03KrwAk042659@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jan 2012 20:53: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: r229427 - head/sys/x86/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:53:59 -0000 Author: jhb Date: Tue Jan 3 20:53:58 2012 New Revision: 229427 URL: http://svn.freebsd.org/changeset/base/229427 Log: Fix a few bugs in the SRAT parsing code: - Actually increment ndomain when building our list of known domains so that we can properly renumber them to be 0-based and dense. - If the number of domains exceeds the configured maximum (VM_NDOMAIN), bail out of processing the SRAT and disable NUMA rather than hitting an obscure panic later. - Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to disable NUMA (the default). Reported by: phk (2) MFC after: 1 week Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Tue Jan 3 20:53:16 2012 (r229426) +++ head/sys/x86/acpica/srat.c Tue Jan 3 20:53:58 2012 (r229427) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include +#if VM_NDOMAIN > 1 struct cpu_info { int enabled:1; int has_memory:1; @@ -237,9 +238,9 @@ check_phys_avail(void) /* * Renumber the memory domains to be compact and zero-based if not - * already. + * already. Returns an error if there are too many domains. */ -static void +static int renumber_domains(void) { int domains[VM_PHYSSEG_MAX]; @@ -261,6 +262,11 @@ renumber_domains(void) for (j = ndomain; j > slot; j--) domains[j] = domains[j - 1]; domains[slot] = mem_info[i].domain; + ndomain++; + if (ndomain > VM_NDOMAIN) { + printf("SRAT: Too many memory domains\n"); + return (EFBIG); + } } /* Renumber each domain to its index in the sorted 'domains' list. */ @@ -280,6 +286,7 @@ renumber_domains(void) if (cpus[j].enabled && cpus[j].domain == domains[i]) cpus[j].domain = i; } + return (0); } /* @@ -306,13 +313,12 @@ parse_srat(void *dummy) srat_walk_table(srat_parse_entry, &error); acpi_unmap_table(srat); srat = NULL; - if (error || check_domains() != 0 || check_phys_avail() != 0) { + if (error || check_domains() != 0 || check_phys_avail() != 0 || + renumber_domains() != 0) { srat_physaddr = 0; return; } - renumber_domains(); - /* Point vm_phys at our memory affinity table. */ mem_affinity = mem_info; } @@ -354,3 +360,4 @@ srat_set_cpus(void *dummy) } } SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); +#endif /* VM_NDOMAIN > 1 */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 21:03:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A87D106567D; Tue, 3 Jan 2012 21:03:21 +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 39A808FC1F; Tue, 3 Jan 2012 21:03: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 q03L3LQA043031; Tue, 3 Jan 2012 21:03:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03L3Lan043029; Tue, 3 Jan 2012 21:03:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201032103.q03L3Lan043029@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 3 Jan 2012 21:03: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: r229428 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 21:03:21 -0000 Author: kib Date: Tue Jan 3 21:03:20 2012 New Revision: 229428 URL: http://svn.freebsd.org/changeset/base/229428 Log: Document the state of the lowervp vnode for null_nodeget(). Tested by: pho MFC after: 1 week Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Tue Jan 3 20:53:58 2012 (r229427) +++ head/sys/fs/nullfs/null_subr.c Tue Jan 3 21:03:20 2012 (r229428) @@ -198,6 +198,9 @@ null_nodeget(mp, lowervp, vpp) struct vnode *vp; int error; + ASSERT_VOP_LOCKED(lowervp, "lowervp"); + KASSERT(lowervp->v_usecount >= 1, ("Unreferenced vnode %p\n", vp)); + /* Lookup the hash firstly */ *vpp = null_hashget(mp, lowervp); if (*vpp != NULL) { From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 21:03:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C22AD10657C9; Tue, 3 Jan 2012 21:03:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1758FC0A; Tue, 3 Jan 2012 21:03: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 q03L3SIt043073; Tue, 3 Jan 2012 21:03:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03L3SSQ043069; Tue, 3 Jan 2012 21:03:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201032103.q03L3SSQ043069@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jan 2012 21:03: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: r229429 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 21:03:29 -0000 Author: jhb Date: Tue Jan 3 21:03:28 2012 New Revision: 229429 URL: http://svn.freebsd.org/changeset/base/229429 Log: Some small fixes to CPU accounting for threads: - Only initialize the per-cpu switchticks and switchtime in sched_throw() for the very first context switch on APs during boot. This avoids a small gap between the middle of thread_exit() and sched_throw() where time is not accounted to any thread. - In thread_exit(), update the timestamp bookkeeping to track the changes to mi_switch() introduced by td_rux so that the code once again matches the comment claiming it is mimicing mi_switch(). Specifically, only update the per-thread stats directly and depend on ruxagg() to update p_rux rather than adjusting p_rux directly. While here, move the timestamp bookkeeping as late in the function as possible. Reviewed by: bde, kib MFC after: 1 week Modified: head/sys/kern/kern_thread.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Jan 3 21:03:20 2012 (r229428) +++ head/sys/kern/kern_thread.c Tue Jan 3 21:03:28 2012 (r229429) @@ -381,7 +381,7 @@ thread_free(struct thread *td) void thread_exit(void) { - uint64_t new_switchtime; + uint64_t runtime, new_switchtime; struct thread *td; struct thread *td2; struct proc *p; @@ -410,15 +410,6 @@ thread_exit(void) */ cpu_thread_exit(td); /* XXXSMP */ - /* Do the same timestamp bookkeeping that mi_switch() would do. */ - new_switchtime = cpu_ticks(); - p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime)); - PCPU_SET(switchtime, new_switchtime); - PCPU_SET(switchticks, ticks); - PCPU_INC(cnt.v_swtch); - /* Save our resource usage in our process. */ - td->td_ru.ru_nvcsw++; - rucollect(&p->p_ru, &td->td_ru); /* * The last thread is left attached to the process * So that the whole bundle gets recycled. Skip @@ -467,7 +458,21 @@ thread_exit(void) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif PROC_UNLOCK(p); + + /* Do the same timestamp bookkeeping that mi_switch() would do. */ + new_switchtime = cpu_ticks(); + runtime = new_switchtime - PCPU_GET(switchtime); + td->td_runtime += runtime; + td->td_incruntime += runtime; + PCPU_SET(switchtime, new_switchtime); + PCPU_SET(switchticks, ticks); + PCPU_INC(cnt.v_swtch); + + /* Save our resource usage in our process. */ + td->td_ru.ru_nvcsw++; ruxagg(p, td); + rucollect(&p->p_ru, &td->td_ru); + thread_lock(td); PROC_SUNLOCK(p); td->td_state = TDS_INACTIVE; Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Tue Jan 3 21:03:20 2012 (r229428) +++ head/sys/kern/sched_4bsd.c Tue Jan 3 21:03:28 2012 (r229429) @@ -1572,14 +1572,14 @@ sched_throw(struct thread *td) if (td == NULL) { mtx_lock_spin(&sched_lock); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { lock_profile_release_lock(&sched_lock.lock_object); MPASS(td->td_lock == &sched_lock); } mtx_assert(&sched_lock, MA_OWNED); KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, choosethread()); /* doesn't return */ } Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Jan 3 21:03:20 2012 (r229428) +++ head/sys/kern/sched_ule.c Tue Jan 3 21:03:28 2012 (r229429) @@ -2587,6 +2587,8 @@ sched_throw(struct thread *td) /* Correct spinlock nesting and acquire the correct lock. */ TDQ_LOCK(tdq); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); @@ -2595,8 +2597,6 @@ sched_throw(struct thread *td) KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, newtd); /* doesn't return */ } From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 21:04:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 975FC1065678; Tue, 3 Jan 2012 21:04:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845F28FC22; Tue, 3 Jan 2012 21:04:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03L4sPO043163; Tue, 3 Jan 2012 21:04:54 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03L4sTm043158; Tue, 3 Jan 2012 21:04:54 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201032104.q03L4sTm043158@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 3 Jan 2012 21:04: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: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 21:04:54 -0000 Author: pfg Date: Tue Jan 3 21:04:54 2012 New Revision: 229430 URL: http://svn.freebsd.org/changeset/base/229430 Log: Replace a GPL'd header in the emu10k1 snd driver code. This brings in the emuxkireg.h from NetBSD (dev/pci) which is used for the same purpose but is smaller. The emu10k1 is now free from the GPL. PR: 153901 Obtained from: NetBSD Approved by: core (mentor implicit) MFC after: 2 weeks Added: head/sys/dev/sound/pci/emuxkireg.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/sound/pci/emu10k1.c head/sys/modules/sound/driver/emu10k1/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 3 21:03:28 2012 (r229429) +++ head/sys/conf/files Tue Jan 3 21:04:54 2012 (r229430) @@ -50,7 +50,7 @@ aic79xx_reg_print.c optional ahd pci aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local -emu10k1-alsa%diked.h optional snd_emu10k1 | snd_emu10kx \ +emu10k1-alsa%diked.h optional snd_emu10kx \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ @@ -1732,9 +1732,7 @@ dev/sound/pci/csa.c optional snd_csa pc warning "kernel contains GPL contaminated csaimg.h header" dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci -dev/sound/pci/emu10k1.c optional snd_emu10k1 pci \ - dependency "emu10k1-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10k1 headers" +dev/sound/pci/emu10k1.c optional snd_emu10k1 pci dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ dependency "emu10k1-alsa%diked.h" \ dependency "p16v-alsa%diked.h" \ Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Tue Jan 3 21:03:28 2012 (r229429) +++ head/sys/dev/sound/pci/emu10k1.c Tue Jan 3 21:04:54 2012 (r229430) @@ -32,7 +32,7 @@ #include #include -#include "emu10k1-alsa%diked.h" +#include #include #include @@ -66,12 +66,94 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ENABLE 0xffffffff #define DISABLE 0x00000000 -#define ENV_ON DCYSUSV_CHANNELENABLE_MASK +#define ENV_ON EMU_CHAN_DCYSUSV_CHANNELENABLE_MASK #define ENV_OFF 0x00 /* XXX: should this be 1? */ -#define A_IOCFG_GPOUT_A 0x40 /* Analog Output */ -#define A_IOCFG_GPOUT_D 0x04 /* Digital Output */ -#define A_IOCFG_GPOUT_AD (A_IOCFG_GPOUT_A|A_IOCFG_GPOUT_D) /* A_IOCFG_GPOUT0 */ +#define EMU_A_IOCFG_GPOUT_A 0x40 +#define EMU_A_IOCFG_GPOUT_D 0x04 +#define EMU_A_IOCFG_GPOUT_AD (EMU_A_IOCFG_GPOUT_A|EMU_A_IOCFG_GPOUT_D) /* EMU_A_IOCFG_GPOUT0 */ + +#define EMU_HCFG_GPOUT1 0x00000800 + +/* instruction set */ +#define iACC3 0x06 +#define iMACINT0 0x04 +#define iINTERP 0x0e + +#define C_00000000 0x40 +#define C_00000001 0x41 +#define C_00000004 0x44 +#define C_40000000 0x4d +/* Audigy constants */ +#define A_C_00000000 0xc0 +#define A_C_40000000 0xcd + +/* GPRs */ +#define FXBUS(x) (0x00 + (x)) +#define EXTIN(x) (0x10 + (x)) +#define EXTOUT(x) (0x20 + (x)) + +#define GPR(x) (EMU_FXGPREGBASE + (x)) +#define A_EXTIN(x) (0x40 + (x)) +#define A_FXBUS(x) (0x00 + (x)) +#define A_EXTOUT(x) (0x60 + (x)) +#define A_GPR(x) (EMU_A_FXGPREGBASE + (x)) + +/* FX buses */ +#define FXBUS_PCM_LEFT 0x00 +#define FXBUS_PCM_RIGHT 0x01 +#define FXBUS_MIDI_LEFT 0x04 +#define FXBUS_MIDI_RIGHT 0x05 +#define FXBUS_MIDI_REVERB 0x0c +#define FXBUS_MIDI_CHORUS 0x0d + +/* Inputs */ +#define EXTIN_AC97_L 0x00 +#define EXTIN_AC97_R 0x01 +#define EXTIN_SPDIF_CD_L 0x02 +#define EXTIN_SPDIF_CD_R 0x03 +#define EXTIN_TOSLINK_L 0x06 +#define EXTIN_TOSLINK_R 0x07 +#define EXTIN_COAX_SPDIF_L 0x0a +#define EXTIN_COAX_SPDIF_R 0x0b +/* Audigy Inputs */ +#define A_EXTIN_AC97_L 0x00 +#define A_EXTIN_AC97_R 0x01 + +/* Outputs */ +#define EXTOUT_AC97_L 0x00 +#define EXTOUT_AC97_R 0x01 +#define EXTOUT_TOSLINK_L 0x02 +#define EXTOUT_TOSLINK_R 0x03 +#define EXTOUT_AC97_CENTER 0x04 +#define EXTOUT_AC97_LFE 0x05 +#define EXTOUT_HEADPHONE_L 0x06 +#define EXTOUT_HEADPHONE_R 0x07 +#define EXTOUT_REAR_L 0x08 +#define EXTOUT_REAR_R 0x09 +#define EXTOUT_ADC_CAP_L 0x0a +#define EXTOUT_ADC_CAP_R 0x0b +#define EXTOUT_ACENTER 0x11 +#define EXTOUT_ALFE 0x12 +/* Audigy Outputs */ +#define A_EXTOUT_FRONT_L 0x00 +#define A_EXTOUT_FRONT_R 0x01 +#define A_EXTOUT_CENTER 0x02 +#define A_EXTOUT_LFE 0x03 +#define A_EXTOUT_HEADPHONE_L 0x04 +#define A_EXTOUT_HEADPHONE_R 0x05 +#define A_EXTOUT_REAR_L 0x06 +#define A_EXTOUT_REAR_R 0x07 +#define A_EXTOUT_AFRONT_L 0x08 +#define A_EXTOUT_AFRONT_R 0x09 +#define A_EXTOUT_ACENTER 0x0a +#define A_EXTOUT_ALFE 0x0b +#define A_EXTOUT_AREAR_L 0x0e +#define A_EXTOUT_AREAR_R 0x0f +#define A_EXTOUT_AC97_L 0x10 +#define A_EXTOUT_AC97_R 0x11 +#define A_EXTOUT_ADC_CAP_L 0x16 +#define A_EXTOUT_ADC_CAP_R 0x17 struct emu_memblk { SLIST_ENTRY(emu_memblk) link; @@ -247,9 +329,9 @@ emu_rdptr(struct sc_info *sc, int chn, i { u_int32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); - emu_wr(sc, PTR, ptr, 4); - val = emu_rd(sc, DATA, 4); + ptr = ((reg << 16) & sc->addrmask) | (chn & EMU_PTR_CHNO_MASK); + emu_wr(sc, EMU_PTR, ptr, 4); + val = emu_rd(sc, EMU_DATA, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; offset = (reg >> 16) & 0x1f; @@ -265,23 +347,23 @@ emu_wrptr(struct sc_info *sc, int chn, i { u_int32_t ptr, mask, size, offset; - ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); - emu_wr(sc, PTR, ptr, 4); + ptr = ((reg << 16) & sc->addrmask) | (chn & EMU_PTR_CHNO_MASK); + emu_wr(sc, EMU_PTR, ptr, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; offset = (reg >> 16) & 0x1f; mask = ((1 << size) - 1) << offset; data <<= offset; data &= mask; - data |= emu_rd(sc, DATA, 4) & ~mask; + data |= emu_rd(sc, EMU_DATA, 4) & ~mask; } - emu_wr(sc, DATA, data, 4); + emu_wr(sc, EMU_DATA, data, 4); } static void emu_wrefx(struct sc_info *sc, unsigned int pc, unsigned int data) { - pc += sc->audigy ? A_MICROCODEBASE : MICROCODEBASE; + pc += sc->audigy ? EMU_A_MICROCODEBASE : EMU_MICROCODEBASE; emu_wrptr(sc, 0, pc, data); } @@ -294,8 +376,8 @@ emu_rdcd(kobj_t obj, void *devinfo, int { struct sc_info *sc = (struct sc_info *)devinfo; - emu_wr(sc, AC97ADDRESS, regno, 1); - return emu_rd(sc, AC97DATA, 2); + emu_wr(sc, EMU_AC97ADDR, regno, 1); + return emu_rd(sc, EMU_AC97DATA, 2); } static int @@ -303,8 +385,8 @@ emu_wrcd(kobj_t obj, void *devinfo, int { struct sc_info *sc = (struct sc_info *)devinfo; - emu_wr(sc, AC97ADDRESS, regno, 1); - emu_wr(sc, AC97DATA, data, 2); + emu_wr(sc, EMU_AC97ADDR, regno, 1); + emu_wr(sc, EMU_AC97DATA, data, 2); return 0; } @@ -346,7 +428,7 @@ emu_settimer(struct sc_info *sc) } RANGE(rate, 48, 9600); sc->timerinterval = 48000 / rate; - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); return sc->timerinterval; } @@ -357,15 +439,15 @@ emu_enatimer(struct sc_info *sc, int go) u_int32_t x; if (go) { if (sc->timer++ == 0) { - x = emu_rd(sc, INTE, 4); - x |= INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x |= EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } } else { sc->timer = 0; - x = emu_rd(sc, INTE, 4); - x &= ~INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x &= ~EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } return 0; } @@ -373,7 +455,7 @@ emu_enatimer(struct sc_info *sc, int go) static void emu_enastop(struct sc_info *sc, char channel, int enable) { - int reg = (channel & 0x20) ? SOLEH : SOLEL; + int reg = (channel & 0x20) ? EMU_SOLEH : EMU_SOLEL; channel &= 0x1f; reg |= 1 << 24; reg |= channel << 16; @@ -568,49 +650,49 @@ emu_vwrite(struct sc_info *sc, struct em r = v->ismaster ? 0 : r; } - emu_wrptr(sc, v->vnum, CPF, v->stereo ? CPF_STEREO_MASK : 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, v->stereo ? EMU_CHAN_CPF_STEREO_MASK : 0); val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = sa + val; if (sc->audigy) { - emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1); - emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2); - emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT1, v->fxrt1); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT2, v->fxrt2); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_SENDAMOUNTS, 0); } else - emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16); + emu_wrptr(sc, v->vnum, EMU_CHAN_FXRT, v->fxrt1 << 16); - emu_wrptr(sc, v->vnum, PTRX, (x << 8) | r); - emu_wrptr(sc, v->vnum, DSL, ea | (y << 24)); - emu_wrptr(sc, v->vnum, PSST, sa | (l << 24)); - emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX, (x << 8) | r); + emu_wrptr(sc, v->vnum, EMU_CHAN_DSL, ea | (y << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PSST, sa | (l << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCCA, start | (v->b16 ? 0 : EMU_CHAN_CCCA_8BITSELECT)); - emu_wrptr(sc, v->vnum, Z1, 0); - emu_wrptr(sc, v->vnum, Z2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z1, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z2, 0); silent_page = ((u_int32_t)(sc->mem.silent_page_addr) << 1) - | MAP_PTI_MASK; - emu_wrptr(sc, v->vnum, MAPA, silent_page); - emu_wrptr(sc, v->vnum, MAPB, silent_page); - - emu_wrptr(sc, v->vnum, CVCF, CVCF_CURRENTFILTER_MASK); - emu_wrptr(sc, v->vnum, VTFT, VTFT_FILTERTARGET_MASK); - emu_wrptr(sc, v->vnum, ATKHLDM, 0); - emu_wrptr(sc, v->vnum, DCYSUSM, DCYSUSM_DECAYTIME_MASK); - emu_wrptr(sc, v->vnum, LFOVAL1, 0x8000); - emu_wrptr(sc, v->vnum, LFOVAL2, 0x8000); - emu_wrptr(sc, v->vnum, FMMOD, 0); - emu_wrptr(sc, v->vnum, TREMFRQ, 0); - emu_wrptr(sc, v->vnum, FM2FRQ2, 0); - emu_wrptr(sc, v->vnum, ENVVAL, 0x8000); - - emu_wrptr(sc, v->vnum, ATKHLDV, - ATKHLDV_HOLDTIME_MASK | ATKHLDV_ATTACKTIME_MASK); - emu_wrptr(sc, v->vnum, ENVVOL, 0x8000); + | EMU_CHAN_MAP_PTI_MASK; + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPA, silent_page); + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPB, silent_page); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, EMU_CHAN_CVCF_CURRFILTER_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, EMU_CHAN_VTFT_FILTERTARGET_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSM, EMU_CHAN_DCYSUSM_DECAYTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL1, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL2, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_TREMFRQ, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_FM2FRQ2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVAL, 0x8000); + + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDV, + EMU_CHAN_ATKHLDV_HOLDTIME_MASK | EMU_CHAN_ATKHLDV_ATTACKTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVOL, 0x8000); - emu_wrptr(sc, v->vnum, PEFE_FILTERAMOUNT, 0x7f); - emu_wrptr(sc, v->vnum, PEFE_PITCHAMOUNT, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_FILTERAMOUNT, 0x7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_PITCHAMOUNT, 0); if (v->slave != NULL) emu_vwrite(sc, v->slave); @@ -631,29 +713,29 @@ emu_vtrigger(struct sc_info *sc, struct sample = v->b16 ? 0x00000000 : 0x80808080; for (i = 0; i < cs; i++) - emu_wrptr(sc, v->vnum, CD0 + i, sample); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, 0); - emu_wrptr(sc, v->vnum, CCR_READADDRESS, cra); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, ccis); - - emu_wrptr(sc, v->vnum, IFATN, 0xff00); - emu_wrptr(sc, v->vnum, VTFT, 0xffffffff); - emu_wrptr(sc, v->vnum, CVCF, 0xffffffff); - emu_wrptr(sc, v->vnum, DCYSUSV, 0x00007f7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_CD0 + i, sample); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_READADDRESS, cra); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, ccis); + + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xff00); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSV, 0x00007f7f); emu_enastop(sc, v->vnum, 0); pitch_target = emu_rate_to_linearpitch(v->speed); initial_pitch = emu_rate_to_pitch(v->speed) >> 8; - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, pitch_target); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, pitch_target); - emu_wrptr(sc, v->vnum, IP, initial_pitch); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, initial_pitch); } else { - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, 0); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, 0); - emu_wrptr(sc, v->vnum, IFATN, 0xffff); - emu_wrptr(sc, v->vnum, VTFT, 0x0000ffff); - emu_wrptr(sc, v->vnum, CVCF, 0x0000ffff); - emu_wrptr(sc, v->vnum, IP, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, 0); emu_enastop(sc, v->vnum, 1); } if (v->slave != NULL) @@ -666,7 +748,7 @@ emu_vpos(struct sc_info *sc, struct emu_ int s, ptr; s = (v->b16 ? 1 : 0) + (v->stereo ? 1 : 0); - ptr = (emu_rdptr(sc, v->vnum, CCCA_CURRADDR) - (v->start >> s)) << s; + ptr = (emu_rdptr(sc, v->vnum, EMU_CHAN_CCCA_CURRADDR) - (v->start >> s)) << s; return ptr & ~0x0000001f; } @@ -875,27 +957,27 @@ emurchan_init(kobj_t obj, void *devinfo, ch->num = sc->rnum; switch(sc->rnum) { case 0: - ch->idxreg = sc->audigy ? A_ADCIDX : ADCIDX; - ch->basereg = ADCBA; - ch->sizereg = ADCBS; - ch->setupreg = ADCCR; - ch->irqmask = INTE_ADCBUFENABLE; + ch->idxreg = sc->audigy ? EMU_A_ADCIDX : EMU_ADCIDX; + ch->basereg = EMU_ADCBA; + ch->sizereg = EMU_ADCBS; + ch->setupreg = EMU_ADCCR; + ch->irqmask = EMU_INTE_ADCBUFENABLE; break; case 1: - ch->idxreg = FXIDX; - ch->basereg = FXBA; - ch->sizereg = FXBS; - ch->setupreg = FXWC; - ch->irqmask = INTE_EFXBUFENABLE; + ch->idxreg = EMU_FXIDX; + ch->basereg = EMU_FXBA; + ch->sizereg = EMU_FXBS; + ch->setupreg = EMU_FXWC; + ch->irqmask = EMU_INTE_EFXBUFENABLE; break; case 2: - ch->idxreg = MICIDX; - ch->basereg = MICBA; - ch->sizereg = MICBS; + ch->idxreg = EMU_MICIDX; + ch->basereg = EMU_MICBA; + ch->sizereg = EMU_MICBS; ch->setupreg = 0; - ch->irqmask = INTE_MICBUFENABLE; + ch->irqmask = EMU_INTE_MICBUFENABLE; break; } sc->rnum++; @@ -967,27 +1049,27 @@ emurchan_trigger(kobj_t obj, void *data, switch(sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -997,23 +1079,23 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, sz); if (ch->num == 0) { if (sc->audigy) { - val = A_ADCCR_LCHANENABLE; + val = EMU_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= A_ADCCR_RCHANENABLE; + val |= EMU_ADCCR_RCHANENABLE; val |= audigy_recval(ch->spd); } else { - val = ADCCR_LCHANENABLE; + val = EMU_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= ADCCR_RCHANENABLE; + val |= EMU_ADCCR_RCHANENABLE; val |= emu_recval(ch->spd); } emu_wrptr(sc, 0, ch->setupreg, 0); emu_wrptr(sc, 0, ch->setupreg, val); } - val = emu_rd(sc, INTE, 4); + val = emu_rd(sc, EMU_INTE, 4); val |= ch->irqmask; - emu_wr(sc, INTE, val, 4); + emu_wr(sc, EMU_INTE, val, 4); break; case PCMTRIG_STOP: @@ -1022,9 +1104,9 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, 0); if (ch->setupreg) emu_wrptr(sc, 0, ch->setupreg, 0); - val = emu_rd(sc, INTE, 4); + val = emu_rd(sc, EMU_INTE, 4); val &= ~ch->irqmask; - emu_wr(sc, INTE, val, 4); + emu_wr(sc, EMU_INTE, val, 4); break; case PCMTRIG_EMLDMAWR: @@ -1122,9 +1204,9 @@ emu_midiattach(struct sc_info *sc) { int i; - i = emu_rd(sc, INTE, 4); - i |= INTE_MIDIRXENABLE; - emu_wr(sc, INTE, i, 4); + i = emu_rd(sc, EMU_INTE, 4); + i |= EMU_INTE_MIDIRXENABLE; + emu_wr(sc, EMU_INTE, i, 4); sc->mpu = mpu401_init(&emu_mpu_class, sc, emu_intr2, &sc->mpu_intr); } @@ -1139,52 +1221,52 @@ emu_intr(void *data) snd_mtxlock(sc->lock); while (1) { - stat = emu_rd(sc, IPR, 4); + stat = emu_rd(sc, EMU_IPR, 4); if (stat == 0) break; ack = 0; /* process irq */ - if (stat & IPR_INTERVALTIMER) - ack |= IPR_INTERVALTIMER; + if (stat & EMU_IPR_INTERVALTIMER) + ack |= EMU_IPR_INTERVALTIMER; - if (stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) - ack |= stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL); + if (stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) + ack |= stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL); - if (stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) - ack |= stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL); + if (stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) + ack |= stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL); - if (stat & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL)) - ack |= stat & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL); + if (stat & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL)) + ack |= stat & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL); - if (stat & IPR_PCIERROR) { - ack |= IPR_PCIERROR; + if (stat & EMU_PCIERROR) { + ack |= EMU_PCIERROR; device_printf(sc->dev, "pci error\n"); /* we still get an nmi with ecc ram even if we ack this */ } - if (stat & IPR_SAMPLERATETRACKER) { - ack |= IPR_SAMPLERATETRACKER; + if (stat & EMU_IPR_RATETRCHANGE) { + ack |= EMU_IPR_RATETRCHANGE; #ifdef EMUDEBUG device_printf(sc->dev, "sample rate tracker lock status change\n"); #endif } - if (stat & IPR_MIDIRECVBUFEMPTY) + if (stat & EMU_IPR_MIDIRECVBUFE) if (sc->mpu_intr) { (sc->mpu_intr)(sc->mpu); - ack |= IPR_MIDIRECVBUFEMPTY | IPR_MIDITRANSBUFEMPTY; + ack |= EMU_IPR_MIDIRECVBUFE | EMU_IPR_MIDITRANSBUFE; } if (stat & ~ack) device_printf(sc->dev, "dodgy irq: %x (harmless)\n", stat & ~ack); - emu_wr(sc, IPR, stat, 4); + emu_wr(sc, EMU_IPR, stat, 4); if (ack) { snd_mtxunlock(sc->lock); - if (ack & IPR_INTERVALTIMER) { + if (ack & EMU_IPR_INTERVALTIMER) { x = 0; for (i = 0; i < sc->nchans; i++) { if (sc->pch[i].run) { @@ -1197,15 +1279,15 @@ emu_intr(void *data) } - if (ack & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) { + if (ack & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) { if (sc->rch[0].channel) chn_intr(sc->rch[0].channel); } - if (ack & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) { + if (ack & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) { if (sc->rch[1].channel) chn_intr(sc->rch[1].channel); } - if (ack & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL)) { + if (ack & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL)) { if (sc->rch[2].channel) chn_intr(sc->rch[2].channel); } @@ -1378,12 +1460,12 @@ audigy_initefx(struct sc_info *sc) audigy_addefxop(sc, 0x0f, 0x0c0, 0x0c0, 0x0cf, 0x0c0, &pc); for (i = 0; i < 512; i++) - emu_wrptr(sc, 0, A_FXGPREGBASE + i, 0x0); + emu_wrptr(sc, 0, EMU_A_FXGPREGBASE + i, 0x0); pc = 16; /* stop fx processor */ - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); /* Audigy 2 (EMU10K2) DSP Registers: FX Bus @@ -1518,7 +1600,7 @@ audigy_initefx(struct sc_info *sc) A_C_00000000, A_EXTIN(A_EXTIN_AC97_R), &pc); /* resume normal operations */ - emu_wrptr(sc, 0, A_DBG, 0); + emu_wrptr(sc, 0, EMU_A_DBG, 0); } static void @@ -1534,7 +1616,7 @@ emu_initefx(struct sc_info *sc) } for (i = 0; i < 256; i++) - emu_wrptr(sc, 0, FXGPREGBASE + i, 0); + emu_wrptr(sc, 0, EMU_FXGPREGBASE + i, 0); /* FX-8010 DSP Registers: FX Bus @@ -1654,7 +1736,7 @@ emu_initefx(struct sc_info *sc) C_00000000, EXTIN(EXTIN_AC97_R), &pc); /* resume normal operations */ - emu_wrptr(sc, 0, DBG, 0); + emu_wrptr(sc, 0, EMU_DBG, 0); } /* Probe and attach the card */ @@ -1665,69 +1747,69 @@ emu_init(struct sc_info *sc) if (sc->audigy) { /* enable additional AC97 slots */ - emu_wrptr(sc, 0, AC97SLOT, AC97SLOT_CNTR | AC97SLOT_LFE); + emu_wrptr(sc, 0, EMU_AC97SLOT, EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE); } /* disable audio and lock cache */ - emu_wr(sc, HCFG, - HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, + emu_wr(sc, EMU_HCFG, + EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); /* disable channel interrupt */ - emu_wr(sc, INTE, - INTE_INTERVALTIMERENB | INTE_SAMPLERATETRACKER | INTE_PCIERRORENABLE, + emu_wr(sc, EMU_INTE, + EMU_INTE_INTERTIMERENB | EMU_INTE_SAMPLERATER | EMU_INTE_PCIERRENABLE, 4); - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* wonder what these do... */ if (sc->audigy) { - emu_wrptr(sc, 0, SPBYPASS, 0xf00); - emu_wrptr(sc, 0, AC97SLOT, 0x3); + emu_wrptr(sc, 0, EMU_SPBYPASS, 0xf00); + emu_wrptr(sc, 0, EMU_AC97SLOT, 0x3); } /* init envelope engine */ for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); - emu_wrptr(sc, ch, IP, 0); - emu_wrptr(sc, ch, VTFT, 0xffff); - emu_wrptr(sc, ch, CVCF, 0xffff); - emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); - emu_wrptr(sc, ch, CCR, 0); - - emu_wrptr(sc, ch, PSST, 0); - emu_wrptr(sc, ch, DSL, 0x10); - emu_wrptr(sc, ch, CCCA, 0); - emu_wrptr(sc, ch, Z1, 0); - emu_wrptr(sc, ch, Z2, 0); - emu_wrptr(sc, ch, FXRT, 0xd01c0000); - - emu_wrptr(sc, ch, ATKHLDM, 0); - emu_wrptr(sc, ch, DCYSUSM, 0); - emu_wrptr(sc, ch, IFATN, 0xffff); - emu_wrptr(sc, ch, PEFE, 0); - emu_wrptr(sc, ch, FMMOD, 0); - emu_wrptr(sc, ch, TREMFRQ, 24); /* 1 Hz */ - emu_wrptr(sc, ch, FM2FRQ2, 24); /* 1 Hz */ - emu_wrptr(sc, ch, TEMPENV, 0); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF); + emu_wrptr(sc, ch, EMU_CHAN_IP, 0); + emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0); + emu_wrptr(sc, ch, EMU_CHAN_CPF, 0); + emu_wrptr(sc, ch, EMU_CHAN_CCR, 0); + + emu_wrptr(sc, ch, EMU_CHAN_PSST, 0); + emu_wrptr(sc, ch, EMU_CHAN_DSL, 0x10); + emu_wrptr(sc, ch, EMU_CHAN_CCCA, 0); + emu_wrptr(sc, ch, EMU_CHAN_Z1, 0); + emu_wrptr(sc, ch, EMU_CHAN_Z2, 0); + emu_wrptr(sc, ch, EMU_CHAN_FXRT, 0xd01c0000); + + emu_wrptr(sc, ch, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSM, 0); + emu_wrptr(sc, ch, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_PEFE, 0); + emu_wrptr(sc, ch, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, ch, EMU_CHAN_TREMFRQ, 24); /* 1 Hz */ + emu_wrptr(sc, ch, EMU_CHAN_FM2FRQ2, 24); /* 1 Hz */ + emu_wrptr(sc, ch, EMU_CHAN_TEMPENV, 0); /*** these are last so OFF prevents writing ***/ - emu_wrptr(sc, ch, LFOVAL2, 0); - emu_wrptr(sc, ch, LFOVAL1, 0); - emu_wrptr(sc, ch, ATKHLDV, 0); - emu_wrptr(sc, ch, ENVVOL, 0); - emu_wrptr(sc, ch, ENVVAL, 0); + emu_wrptr(sc, ch, EMU_CHAN_LFOVAL2, 0); + emu_wrptr(sc, ch, EMU_CHAN_LFOVAL1, 0); + emu_wrptr(sc, ch, EMU_CHAN_ATKHLDV, 0); + emu_wrptr(sc, ch, EMU_CHAN_ENVVOL, 0); + emu_wrptr(sc, ch, EMU_CHAN_ENVVAL, 0); if (sc->audigy) { /* audigy cards need this to initialize correctly */ @@ -1736,9 +1818,9 @@ emu_init(struct sc_info *sc) emu_wrptr(sc, ch, 0x4e, 0); emu_wrptr(sc, ch, 0x4f, 0); /* set default routing */ - emu_wrptr(sc, ch, A_FXRT1, 0x03020100); - emu_wrptr(sc, ch, A_FXRT2, 0x3f3f3f3f); - emu_wrptr(sc, ch, A_SENDAMOUNTS, 0); + emu_wrptr(sc, ch, EMU_A_CHAN_FXRT1, 0x03020100); + emu_wrptr(sc, ch, EMU_A_CHAN_FXRT2, 0x3f3f3f3f); + emu_wrptr(sc, ch, EMU_A_CHAN_SENDAMOUNTS, 0); } sc->voice[ch].vnum = ch; @@ -1769,13 +1851,13 @@ emu_init(struct sc_info *sc) * AN = 0 (Audio data) * P = 0 (Consumer) */ - spcs = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | - SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | - SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; - emu_wrptr(sc, 0, SPCS0, spcs); - emu_wrptr(sc, 0, SPCS1, spcs); - emu_wrptr(sc, 0, SPCS2, spcs); + spcs = EMU_SPCS_CLKACCY_1000PPM | EMU_SPCS_SAMPLERATE_48 | + EMU_SPCS_CHANNELNUM_LEFT | EMU_SPCS_SOURCENUM_UNSPEC | + EMU_SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | + EMU_SPCS_EMPHASIS_NONE | EMU_SPCS_COPYRIGHT; + emu_wrptr(sc, 0, EMU_SPCS0, spcs); + emu_wrptr(sc, 0, EMU_SPCS1, spcs); + emu_wrptr(sc, 0, EMU_SPCS2, spcs); if (!sc->audigy) emu_initefx(sc); @@ -1786,8 +1868,8 @@ emu_init(struct sc_info *sc) u_int32_t tmp; /* Setup SRCMulti_I2S SamplingRate */ - tmp = emu_rdptr(sc, 0, A_SPDIF_SAMPLERATE) & 0xfffff1ff; - emu_wrptr(sc, 0, A_SPDIF_SAMPLERATE, tmp | 0x400); + tmp = emu_rdptr(sc, 0, EMU_A_SPDIF_SAMPLERATE) & 0xfffff1ff; + emu_wrptr(sc, 0, EMU_A_SPDIF_SAMPLERATE, tmp | 0x400); /* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */ emu_wr(sc, 0x20, 0x00600000, 4); @@ -1816,13 +1898,13 @@ emu_init(struct sc_info *sc) for (i = 0; i < EMUMAXPAGES; i++) sc->mem.ptb_pages[i] = tmp | i; - emu_wrptr(sc, 0, PTB, (sc->mem.ptb_pages_addr)); - emu_wrptr(sc, 0, TCB, 0); /* taken from original driver */ - emu_wrptr(sc, 0, TCBS, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_PTB, (sc->mem.ptb_pages_addr)); + emu_wrptr(sc, 0, EMU_TCB, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_TCBS, 0); /* taken from original driver */ for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, MAPA, tmp | MAP_PTI_MASK); - emu_wrptr(sc, ch, MAPB, tmp | MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK); } /* emu_memalloc(sc, EMUPAGESIZE); */ @@ -1850,19 +1932,19 @@ emu_init(struct sc_info *sc) */ if (sc->audigy) { - tmp = HCFG_AUTOMUTE | HCFG_JOYENABLE; + tmp = EMU_HCFG_AUTOMUTE | EMU_HCFG_JOYENABLE; if (sc->audigy2) /* Audigy 2 */ - tmp = HCFG_AUDIOENABLE | HCFG_AC3ENABLE_CDSPDIF | - HCFG_AC3ENABLE_GPSPDIF; - emu_wr(sc, HCFG, tmp, 4); + tmp = EMU_HCFG_AUDIOENABLE | EMU_HCFG_AC3ENABLE_CDSPDIF | + EMU_HCFG_AC3ENABLE_GPSPDIF; + emu_wr(sc, EMU_HCFG, tmp, 4); audigy_initefx(sc); /* from ALSA initialization code: */ /* enable audio and disable both audio/digital outputs */ - emu_wr(sc, HCFG, emu_rd(sc, HCFG, 4) | HCFG_AUDIOENABLE, 4); - emu_wr(sc, A_IOCFG, emu_rd(sc, A_IOCFG, 4) & ~A_IOCFG_GPOUT_AD, + emu_wr(sc, EMU_HCFG, emu_rd(sc, EMU_HCFG, 4) | EMU_HCFG_AUDIOENABLE, 4); + emu_wr(sc, EMU_A_IOCFG, emu_rd(sc, EMU_A_IOCFG, 4) & ~EMU_A_IOCFG_GPOUT_AD, 4); if (sc->audigy2) { /* Audigy 2 */ /* Unmute Analog. @@ -1870,27 +1952,27 @@ emu_init(struct sc_info *sc) * init Alice3 I2SOut beyond 48kHz. * So, sequence is important. */ - emu_wr(sc, A_IOCFG, - emu_rd(sc, A_IOCFG, 4) | A_IOCFG_GPOUT_A, 4); + emu_wr(sc, EMU_A_IOCFG, + emu_rd(sc, EMU_A_IOCFG, 4) | EMU_A_IOCFG_GPOUT_A, 4); } } else { /* EMU10K1 initialization code */ - tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK - | HCFG_AUTOMUTE; + tmp = EMU_HCFG_AUDIOENABLE | EMU_HCFG_LOCKTANKCACHE_MASK + | EMU_HCFG_AUTOMUTE; if (sc->rev >= 6) - tmp |= HCFG_JOYENABLE; + tmp |= EMU_HCFG_JOYENABLE; - emu_wr(sc, HCFG, tmp, 4); + emu_wr(sc, EMU_HCFG, tmp, 4); /* TOSLink detection */ sc->tos_link = 0; - tmp = emu_rd(sc, HCFG, 4); - if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { - emu_wr(sc, HCFG, tmp | HCFG_GPOUT1, 4); + tmp = emu_rd(sc, EMU_HCFG, 4); + if (tmp & (EMU_HCFG_GPINPUT0 | EMU_HCFG_GPINPUT1)) { + emu_wr(sc, EMU_HCFG, tmp | EMU_HCFG_GPOUT1, 4); DELAY(50); - if (tmp != (emu_rd(sc, HCFG, 4) & ~HCFG_GPOUT1)) { + if (tmp != (emu_rd(sc, EMU_HCFG, 4) & ~EMU_HCFG_GPOUT1)) { sc->tos_link = 1; - emu_wr(sc, HCFG, tmp, 4); + emu_wr(sc, EMU_HCFG, tmp, 4); } } } @@ -1903,42 +1985,42 @@ emu_uninit(struct sc_info *sc) { u_int32_t ch; - emu_wr(sc, INTE, 0, 4); + emu_wr(sc, EMU_INTE, 0, 4); for (ch = 0; ch < NUM_G; ch++) - emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF); for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, VTFT, 0); - emu_wrptr(sc, ch, CVCF, 0); - emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); + emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0); + emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0); + emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0); + emu_wrptr(sc, ch, EMU_CHAN_CPF, 0); } if (sc->audigy) { /* stop fx processor */ - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); } /* disable audio and lock cache */ - emu_wr(sc, HCFG, - HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, + emu_wr(sc, EMU_HCFG, + EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); - emu_wrptr(sc, 0, PTB, 0); + emu_wrptr(sc, 0, EMU_PTB, 0); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, FXWC, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); - emu_wrptr(sc, 0, TCB, 0); - emu_wrptr(sc, 0, TCBS, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_FXWC, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); + emu_wrptr(sc, 0, EMU_TCB, 0); + emu_wrptr(sc, 0, EMU_TCBS, 0); /* disable channel interrupt */ - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* init envelope engine */ if (!SLIST_EMPTY(&sc->mem.blocks)) @@ -1997,7 +2079,7 @@ emu_pci_attach(device_t dev) sc->audigy = sc->type == EMU10K2_PCI_ID || sc->type == EMU10K3_PCI_ID; sc->audigy2 = (sc->audigy && sc->rev == 0x04); sc->nchans = sc->audigy ? 8 : 4; - sc->addrmask = sc->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK; + sc->addrmask = sc->audigy ? EMU_A_PTR_ADDR_MASK : EMU_PTR_ADDR_MASK; data = pci_read_config(dev, PCIR_COMMAND, 2); data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN); Added: head/sys/dev/sound/pci/emuxkireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/pci/emuxkireg.h Tue Jan 3 21:04:54 2012 (r229430) @@ -0,0 +1,689 @@ +/* $FreeBSD$ */ +/* $NetBSD: emuxkireg.h,v 1.8 2008/04/28 20:23:54 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Yannick Montulet. + * + * 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 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. + */ + +#ifndef _DEV_PCI_EMUXKIREG_H_ +#define _DEV_PCI_EMUXKIREG_H_ + +/* + * Register values for Creative EMU10000. The register values have been + * taken from GPLed SBLive! header file published by Creative. The comments + * have been stripped to avoid GPL pollution in kernel. The Creative version + * including comments is available in Linux 2.4.* kernel as file + * drivers/sound/emu10k1/8010.h + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 21:09:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D7491065672; Tue, 3 Jan 2012 21:09:08 +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 D65F28FC1B; Tue, 3 Jan 2012 21:09:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03L97PN043349; Tue, 3 Jan 2012 21:09:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03L97Mv043345; Tue, 3 Jan 2012 21:09:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201032109.q03L97Mv043345@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 3 Jan 2012 21:09: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: r229431 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 21:09:08 -0000 Author: kib Date: Tue Jan 3 21:09:07 2012 New Revision: 229431 URL: http://svn.freebsd.org/changeset/base/229431 Log: Do the vput() for the lowervp in the null_nodeget() for error case too. Several callers of null_nodeget() did the cleanup itself, but several missed it, most prominent being null_bypass(). Remove the cleanup from the callers, now null_nodeget() handles lowervp free itself. Reported and tested by: pho MFC after: 1 week Modified: head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Tue Jan 3 21:04:54 2012 (r229430) +++ head/sys/fs/nullfs/null_subr.c Tue Jan 3 21:09:07 2012 (r229431) @@ -171,6 +171,8 @@ null_hashins(mp, xp) static void null_insmntque_dtr(struct vnode *vp, void *xp) { + + vput(((struct null_node *)xp)->null_lowervp); vp->v_data = NULL; vp->v_vnlock = &vp->v_lock; free(xp, M_NULLFSNODE); @@ -226,6 +228,7 @@ null_nodeget(mp, lowervp, vpp) error = getnewvnode("null", mp, &null_vnodeops, &vp); if (error) { + vput(lowervp); free(xp, M_NULLFSNODE); return (error); } Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Tue Jan 3 21:04:54 2012 (r229430) +++ head/sys/fs/nullfs/null_vfsops.c Tue Jan 3 21:09:07 2012 (r229431) @@ -157,8 +157,7 @@ nullfs_mount(struct mount *mp) * Make sure the node alias worked */ if (error) { - vrele(lowerrootvp); - free(xmp, M_NULLFSMNT); /* XXX */ + free(xmp, M_NULLFSMNT); return (error); } Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Tue Jan 3 21:04:54 2012 (r229430) +++ head/sys/fs/nullfs/null_vnops.c Tue Jan 3 21:09:07 2012 (r229431) @@ -365,9 +365,7 @@ null_lookup(struct vop_lookup_args *ap) vrele(lvp); } else { error = null_nodeget(dvp->v_mount, lvp, &vp); - if (error) - vput(lvp); - else + if (error == 0) *ap->a_vpp = vp; } } @@ -809,9 +807,7 @@ null_vptocnp(struct vop_vptocnp_args *ap NULLVPTOLOWERVP(*dvp); #endif VOP_UNLOCK(*dvp, 0); /* keep reference on *dvp */ - } else - vput(ldvp); - + } vn_lock(vp, locked | LK_RETRY); return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 21:45:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 837D0106567B; Tue, 3 Jan 2012 21:45:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 594D08FC1D; Tue, 3 Jan 2012 21:45:35 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 1170746B2D; Tue, 3 Jan 2012 16:45:35 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 68CC9B949; Tue, 3 Jan 2012 16:45:34 -0500 (EST) From: John Baldwin To: "Pedro F. Giffuni" Date: Tue, 3 Jan 2012 16:15:06 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201201032104.q03L4sTm043158@svn.freebsd.org> In-Reply-To: <201201032104.q03L4sTm043158@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201031615.06873.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 03 Jan 2012 16:45:34 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, joel@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 21:45:35 -0000 On Tuesday, January 03, 2012 4:04:54 pm Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jan 3 21:04:54 2012 > New Revision: 229430 > URL: http://svn.freebsd.org/changeset/base/229430 > > Log: > Replace a GPL'd header in the emu10k1 snd driver code. > > This brings in the emuxkireg.h from NetBSD (dev/pci) which > is used for the same purpose but is smaller. The emu10k1 > is now free from the GPL. Is this a common-enough chipset to enable in GENERIC now that it is safe to do so? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 21:48:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E7F4106567B; Tue, 3 Jan 2012 21:48:25 +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 387808FC0C; Tue, 3 Jan 2012 21:48:25 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 701E12A28DEC; Tue, 3 Jan 2012 22:48:24 +0100 (CET) Date: Tue, 3 Jan 2012 22:48:24 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20120103214824.GK1895@hoeg.nl> References: <201201032104.q03L4sTm043158@svn.freebsd.org> <201201031615.06873.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Oe/xgtOcljDBCKHf" Content-Disposition: inline In-Reply-To: <201201031615.06873.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org, joel@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 21:48:25 -0000 --Oe/xgtOcljDBCKHf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, * John Baldwin , 20120103 22:15: > Is this a common-enough chipset to enable in GENERIC now that it is safe = to > do so? I would guess so, especially on i386 boxes. --=20 Ed Schouten WWW: http://80386.nl/ --Oe/xgtOcljDBCKHf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPA3eoAAoJEG5e2P40kaK7RdoP/2y+r4Gwey7iPPyED921c++j n08rsMtUq9YdmbpNt94r96Ti4dCgi+R7SpjyuJODGeiCZdrOwbaIrdAtYru5cw46 94tmt6W3F8GXe07GWsaBcXNdmhFG7QyJuJZF31TjlijdoyWS51Znu06l37RHELHu E31/fAbNBi3LWdGHFYhGMeVUL8g19H20PDS2sH1Edkk8E2nDnOLE3ozAwojZCGxP 3Sykk7b8gfbWY0OGaKhwfJyyOy3RVFv7MCl5mP9i08XNsxtXUVgFEAoFggXDZPXx fhzYoZkJNj56beAao9M3VSfUlwfWWjz0JNf63o2vQum3C5H4DjurkWZyrOlLYIJd 4ZFrgckvmNf+1ALwd0+QIlhasWp4lczvQfe1hTI8mRl+ou/L4QAixg/KjwismeDf x06vhT7E3dC+ZhEGVSyTH5IblCIv/eSifSHPOM5iuDzyAp1DfFu/YCwIKoo029BX Bq+QPPXR8eVV5auIjL/8pssPadOXT43kvcxtnshgBNbveO4pT394Hxqhj4yJc2zF ib79XOWejY2CISIbLC/omUyLxIf84ihBtsGOqogSSF1F9e+6LY/Kk2GlKe68g1nm 8vYisUGFvKnTqYMECa4AADS3TsqvviU+Yn+Lyb2iqMs43xYi5p2Ghg4xvxPA836O JWGnBGbSBcccpNxCvd0e =ndZU -----END PGP SIGNATURE----- --Oe/xgtOcljDBCKHf-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 22:16:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A035C106567C for ; Tue, 3 Jan 2012 22:16:42 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm17.bullet.mail.ne1.yahoo.com (nm17.bullet.mail.ne1.yahoo.com [98.138.90.80]) by mx1.freebsd.org (Postfix) with SMTP id 416588FC13 for ; Tue, 3 Jan 2012 22:16:42 +0000 (UTC) Received: from [98.138.90.56] by nm17.bullet.mail.ne1.yahoo.com with NNFMP; 03 Jan 2012 22:16:41 -0000 Received: from [98.138.88.232] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 03 Jan 2012 22:16:41 -0000 Received: from [127.0.0.1] by omp1032.mail.ne1.yahoo.com with NNFMP; 03 Jan 2012 22:16:41 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 763404.57220.bm@omp1032.mail.ne1.yahoo.com Received: (qmail 57176 invoked by uid 60001); 3 Jan 2012 22:16:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1325629000; bh=GctYWR7EMhAUf6UpWHYbGSMHwHQBOBYEAufesNqDgwc=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2LqQ5sWe8+8Pb/1OctqP8t7GKjnPnZm73gwHC2LSJQZPnLjB6oWSWGQ2FP4qKtGkXVMCXMjThcQYuJqprqKWK+l1JLz8RskQK3b81Bv81z33UYX9IlyxwGJdeYkpuh4euGFra3s9072uDxwUAhbx7uZjOycxkOIImM50wpO3GgY= X-YMail-OSG: 6URbJaIVM1mQXApBF3EW6iPg9io_HcaHzWG9EzZNNntoreY KmgVHTmrXB6ZIKy4_2eo4UsPU9RN7sk4HEYb55WP0tVDcVV5_NDQwZF_hxtj xbtpWsVtR0cX1aTutHZiU9pE8X.x0KGsPUH3O6wRoMgnYAWkWrPxeUifdXh6 rC8qFOIuLyBC9tn_AURQB7dGqTH.xdkWCkKc2hlUUKyh2bufZSPJcZoFaSNQ q5JGM2tfi0WNSNf10dAJsqDo30weI0A.PcORnDQ4on2pdIf95PfBkf1T25.J wlnO4IKlYrHWo7Wlhmz1VT5XwfT4L5qLr1RVZAS95S5Keb1s8MVESjdyvtFl WegX8dny1hgCzAyRJe6yO_g5b2BHUc70epAO0W2gRCXMVak2UVZuTwaUaT1l 434k7.qdS0svGyInJy7LOJg9FTftjeCNmrGYf03Iu6W6XFGOZsXNkN9znzpi vpiWitTZc4zMRDfgbzuO7pHy36A-- Received: from [200.118.157.7] by web113515.mail.gq1.yahoo.com via HTTP; Tue, 03 Jan 2012 14:16:40 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1325629000.43247.YahooMailClassic@web113515.mail.gq1.yahoo.com> Date: Tue, 3 Jan 2012 14:16:40 -0800 (PST) From: Pedro Giffuni To: John Baldwin In-Reply-To: <201201031615.06873.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, joel@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 22:16:42 -0000 Hi;=0A=0A--- Mar 3/1/12, John Baldwin ha scritto:=0A...= =0A> On Tuesday, January 03, 2012 4:04:54=0A> pm Pedro F. Giffuni wrote:=0A= > > Author: pfg=0A> > Date: Tue Jan=A0 3 21:04:54 2012=0A> > New Revision: = 229430=0A> > URL: http://svn.freebsd.org/changeset/base/229430=0A> > =0A> >= Log:=0A> >=A0=A0=A0Replace a GPL'd header in the emu10k1=0A> snd driver co= de.=0A> >=A0=A0=A0=0A> >=A0=A0=A0This brings in the emuxkireg.h from=0A> Ne= tBSD (dev/pci) which=0A> >=A0=A0=A0is used for the same purpose but is=0A> = smaller. The emu10k1=0A> >=A0=A0=A0is now free from the GPL.=0A> =0A> Is th= is a common-enough chipset to enable in GENERIC now=0A> that it is safe to = do so?=0A> =0A=0AIt's probably very common in PC emulators so it will be=0A= important to MFC into stable.=0A=0AFWIW, two other cards (maestro3 and csai= mg) are based on=0Aheaders from OSS that are now under a BSD license.=0A=0A= The maestro3 is done (kern/153920) and is next in my=0Alist but it's gettin= g difficult to find testers for=0Athis old stuff.=0A=0ACheers,=0A=0APedro.= =0A From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 22:21:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9B5F106564A; Tue, 3 Jan 2012 22:21:39 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8148FC18; Tue, 3 Jan 2012 22:21:39 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so19396001obb.13 for ; Tue, 03 Jan 2012 14:21:38 -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=wycnfdiWcKRp4Ug3yJeX+tvz3pwXgw4CO2MnvIOnimk=; b=hXt/IYGhqO2YVwfO81ONruj8suduQLwJqpfyqiW4nS+pp5zxzniFIhd9VL0u+CkCI6 Zna9gVSiTj0ZgGpHG+elTzMWGTqbex49xyJM6liZwIuF5iLsAJ0TNJPDeIWlH48pTxqi l/Ads6/vOv+2gHEO1SBndIXQ2FXKRHle/k9JY= MIME-Version: 1.0 Received: by 10.182.164.106 with SMTP id yp10mr3503924obb.71.1325629298950; Tue, 03 Jan 2012 14:21:38 -0800 (PST) Received: by 10.182.152.6 with HTTP; Tue, 3 Jan 2012 14:21:38 -0800 (PST) In-Reply-To: <1325629000.43247.YahooMailClassic@web113515.mail.gq1.yahoo.com> References: <201201031615.06873.jhb@freebsd.org> <1325629000.43247.YahooMailClassic@web113515.mail.gq1.yahoo.com> Date: Tue, 3 Jan 2012 14:21:38 -0800 Message-ID: From: Garrett Cooper To: pfg@freebsd.org 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, John Baldwin , joel@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 22:21:40 -0000 On Tue, Jan 3, 2012 at 2:16 PM, Pedro Giffuni wrote: > Hi; > > --- Mar 3/1/12, John Baldwin ha scritto: > ... >> On Tuesday, January 03, 2012 4:04:54 >> pm Pedro F. Giffuni wrote: >> > Author: pfg >> > Date: Tue Jan=A0 3 21:04:54 2012 >> > New Revision: 229430 >> > URL: http://svn.freebsd.org/changeset/base/229430 >> > >> > Log: >> >=A0=A0=A0Replace a GPL'd header in the emu10k1 >> snd driver code. >> > >> >=A0=A0=A0This brings in the emuxkireg.h from >> NetBSD (dev/pci) which >> >=A0=A0=A0is used for the same purpose but is >> smaller. The emu10k1 >> >=A0=A0=A0is now free from the GPL. >> >> Is this a common-enough chipset to enable in GENERIC now >> that it is safe to do so? >> > > It's probably very common in PC emulators so it will be > important to MFC into stable. > > FWIW, two other cards (maestro3 and csaimg) are based on > headers from OSS that are now under a BSD license. > > The maestro3 is done (kern/153920) and is next in my > list but it's getting difficult to find testers for > this old stuff. Can the same be done for emu10kx ? Someday it would be nice to have xfi support in the tree, but that's a missing driver that even the OSS maintainer was scared to touch because of the complexity of the code. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 22:36:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79E05106564A; Tue, 3 Jan 2012 22:36:12 +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 5E3998FC08; Tue, 3 Jan 2012 22:36:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03MaCqI046225; Tue, 3 Jan 2012 22:36:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03MaCNM046221; Tue, 3 Jan 2012 22:36:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201032236.q03MaCNM046221@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 3 Jan 2012 22:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229435 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 22:36:12 -0000 Author: kib Date: Tue Jan 3 22:36:12 2012 New Revision: 229435 URL: http://svn.freebsd.org/changeset/base/229435 Log: Add special loader environment variables 'comconsole_port' and 'comconsole_pcidev'. The former allows to set the base address of the serial console i/o port. The later takes the string of the format 'bus:device:function:[bar]' as a value and uses the serial port attached as PCI device at the specified location for console. Both variants pass 'hw.uart.console' variable to the uart driver to properly hand-over the kernel console. Change allows to use ISA serial ports other than COM1 for the loader/kernel console without loader recompilation. Also, you can use PCI-attached port as the console, e.g. Intel AMT serial pseudo-port on some motherboards based on Q67 chipset. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/boot/i386/libi386/biospci.c head/sys/boot/i386/libi386/comconsole.c head/sys/boot/i386/libi386/libi386.h Modified: head/sys/boot/i386/libi386/biospci.c ============================================================================== --- head/sys/boot/i386/libi386/biospci.c Tue Jan 3 21:21:25 2012 (r229434) +++ head/sys/boot/i386/libi386/biospci.c Tue Jan 3 22:36:12 2012 (r229435) @@ -342,3 +342,9 @@ biospci_read_config(uint32_t locator, in return (0); } +uint32_t +biospci_locator(int8_t bus, uint8_t device, uint8_t function) +{ + + return ((bus << 8) | ((device & 0x1f) << 3) | (function & 0x7)); +} Modified: head/sys/boot/i386/libi386/comconsole.c ============================================================================== --- head/sys/boot/i386/libi386/comconsole.c Tue Jan 3 21:21:25 2012 (r229434) +++ head/sys/boot/i386/libi386/comconsole.c Tue Jan 3 22:36:12 2012 (r229435) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libi386.h" #define COMC_FMT 0x3 /* 8N1 */ @@ -49,14 +50,23 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); static int comc_getspeed(void); +static void set_hw_console_hint(void); static int comc_ischar(void); -static int comc_parsespeed(const char *string); -static void comc_setup(int speed); +static int comc_parseint(const char *string); +static uint32_t comc_parse_pcidev(const char *string); +static int comc_pcidev_set(struct env_var *ev, int flags, + const void *value); +static int comc_pcidev_handle(uint32_t locator); +static int comc_port_set(struct env_var *ev, int flags, + const void *value); +static void comc_setup(int speed, int port); static int comc_speed_set(struct env_var *ev, int flags, const void *value); static int comc_started; static int comc_curspeed; +static int comc_port = COMPORT; +static uint32_t comc_locator; struct console comconsole = { "comconsole", @@ -72,9 +82,10 @@ struct console comconsole = { static void comc_probe(struct console *cp) { - char speedbuf[16]; - char *cons, *speedenv; - int speed; + char intbuf[16]; + char *cons, *env; + int speed, port; + uint32_t locator; /* XXX check the BIOS equipment list? */ cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); @@ -90,16 +101,40 @@ comc_probe(struct console *cp) getenv("boot_multicons") != NULL) { comc_curspeed = comc_getspeed(); } - speedenv = getenv("comconsole_speed"); - if (speedenv != NULL) { - speed = comc_parsespeed(speedenv); + + env = getenv("comconsole_speed"); + if (env != NULL) { + speed = comc_parseint(env); if (speed > 0) comc_curspeed = speed; } - sprintf(speedbuf, "%d", comc_curspeed); + sprintf(intbuf, "%d", comc_curspeed); unsetenv("comconsole_speed"); - env_setenv("comconsole_speed", EV_VOLATILE, speedbuf, comc_speed_set, + env_setenv("comconsole_speed", EV_VOLATILE, intbuf, comc_speed_set, + env_nounset); + + env = getenv("comconsole_port"); + if (env != NULL) { + port = comc_parseint(env); + if (port > 0) + comc_port = port; + } + + sprintf(intbuf, "%d", comc_port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, comc_port_set, + env_nounset); + + env = getenv("comconsole_pcidev"); + if (env != NULL) { + locator = comc_parse_pcidev(env); + if (locator != 0) + comc_pcidev_handle(locator); + } + + unsetenv("comconsole_pcidev"); + env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } } @@ -111,7 +146,7 @@ comc_init(int arg) return 0; comc_started = 1; - comc_setup(comc_curspeed); + comc_setup(comc_curspeed, comc_port); return(0); } @@ -122,8 +157,8 @@ comc_putchar(int c) int wait; for (wait = COMC_TXWAIT; wait > 0; wait--) - if (inb(COMPORT + com_lsr) & LSR_TXRDY) { - outb(COMPORT + com_data, (u_char)c); + if (inb(comc_port + com_lsr) & LSR_TXRDY) { + outb(comc_port + com_data, (u_char)c); break; } } @@ -131,13 +166,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(COMPORT + com_data) : -1); + return(comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(COMPORT + com_lsr) & LSR_RXRDY); + return(inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -145,13 +180,33 @@ comc_speed_set(struct env_var *ev, int f { int speed; - if (value == NULL || (speed = comc_parsespeed(value)) <= 0) { + if (value == NULL || (speed = comc_parseint(value)) <= 0) { printf("Invalid speed\n"); return (CMD_ERROR); } if (comc_started && comc_curspeed != speed) - comc_setup(speed); + comc_setup(speed, comc_port); + + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + + return (CMD_OK); +} + +static int +comc_port_set(struct env_var *ev, int flags, const void *value) +{ + int port; + + if (value == NULL || (port = comc_parseint(value)) <= 0) { + printf("Invalid port\n"); + return (CMD_ERROR); + } + + if (comc_started && comc_port != port) { + comc_setup(comc_curspeed, port); + set_hw_console_hint(); + } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -159,24 +214,126 @@ comc_speed_set(struct env_var *ev, int f } static void -comc_setup(int speed) +set_hw_console_hint(void) +{ + char intbuf[64]; + + unsetenv("hw.uart.console"); + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, + env_noset, env_nounset); +} + +/* + * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. + * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] + */ +static uint32_t +comc_parse_pcidev(const char *string) +{ + char *p, *p1; + uint8_t bus, dev, func, bar; + uint32_t locator; + int pres; + + pres = strtol(string, &p, 0); + if (p == string || *p != ':' || pres < 0 ) + return (0); + bus = pres; + p1 = ++p; + + pres = strtol(p1, &p, 0); + if (p == string || *p != ':' || pres < 0 ) + return (0); + dev = pres; + p1 = ++p; + + pres = strtol(p1, &p, 0); + if (p == string || (*p != ':' && *p != '\0') || pres < 0 ) + return (0); + func = pres; + + if (*p == ':') { + p1 = ++p; + pres = strtol(p1, &p, 0); + if (p == string || *p != '\0' || pres <= 0 ) + return (0); + bar = pres; + } else + bar = 0x10; + + locator = (bar << 16) | biospci_locator(bus, dev, func); + return (locator); +} + +static int +comc_pcidev_handle(uint32_t locator) +{ + char intbuf[64]; + uint32_t port; + + if (biospci_read_config(locator & 0xffff, + (locator & 0xff0000) >> 16, 2, &port) == -1) { + printf("Cannot read bar at 0x%x\n", locator); + return (CMD_ERROR); + } + if (!PCI_BAR_IO(port)) { + printf("Memory bar at 0x%x\n", locator); + return (CMD_ERROR); + } + port &= PCIM_BAR_IO_BASE; + + sprintf(intbuf, "%d", port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, + comc_port_set, env_nounset); + + comc_setup(comc_curspeed, port); + set_hw_console_hint(); + comc_locator = locator; + + return (CMD_OK); +} + +static int +comc_pcidev_set(struct env_var *ev, int flags, const void *value) +{ + uint32_t locator; + int error; + + if (value == NULL || (locator = comc_parse_pcidev(value)) <= 0) { + printf("Invalid pcidev\n"); + return (CMD_ERROR); + } + if (comc_started && comc_locator != locator) { + error = comc_pcidev_handle(locator); + if (error != CMD_OK) + return (error); + } + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + return (CMD_OK); +} + +static void +comc_setup(int speed, int port) { comc_curspeed = speed; + comc_port = port; - outb(COMPORT + com_cfcr, CFCR_DLAB | COMC_FMT); - outb(COMPORT + com_dlbl, COMC_BPS(speed) & 0xff); - outb(COMPORT + com_dlbh, COMC_BPS(speed) >> 8); - outb(COMPORT + com_cfcr, COMC_FMT); - outb(COMPORT + com_mcr, MCR_RTS | MCR_DTR); + outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); + outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); + outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8); + outb(comc_port + com_cfcr, COMC_FMT); + outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); do - inb(COMPORT + com_data); - while (inb(COMPORT + com_lsr) & LSR_RXRDY); + inb(comc_port + com_data); + while (inb(comc_port + com_lsr) & LSR_RXRDY); } static int -comc_parsespeed(const char *speedstr) +comc_parseint(const char *speedstr) { char *p; int speed; @@ -196,13 +353,13 @@ comc_getspeed(void) u_char dlbl; u_char cfcr; - cfcr = inb(COMPORT + com_cfcr); - outb(COMPORT + com_cfcr, CFCR_DLAB | cfcr); + cfcr = inb(comc_port + com_cfcr); + outb(comc_port + com_cfcr, CFCR_DLAB | cfcr); - dlbl = inb(COMPORT + com_dlbl); - dlbh = inb(COMPORT + com_dlbh); + dlbl = inb(comc_port + com_dlbl); + dlbh = inb(comc_port + com_dlbh); - outb(COMPORT + com_cfcr, cfcr); + outb(comc_port + com_cfcr, cfcr); divisor = dlbh << 8 | dlbl; Modified: head/sys/boot/i386/libi386/libi386.h ============================================================================== --- head/sys/boot/i386/libi386/libi386.h Tue Jan 3 21:21:25 2012 (r229434) +++ head/sys/boot/i386/libi386/libi386.h Tue Jan 3 22:36:12 2012 (r229435) @@ -97,6 +97,7 @@ extern vm_offset_t high_heap_base; /* fo int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); int biospci_read_config(uint32_t locator, int offset, int width, uint32_t *val); +uint32_t biospci_locator(int8_t bus, uint8_t device, uint8_t function); void biosacpi_detect(void); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 22:52:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8C57106566B; Tue, 3 Jan 2012 22:52:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75348FC08; Tue, 3 Jan 2012 22:52: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 q03MqTA3046861; Tue, 3 Jan 2012 22:52:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03MqTkc046859; Tue, 3 Jan 2012 22:52:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201032252.q03MqTkc046859@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 3 Jan 2012 22:52: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: r229436 - head/tools/tools/net80211/wesside/wesside X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 22:52:30 -0000 Author: pjd Date: Tue Jan 3 22:52:29 2012 New Revision: 229436 URL: http://svn.freebsd.org/changeset/base/229436 Log: Fix an obvious typo. We do want to specify file permission when we pass O_CREAT. Modified: head/tools/tools/net80211/wesside/wesside/wesside.c Modified: head/tools/tools/net80211/wesside/wesside/wesside.c ============================================================================== --- head/tools/tools/net80211/wesside/wesside/wesside.c Tue Jan 3 22:36:12 2012 (r229435) +++ head/tools/tools/net80211/wesside/wesside/wesside.c Tue Jan 3 22:52:29 2012 (r229436) @@ -2091,7 +2091,7 @@ void save_key(unsigned char *key, int le strcat(k, ":"); } - fd = open(KEY_FILE, O_WRONLY | O_CREAT | 0644); + fd = open(KEY_FILE, O_WRONLY | O_CREAT, 0644); if (fd == -1) err(1, "open()"); From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 22:57:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F7C21065672 for ; Tue, 3 Jan 2012 22:57:07 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm23.bullet.mail.sp2.yahoo.com (nm23.bullet.mail.sp2.yahoo.com [98.139.91.93]) by mx1.freebsd.org (Postfix) with SMTP id EA2BF8FC14 for ; Tue, 3 Jan 2012 22:57:06 +0000 (UTC) Received: from [98.139.91.69] by nm23.bullet.mail.sp2.yahoo.com with NNFMP; 03 Jan 2012 22:44:34 -0000 Received: from [98.139.91.8] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 03 Jan 2012 22:44:34 -0000 Received: from [127.0.0.1] by omp1008.mail.sp2.yahoo.com with NNFMP; 03 Jan 2012 22:44:34 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 428502.69404.bm@omp1008.mail.sp2.yahoo.com Received: (qmail 92817 invoked by uid 60001); 3 Jan 2012 22:44:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1325630673; bh=0ZaM9rZdSug1EXP4z4KRuUnD+abcHblhhdGFNUr2g0o=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=NYsO/1xGXkV8A3fuuhJshsgZpau822hIOxVdGYrWClDdRkLHlFAWjxWgsxyKLNDzkhBk3ijcXuUN0RLAnibNnDRlRCcrU/0hjPiW6I4+Yx7IHp5+xwUVEmm9f1ta7VrrojrGg+Dsfc/DsZAtrj35Z2PZzbPQWHeJVaWwV+XpZEY= X-YMail-OSG: yTVES1sVM1laz.yYnWHWIzkYykzQ77fVIyacY4pRX.ekHX. lBx6qvQWnq9w3zLJekwetBLpDFQu5TwMIF3CHP.snDXAfwUwYyHcb4wdUaEj h36WmNyU2MlrYhqw1o7VvtBZYFKdwkgY_AvvEMLpdd3TwT.LwzDgnnXYknjR FDihgbfzHqwkoWuhCg_GoVMGvOkTBPz0ifxZGdllc_7mo7MwROVze.WIhFmm 5tLTvGvLVjib2Ex1UUdFlbwlsPzHJnBg_b_NxNF8sYyD4EbfdcBHOud_VF60 hQstH08f4nvpLw7ITqmGmQVphvxO_C4_NaUObcFATV9j93oOuqVRgRLIKexQ tzLJDa9XUoNSOgyMlAKaOa3yHeBLx3AaBUVmgLNoeYaZVdBR_KFl7v_Drasb jdKcoVwRU29DfO8wyznKfW.VRlQnv.Rft.DVa9SFjfgB3fLj8qa1pKC3PCus J.erkeoL5p4uifKL3JOjnSH0- Received: from [200.118.157.7] by web113514.mail.gq1.yahoo.com via HTTP; Tue, 03 Jan 2012 14:44:33 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1325630673.90694.YahooMailClassic@web113514.mail.gq1.yahoo.com> Date: Tue, 3 Jan 2012 14:44:33 -0800 (PST) From: Pedro Giffuni To: Garrett Cooper In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , joel@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 22:57:07 -0000 =0A=0A--- Mar 3/1/12, Garrett Cooper ha scritto:=0A...= =0A> =0A> Can the same be done for emu10kx ?=0A> =0ANo :(. The two extra he= aders are GPL'd and the author doesn't=0Awant to hear about BSDs.=0A=0A> So= meday it would be nice to have xfi support in the tree,=0A> but that's a mi= ssing driver that even the OSS maintainer=0A> was scared to touch because o= f the complexity of the code.=0A> =0A=0AApparently Creative released a GPLd= driver for linux(ALSA),=0Abut it was not in working shape.=0A=0ACheers,=0A= =0APedro. From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 23:05:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E09B1065670; Tue, 3 Jan 2012 23:05:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14FA8FC14; Tue, 3 Jan 2012 23:05: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 q03N5NVe047349; Tue, 3 Jan 2012 23:05:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03N5NWH047347; Tue, 3 Jan 2012 23:05:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201032305.q03N5NWH047347@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 23:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229437 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 23:05:24 -0000 Author: ed Date: Tue Jan 3 23:05:23 2012 New Revision: 229437 URL: http://svn.freebsd.org/changeset/base/229437 Log: Simply disallow to be used in combination with C++. There is no way one could possibly use this header file in combination with C++ code. The problem is that in C11 the `noreturn' macro expands to the `_Noreturn' function specifier, while in C++11 the `noreturn' keyword is an attribute. So in C11 you have to write: noreturn void exit(int status); While in C++11 you have to write: [[noreturn]] void exit(int status); It is impossible to #define noreturn for C++ in such a way that it allows both conventions. By intentionally breaking this header this way, we prevent people from using this header in their C++<11 sources. Modified: head/include/stdnoreturn.h Modified: head/include/stdnoreturn.h ============================================================================== --- head/include/stdnoreturn.h Tue Jan 3 22:52:29 2012 (r229436) +++ head/include/stdnoreturn.h Tue Jan 3 23:05:23 2012 (r229437) @@ -26,11 +26,13 @@ * $FreeBSD$ */ +#ifdef __cplusplus +#error " cannot be used in combination with C++11." +#endif + #ifndef noreturn -#if !defined(__cplusplus) || __cplusplus < 201103L #include #define noreturn _Noreturn -#endif #endif /* !noreturn */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 3 23:30:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCC4106564A; Tue, 3 Jan 2012 23:30:53 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id B3DB68FC0A; Tue, 3 Jan 2012 23:30:52 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so19473070obb.13 for ; Tue, 03 Jan 2012 15:30:52 -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; bh=8cXOO3tXPCUCcmGProW9cgcEaTANOZmWJDOA7RmGsqc=; b=t6CqmbiKn+V+8CVbsR9cKIY4S8V9UK/KboJYhw5shZyPVsui/vSwL0rQgozJkUrAWB 0mLnnn1QyyxnDtv5AtfcJSgNnlRcBvms2+6hfZf7e14AV2qD7djxdNLg0RX+tW60UnxZ ZGrxhD6am5fwV/69UZORvfm1Nwht6LSVoRlNk= MIME-Version: 1.0 Received: by 10.182.193.99 with SMTP id hn3mr46073110obc.61.1325633452116; Tue, 03 Jan 2012 15:30:52 -0800 (PST) Received: by 10.182.152.6 with HTTP; Tue, 3 Jan 2012 15:30:52 -0800 (PST) In-Reply-To: <1325630673.90694.YahooMailClassic@web113514.mail.gq1.yahoo.com> References: <1325630673.90694.YahooMailClassic@web113514.mail.gq1.yahoo.com> Date: Tue, 3 Jan 2012 15:30:52 -0800 Message-ID: From: Garrett Cooper To: pfg@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , joel@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 23:30:53 -0000 On Tue, Jan 3, 2012 at 2:44 PM, Pedro Giffuni wrote: > > > --- Mar 3/1/12, Garrett Cooper ha scritto: > ... >> >> Can the same be done for emu10kx ? >> > No :(. The two extra headers are GPL'd and the author doesn't > want to hear about BSDs. > >> Someday it would be nice to have xfi support in the tree, >> but that's a missing driver that even the OSS maintainer >> was scared to touch because of the complexity of the code. >> > > Apparently Creative released a GPLd driver for linux(ALSA), > but it was not in working shape. The ALSA driver worked back when I tried it out 2 years ago. I asked for them to release an OSS version, but of course they ignored by request, then some months later released an ALSA version. There's a preliminary xfi driver in OSS 4.x (and OSS still has a BSD compatible license), but it's far from complete [and the author is aware of this :)]. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 02:04:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C58AE106566B; Wed, 4 Jan 2012 02:04:20 +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 B01A88FC19; Wed, 4 Jan 2012 02:04: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 q0424KYO054583; Wed, 4 Jan 2012 02:04:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0424KwA054581; Wed, 4 Jan 2012 02:04:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201040204.q0424KwA054581@svn.freebsd.org> From: Xin LI Date: Wed, 4 Jan 2012 02:04: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: r229459 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 02:04:20 -0000 Author: delphij Date: Wed Jan 4 02:04:20 2012 New Revision: 229459 URL: http://svn.freebsd.org/changeset/base/229459 Log: Document the fact that chroot(2) is no longer part of POSIX since SUSv3 and add a SECURITY CONSIDERATIONS section for recommended practices. Modified: head/lib/libc/sys/chroot.2 Modified: head/lib/libc/sys/chroot.2 ============================================================================== --- head/lib/libc/sys/chroot.2 Wed Jan 4 02:03:15 2012 (r229458) +++ head/lib/libc/sys/chroot.2 Wed Jan 4 02:04:20 2012 (r229459) @@ -28,7 +28,7 @@ .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 3, 2012 .Dt CHROOT 2 .Os .Sh NAME @@ -134,9 +134,27 @@ The .Fn chroot system call appeared in .Bx 4.2 . +It was marked as +.Dq legacy +in +.St -susv2 , +and was removed in subsequent standards. .Sh BUGS If the process is able to change its working directory to the target directory, but another access control check fails (such as a check for open directories, or a MAC check), it is possible that this system call may return an error, with the working directory of the process left changed. +.Sh SECURITY CONSIDERATIONS +The system have many hardcoded paths to files where it may load after +the process starts. +It is generally recommended to drop privileges immediately after a +successful +.Nm +call, +and restrict write access to a limited subtree of the +.Nm +root, +for instance, +setup the sandbox so that the sandboxed user will have no write +access to any well-known system directories. From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 03:49:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17BFE106566B; Wed, 4 Jan 2012 03:49:42 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 026668FC0A; Wed, 4 Jan 2012 03:49: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 q043nfab058686; Wed, 4 Jan 2012 03:49:41 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q043nf8p058684; Wed, 4 Jan 2012 03:49:41 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201040349.q043nf8p058684@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 4 Jan 2012 03:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229462 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 03:49:42 -0000 Author: nyan Date: Wed Jan 4 03:49:41 2012 New Revision: 229462 URL: http://svn.freebsd.org/changeset/base/229462 Log: Fix 230MB MO support. Submitted by: Kaho Toshikazu MFC after: 1 week Modified: head/sys/boot/pc98/boot2/boot1.S Modified: head/sys/boot/pc98/boot2/boot1.S ============================================================================== --- head/sys/boot/pc98/boot2/boot1.S Wed Jan 4 03:37:41 2012 (r229461) +++ head/sys/boot/pc98/boot2/boot1.S Wed Jan 4 03:49:41 2012 (r229462) @@ -219,7 +219,7 @@ read: xor %ax,%ax jc read_load and $0xff7f,%si /* SCSI MO */ mov %di,%cx - shr $16,%di + shr $16,%edi mov %di,%dx jmp read_load read_fd: or $0xd000,%si From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 03:54:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2ED81065672; Wed, 4 Jan 2012 03:54:30 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC39D8FC12; Wed, 4 Jan 2012 03: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 q043sUtv058912; Wed, 4 Jan 2012 03:54:30 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q043sUPf058910; Wed, 4 Jan 2012 03:54:30 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201040354.q043sUPf058910@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 4 Jan 2012 03:54: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: r229463 - head/sys/boot/pc98/libpc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 03:54:30 -0000 Author: nyan Date: Wed Jan 4 03:54:30 2012 New Revision: 229463 URL: http://svn.freebsd.org/changeset/base/229463 Log: MFi386: revision 229435 Add special loader environment variables 'comconsole_port' and 'comconsole_pcidev'. MFC after: 2 weeks Modified: head/sys/boot/pc98/libpc98/comconsole.c Modified: head/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- head/sys/boot/pc98/libpc98/comconsole.c Wed Jan 4 03:49:41 2012 (r229462) +++ head/sys/boot/pc98/libpc98/comconsole.c Wed Jan 4 03:54:30 2012 (r229463) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libi386.h" #define COMC_FMT 0x3 /* 8N1 */ @@ -49,14 +50,23 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); static int comc_getspeed(void); +static void set_hw_console_hint(void); static int comc_ischar(void); -static int comc_parsespeed(const char *string); -static void comc_setup(int speed); +static int comc_parseint(const char *string); +static uint32_t comc_parse_pcidev(const char *string); +static int comc_pcidev_set(struct env_var *ev, int flags, + const void *value); +static int comc_pcidev_handle(uint32_t locator); +static int comc_port_set(struct env_var *ev, int flags, + const void *value); +static void comc_setup(int speed, int port); static int comc_speed_set(struct env_var *ev, int flags, const void *value); static int comc_started; static int comc_curspeed; +static int comc_port = COMPORT; +static uint32_t comc_locator; struct console comconsole = { "comconsole", @@ -72,9 +82,10 @@ struct console comconsole = { static void comc_probe(struct console *cp) { - char speedbuf[16]; - char *cons, *speedenv; - int speed; + char intbuf[16]; + char *cons, *env; + int speed, port; + uint32_t locator; /* XXX check the BIOS equipment list? */ cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); @@ -90,16 +101,40 @@ comc_probe(struct console *cp) getenv("boot_multicons") != NULL) { comc_curspeed = comc_getspeed(); } - speedenv = getenv("comconsole_speed"); - if (speedenv != NULL) { - speed = comc_parsespeed(speedenv); + + env = getenv("comconsole_speed"); + if (env != NULL) { + speed = comc_parseint(env); if (speed > 0) comc_curspeed = speed; } - sprintf(speedbuf, "%d", comc_curspeed); + sprintf(intbuf, "%d", comc_curspeed); unsetenv("comconsole_speed"); - env_setenv("comconsole_speed", EV_VOLATILE, speedbuf, comc_speed_set, + env_setenv("comconsole_speed", EV_VOLATILE, intbuf, comc_speed_set, + env_nounset); + + env = getenv("comconsole_port"); + if (env != NULL) { + port = comc_parseint(env); + if (port > 0) + comc_port = port; + } + + sprintf(intbuf, "%d", comc_port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, comc_port_set, + env_nounset); + + env = getenv("comconsole_pcidev"); + if (env != NULL) { + locator = comc_parse_pcidev(env); + if (locator != 0) + comc_pcidev_handle(locator); + } + + unsetenv("comconsole_pcidev"); + env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } } @@ -111,7 +146,7 @@ comc_init(int arg) return 0; comc_started = 1; - comc_setup(comc_curspeed); + comc_setup(comc_curspeed, comc_port); return(0); } @@ -122,8 +157,8 @@ comc_putchar(int c) int wait; for (wait = COMC_TXWAIT; wait > 0; wait--) - if (inb(COMPORT + com_lsr) & LSR_TXRDY) { - outb(COMPORT + com_data, (u_char)c); + if (inb(comc_port + com_lsr) & LSR_TXRDY) { + outb(comc_port + com_data, (u_char)c); break; } } @@ -131,13 +166,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(COMPORT + com_data) : -1); + return(comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(COMPORT + com_lsr) & LSR_RXRDY); + return(inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -145,13 +180,33 @@ comc_speed_set(struct env_var *ev, int f { int speed; - if (value == NULL || (speed = comc_parsespeed(value)) <= 0) { + if (value == NULL || (speed = comc_parseint(value)) <= 0) { printf("Invalid speed\n"); return (CMD_ERROR); } if (comc_started && comc_curspeed != speed) - comc_setup(speed); + comc_setup(speed, comc_port); + + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + + return (CMD_OK); +} + +static int +comc_port_set(struct env_var *ev, int flags, const void *value) +{ + int port; + + if (value == NULL || (port = comc_parseint(value)) <= 0) { + printf("Invalid port\n"); + return (CMD_ERROR); + } + + if (comc_started && comc_port != port) { + comc_setup(comc_curspeed, port); + set_hw_console_hint(); + } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -159,24 +214,126 @@ comc_speed_set(struct env_var *ev, int f } static void -comc_setup(int speed) +set_hw_console_hint(void) +{ + char intbuf[64]; + + unsetenv("hw.uart.console"); + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, + env_noset, env_nounset); +} + +/* + * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. + * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] + */ +static uint32_t +comc_parse_pcidev(const char *string) +{ + char *p, *p1; + uint8_t bus, dev, func, bar; + uint32_t locator; + int pres; + + pres = strtol(string, &p, 0); + if (p == string || *p != ':' || pres < 0 ) + return (0); + bus = pres; + p1 = ++p; + + pres = strtol(p1, &p, 0); + if (p == string || *p != ':' || pres < 0 ) + return (0); + dev = pres; + p1 = ++p; + + pres = strtol(p1, &p, 0); + if (p == string || (*p != ':' && *p != '\0') || pres < 0 ) + return (0); + func = pres; + + if (*p == ':') { + p1 = ++p; + pres = strtol(p1, &p, 0); + if (p == string || *p != '\0' || pres <= 0 ) + return (0); + bar = pres; + } else + bar = 0x10; + + locator = (bar << 16) | biospci_locator(bus, dev, func); + return (locator); +} + +static int +comc_pcidev_handle(uint32_t locator) +{ + char intbuf[64]; + uint32_t port; + + if (biospci_read_config(locator & 0xffff, + (locator & 0xff0000) >> 16, 2, &port) == -1) { + printf("Cannot read bar at 0x%x\n", locator); + return (CMD_ERROR); + } + if (!PCI_BAR_IO(port)) { + printf("Memory bar at 0x%x\n", locator); + return (CMD_ERROR); + } + port &= PCIM_BAR_IO_BASE; + + sprintf(intbuf, "%d", port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, + comc_port_set, env_nounset); + + comc_setup(comc_curspeed, port); + set_hw_console_hint(); + comc_locator = locator; + + return (CMD_OK); +} + +static int +comc_pcidev_set(struct env_var *ev, int flags, const void *value) +{ + uint32_t locator; + int error; + + if (value == NULL || (locator = comc_parse_pcidev(value)) <= 0) { + printf("Invalid pcidev\n"); + return (CMD_ERROR); + } + if (comc_started && comc_locator != locator) { + error = comc_pcidev_handle(locator); + if (error != CMD_OK) + return (error); + } + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + return (CMD_OK); +} + +static void +comc_setup(int speed, int port) { comc_curspeed = speed; + comc_port = port; - outb(COMPORT + com_cfcr, CFCR_DLAB | COMC_FMT); - outb(COMPORT + com_dlbl, COMC_BPS(speed) & 0xff); - outb(COMPORT + com_dlbh, COMC_BPS(speed) >> 8); - outb(COMPORT + com_cfcr, COMC_FMT); - outb(COMPORT + com_mcr, MCR_RTS | MCR_DTR); + outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); + outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); + outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8); + outb(comc_port + com_cfcr, COMC_FMT); + outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); do - inb(COMPORT + com_data); - while (inb(COMPORT + com_lsr) & LSR_RXRDY); + inb(comc_port + com_data); + while (inb(comc_port + com_lsr) & LSR_RXRDY); } static int -comc_parsespeed(const char *speedstr) +comc_parseint(const char *speedstr) { char *p; int speed; @@ -196,13 +353,13 @@ comc_getspeed(void) u_char dlbl; u_char cfcr; - cfcr = inb(COMPORT + com_cfcr); - outb(COMPORT + com_cfcr, CFCR_DLAB | cfcr); + cfcr = inb(comc_port + com_cfcr); + outb(comc_port + com_cfcr, CFCR_DLAB | cfcr); - dlbl = inb(COMPORT + com_dlbl); - dlbh = inb(COMPORT + com_dlbh); + dlbl = inb(comc_port + com_dlbl); + dlbh = inb(comc_port + com_dlbh); - outb(COMPORT + com_cfcr, cfcr); + outb(comc_port + com_cfcr, cfcr); divisor = dlbh << 8 | dlbl; From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 04:17:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9A20106566C; Wed, 4 Jan 2012 04:17:03 +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 93F838FC0A; Wed, 4 Jan 2012 04: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 q044H3x0060133; Wed, 4 Jan 2012 04:17:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q044H3YP060131; Wed, 4 Jan 2012 04:17:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201040417.q044H3YP060131@svn.freebsd.org> From: Adrian Chadd Date: Wed, 4 Jan 2012 04:17: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: r229464 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 04:17:03 -0000 Author: adrian Date: Wed Jan 4 04:17:03 2012 New Revision: 229464 URL: http://svn.freebsd.org/changeset/base/229464 Log: Add a couple more SPI flash device IDs found in commercial consumer wireless kit. Submitted by: Stefan Bethke Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Wed Jan 4 03:54:30 2012 (r229463) +++ head/sys/dev/flash/mx25l.c Wed Jan 4 04:17:03 2012 (r229464) @@ -101,7 +101,9 @@ struct mx25l_flash_ident flash_devices[] { "mx25ll64", 0xc2, 0x2017, 64 * 1024, 128, FL_NONE }, { "mx25ll128", 0xc2, 0x2018, 64 * 1024, 256, FL_ERASE_4K | FL_ERASE_32K }, { "s25fl128", 0x01, 0x2018, 64 * 1024, 256, FL_NONE }, + { "s25s1032", 0x01, 0x0215, 64 * 1024, 64, FL_NONE }, { "s25sl064a", 0x01, 0x0216, 64 * 1024, 128, FL_NONE }, + { "w25q64bv", 0xef, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, }; static uint8_t From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 07:01:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4700106566B; Wed, 4 Jan 2012 07:01:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEC108FC13; Wed, 4 Jan 2012 07:01: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 q0471Nkf065162; Wed, 4 Jan 2012 07:01:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0471NUl065160; Wed, 4 Jan 2012 07:01:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201040701.q0471NUl065160@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 4 Jan 2012 07:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229465 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:01:24 -0000 Author: glebius Date: Wed Jan 4 07:01:23 2012 New Revision: 229465 URL: http://svn.freebsd.org/changeset/base/229465 Log: Use correct locking when traversing interface address list. Reviewed by: bz Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Jan 4 04:17:03 2012 (r229464) +++ head/sys/netinet6/in6.c Wed Jan 4 07:01:23 2012 (r229465) @@ -2244,9 +2244,7 @@ in6_ifawithifp(struct ifnet *ifp, struct IF_ADDR_UNLOCK(ifp); return (besta); } - IF_ADDR_UNLOCK(ifp); - IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -2264,10 +2262,10 @@ in6_ifawithifp(struct ifnet *ifp, struct if (ifa != NULL) ifa_ref(ifa); - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); return (struct in6_ifaddr *)ifa; } - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); /* use the last-resort values, that are, deprecated addresses */ if (dep[0]) From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 07:04:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83973106566B; Wed, 4 Jan 2012 07:04:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E5478FC08; Wed, 4 Jan 2012 07: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 q0474iRc065301; Wed, 4 Jan 2012 07:04:44 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0474iIe065299; Wed, 4 Jan 2012 07:04:44 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201040704.q0474iIe065299@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jan 2012 07: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: r229466 - head/usr.sbin/mptable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:04:44 -0000 Author: pjd Date: Wed Jan 4 07:04:43 2012 New Revision: 229466 URL: http://svn.freebsd.org/changeset/base/229466 Log: Add an missing argument to open(2). If O_CREAT flag is specified, file permission has to be specified as well. Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c ============================================================================== --- head/usr.sbin/mptable/mptable.c Wed Jan 4 07:01:23 2012 (r229465) +++ head/usr.sbin/mptable/mptable.c Wed Jan 4 07:04:43 2012 (r229466) @@ -828,7 +828,7 @@ MPConfigTableHeader( u_int32_t pap ) int ofd; u_char dumpbuf[ 4096 ]; - ofd = open( "/tmp/mpdump", O_CREAT | O_RDWR ); + ofd = open( "/tmp/mpdump", O_CREAT | O_RDWR, 0666 ); seekEntry( paddr ); readEntry( dumpbuf, 1024 ); write( ofd, dumpbuf, 1024 ); From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 07:21:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7AE61065672; Wed, 4 Jan 2012 07:21:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2C378FC12; Wed, 4 Jan 2012 07:21: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 q047LbXO065868; Wed, 4 Jan 2012 07:21:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q047LbnF065866; Wed, 4 Jan 2012 07:21:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201040721.q047LbnF065866@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jan 2012 07:21: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: r229467 - head/usr.sbin/uhsoctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:21:38 -0000 Author: pjd Date: Wed Jan 4 07:21:37 2012 New Revision: 229467 URL: http://svn.freebsd.org/changeset/base/229467 Log: Add an missing argument to open(2). If O_CREAT flag is specified, file permission has to be specified as well. Modified: head/usr.sbin/uhsoctl/uhsoctl.c Modified: head/usr.sbin/uhsoctl/uhsoctl.c ============================================================================== --- head/usr.sbin/uhsoctl/uhsoctl.c Wed Jan 4 07:04:43 2012 (r229466) +++ head/usr.sbin/uhsoctl/uhsoctl.c Wed Jan 4 07:21:37 2012 (r229467) @@ -455,7 +455,7 @@ set_nameservers(struct ctx *ctx, const c free(ctx->ns); } - fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW); + fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666); if (fd < 0) return (-1); From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 07:25:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58886106566C; Wed, 4 Jan 2012 07:25:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439D18FC0A; Wed, 4 Jan 2012 07:25: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 q047PB33066020; Wed, 4 Jan 2012 07:25:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q047PBgS066018; Wed, 4 Jan 2012 07:25:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201040725.q047PBgS066018@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jan 2012 07:25: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: r229468 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:25:11 -0000 Author: pjd Date: Wed Jan 4 07:25:10 2012 New Revision: 229468 URL: http://svn.freebsd.org/changeset/base/229468 Log: Add missing file permission to open(O_CREAT) call. This doesn't really matter here, as we open /dev/null for test purposes, but it is useful for consistency and further grepping for such bugs. Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Wed Jan 4 07:21:37 2012 (r229467) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Wed Jan 4 07:25:10 2012 (r229468) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC | O_LARGEFILE | O_NOCTTY | O_NONBLOCK | O_NDELAY | O_RSYNC | - O_SYNC | O_TRUNC | O_XATTR); + O_SYNC | O_TRUNC | O_XATTR, 0666); fds[n++] = open(file, O_RDWR); (void) lseek(fds[n - 1], 123, SEEK_SET); From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 07:33:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8834B106566C; Wed, 4 Jan 2012 07:33:07 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7263C8FC17; Wed, 4 Jan 2012 07:33:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q047X7jM066301; Wed, 4 Jan 2012 07:33:07 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q047X7wK066297; Wed, 4 Jan 2012 07:33:07 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201201040733.q047X7wK066297@svn.freebsd.org> From: Fabien Thomas Date: Wed, 4 Jan 2012 07:33: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: r229469 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:33:07 -0000 Author: fabient Date: Wed Jan 4 07:33:06 2012 New Revision: 229469 URL: http://svn.freebsd.org/changeset/base/229469 Log: Add missing MSR programming for some events. Submitted by: Davide Italiano MFC after: 3 days Modified: head/sys/dev/hwpmc/hwpmc_uncore.c head/sys/dev/hwpmc/hwpmc_uncore.h head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.c Wed Jan 4 07:25:10 2012 (r229468) +++ head/sys/dev/hwpmc/hwpmc_uncore.c Wed Jan 4 07:33:06 2012 (r229469) @@ -545,8 +545,14 @@ static struct ucp_event_descr ucp_events UCPDESCR(0CH_01H, 0x0C, 0x01, UCP_F_FM | UCP_F_WM), UCPDESCR(0CH_02H, 0x0C, 0x02, UCP_F_FM | UCP_F_WM), - UCPDESCR(0CH_04H, 0x0C, 0x04, UCP_F_FM | UCP_F_WM), - UCPDESCR(0CH_08H, 0x0C, 0x08, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_04H_E, 0x0C, 0x04, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_04H_F, 0x0C, 0x04, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_04H_M, 0x0C, 0x04, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_04H_S, 0x0C, 0x04, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_08H_E, 0x0C, 0x08, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_08H_F, 0x0C, 0x08, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_08H_M, 0x0C, 0x08, UCP_F_FM | UCP_F_WM), + UCPDESCR(0CH_08H_S, 0x0C, 0x08, UCP_F_FM | UCP_F_WM), UCPDESCR(20H_01H, 0x20, 0x01, UCP_F_FM | UCP_F_I7 | UCP_F_WM), UCPDESCR(20H_02H, 0x20, 0x02, UCP_F_FM | UCP_F_I7 | UCP_F_WM), @@ -965,6 +971,36 @@ ucp_start_pmc(int cpu, int ri) PMCDBG(MDP,STA,2, "ucp-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x", cpu, ri, UCP_EVSEL0 + ri, evsel); + /* Event specific configuration. */ + switch (pm->pm_event) { + case PMC_EV_UCP_EVENT_0CH_04H_E: + wrmsr(MSR_GQ_SNOOP_MESF,0x2); + break; + case PMC_EV_UCP_EVENT_0CH_04H_F: + wrmsr(MSR_GQ_SNOOP_MESF,0x8); + break; + case PMC_EV_UCP_EVENT_0CH_04H_M: + wrmsr(MSR_GQ_SNOOP_MESF,0x1); + break; + case PMC_EV_UCP_EVENT_0CH_04H_S: + wrmsr(MSR_GQ_SNOOP_MESF,0x4); + break; + case PMC_EV_UCP_EVENT_0CH_08H_E: + wrmsr(MSR_GQ_SNOOP_MESF,0x2); + break; + case PMC_EV_UCP_EVENT_0CH_08H_F: + wrmsr(MSR_GQ_SNOOP_MESF,0x8); + break; + case PMC_EV_UCP_EVENT_0CH_08H_M: + wrmsr(MSR_GQ_SNOOP_MESF,0x1); + break; + case PMC_EV_UCP_EVENT_0CH_08H_S: + wrmsr(MSR_GQ_SNOOP_MESF,0x4); + break; + default: + break; + } + wrmsr(UCP_EVSEL0 + ri, evsel); do { Modified: head/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.h Wed Jan 4 07:25:10 2012 (r229468) +++ head/sys/dev/hwpmc/hwpmc_uncore.h Wed Jan 4 07:33:06 2012 (r229469) @@ -87,11 +87,18 @@ struct pmc_md_ucp_op_pmcallocate { #define UC_GLOBAL_CTRL 0x391 #define UC_GLOBAL_OVF_CTRL 0x393 + #define UC_GLOBAL_STATUS_FLAG_CLRCHG (1ULL << 63) #define UC_GLOBAL_STATUS_FLAG_OVFPMI (1ULL << 61) #define UC_GLOBAL_CTRL_FLAG_FRZ (1ULL << 63) #define UC_GLOBAL_CTRL_FLAG_ENPMICORE0 (1ULL << 48) +/* + * Model specific registers. + */ + +#define MSR_GQ_SNOOP_MESF 0x301 + struct pmc_md_ucf_pmc { uint64_t pm_ucf_ctrl; }; Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Wed Jan 4 07:25:10 2012 (r229468) +++ head/sys/dev/hwpmc/pmc_events.h Wed Jan 4 07:33:06 2012 (r229469) @@ -2388,8 +2388,14 @@ __PMC_EV(UCP, EVENT_0BH_10H) \ __PMC_EV(UCP, EVENT_0BH_1FH) \ __PMC_EV(UCP, EVENT_0CH_01H) \ __PMC_EV(UCP, EVENT_0CH_02H) \ -__PMC_EV(UCP, EVENT_0CH_04H) \ -__PMC_EV(UCP, EVENT_0CH_08H) \ +__PMC_EV(UCP, EVENT_0CH_04H_E) \ +__PMC_EV(UCP, EVENT_0CH_04H_F) \ +__PMC_EV(UCP, EVENT_0CH_04H_M) \ +__PMC_EV(UCP, EVENT_0CH_04H_S) \ +__PMC_EV(UCP, EVENT_0CH_08H_E) \ +__PMC_EV(UCP, EVENT_0CH_08H_F) \ +__PMC_EV(UCP, EVENT_0CH_08H_M) \ +__PMC_EV(UCP, EVENT_0CH_08H_S) \ __PMC_EV(UCP, EVENT_20H_01H) \ __PMC_EV(UCP, EVENT_20H_02H) \ __PMC_EV(UCP, EVENT_20H_04H) \ @@ -2789,8 +2795,14 @@ __PMC_EV_ALIAS("L3_LINES_OUT.F_STATE", U __PMC_EV_ALIAS("L3_LINES_OUT.ANY", UCP_EVENT_0BH_1FH) \ __PMC_EV_ALIAS("GQ_SNOOP.GOTO_S", UCP_EVENT_0CH_01H) \ __PMC_EV_ALIAS("GQ_SNOOP.GOTO_I", UCP_EVENT_0CH_02H) \ -__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT", UCP_EVENT_0CH_04H) \ -__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT", UCP_EVENT_0CH_08H) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_E", UCP_EVENT_0CH_04H_E) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_F", UCP_EVENT_0CH_04H_F) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_M", UCP_EVENT_0CH_04H_M) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_S", UCP_EVENT_0CH_04H_S) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_E", UCP_EVENT_0CH_08H_E) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_F", UCP_EVENT_0CH_08H_F) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_M", UCP_EVENT_0CH_08H_M) \ +__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_S", UCP_EVENT_0CH_08H_S) \ __PMC_EV_ALIAS("QHL_REQUESTS.IOH_READS", UCP_EVENT_20H_01H) \ __PMC_EV_ALIAS("QHL_REQUESTS.IOH_WRITES", UCP_EVENT_20H_02H) \ __PMC_EV_ALIAS("QHL_REQUESTS.REMOTE_READS", UCP_EVENT_20H_04H) \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 07:58:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40D02106564A; Wed, 4 Jan 2012 07:58:37 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 289EE8FC08; Wed, 4 Jan 2012 07:58: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 q047wbOl067078; Wed, 4 Jan 2012 07:58:37 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q047waQi067074; Wed, 4 Jan 2012 07:58:36 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201201040758.q047waQi067074@svn.freebsd.org> From: Fabien Thomas Date: Wed, 4 Jan 2012 07:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229470 - in head: lib/libpmc sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:58:37 -0000 Author: fabient Date: Wed Jan 4 07:58:36 2012 New Revision: 229470 URL: http://svn.freebsd.org/changeset/base/229470 Log: Update PMC events from October 2011 Intel documentation. Submitted by: Davide Italiano MFC after: 3 days Modified: head/lib/libpmc/pmc.corei7.3 head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/lib/libpmc/pmc.corei7.3 ============================================================================== --- head/lib/libpmc/pmc.corei7.3 Wed Jan 4 07:33:06 2012 (r229469) +++ head/lib/libpmc/pmc.corei7.3 Wed Jan 4 07:58:36 2012 (r229470) @@ -200,10 +200,6 @@ Number of cache load STLB hits .Pq Event 08H , Umask 20H Number of DTLB cache load misses where the low part of the linear to physical address translation was missed. -.It Li DTLB_LOAD_MISSES.PDP_MISS -.Pq Event 08H , Umask 40H -Number of DTLB cache load misses where the high part of the linear to -physical address translation was missed. .It Li DTLB_LOAD_MISSES.LARGE_WALK_COMPLETED .Pq Event 08H , Umask 80H Counts number of completed large page walks due to load miss in the STLB. @@ -646,10 +642,6 @@ Counter 0, 1 only Counts all data reads and writes (speculated and retired) from cacheable memory, including locked operations. Counter 0, 1 only -.It Li L1D_PEND_MISS.LOAD_BUFFERS_FULL -.Pq Event 48H , Umask 02H -Counts cycles of L1 data cache load fill buffers full. -Counter 0, 1 only .It Li DTLB_MISSES.ANY .Pq Event 49H , Umask 01H Counts the number of misses in the STLB which causes a page walk. @@ -660,6 +652,12 @@ Counts number of misses in the STLB whic .Pq Event 49H , Umask 10H Counts the number of DTLB first level misses that hit in the second level TLB. This event is only relevant if the core contains multiple DTLB levels. +.It Li DTLB_MISSES.PDE_MISS +.Pq Event 49H , Umask 20H +Number of DTLB misses caused by low part of address, includes references to 2M pages because 2M pages do not use the PDE. +.It Li DTLB_MISSES.LARGE_WALK_COMPLETED +.Pq Event 49H , Umask 80H +Counts number of misses in the STLB which resulted in a completed page walk for large pages. .It Li LOAD_HIT_PRE .Pq Event 4CH , Umask 01H Counts load operations sent to the L1 data cache while a previous SSE @@ -1205,9 +1203,6 @@ The BPU clear leads to 2 cycle bubble in .Pq Event E8H , Umask 02H Counts late Branch Prediction Unit clears due to Most Recently Used conflicts. The PBU clear leads to a 3 cycle bubble in the Front End. -.It Li BPU_CLEARS.ANY -.Pq Event E8H , Umask 03H -Counts all BPU clears. .It Li L2_TRANSACTIONS.LOAD .Pq Event F0H , Umask 01H Counts L2 load operations due to HW prefetch or demand loads. Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Wed Jan 4 07:33:06 2012 (r229469) +++ head/sys/dev/hwpmc/hwpmc_core.c Wed Jan 4 07:58:36 2012 (r229470) @@ -642,7 +642,7 @@ static struct iap_event_descr iap_events IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7), + IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O), IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7), IAPDESCR(09H_01H, 0x09, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), @@ -845,7 +845,7 @@ static struct iap_event_descr iap_events IAPDESCR(47H_00H, 0x47, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(48H_00H, 0x48, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7O), IAPDESCR(49H_00H, 0x49, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(49H_01H, 0x49, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -854,9 +854,9 @@ static struct iap_event_descr iap_events IAP_F_I7 | IAP_F_WM), IAPDESCR(49H_04H, 0x49, 0x04, IAP_F_FM | IAP_F_WM), IAPDESCR(49H_10H, 0x49, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7O), + IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7), IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O), - IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7O), + IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7), IAPDESCR(4BH_00H, 0x4B, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(4BH_01H, 0x4B, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7O), @@ -1306,7 +1306,7 @@ static struct iap_event_descr iap_events IAPDESCR(E8H_01H, 0xE8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(E8H_02H, 0xE8, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(E8H_03H, 0xE8, 0x03, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_03H, 0xE8, 0x03, IAP_F_FM | IAP_F_I7O), IAPDESCR(ECH_01H, 0xEC, 0x01, IAP_F_FM | IAP_F_WM), @@ -1454,7 +1454,6 @@ iap_event_corei7_ok_on_counter(enum pmc_ case PMC_EV_IAP_EVENT_42H_08H: case PMC_EV_IAP_EVENT_43H_01H: case PMC_EV_IAP_EVENT_43H_02H: - case PMC_EV_IAP_EVENT_48H_02H: case PMC_EV_IAP_EVENT_51H_01H: case PMC_EV_IAP_EVENT_51H_02H: case PMC_EV_IAP_EVENT_51H_04H: Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Wed Jan 4 07:33:06 2012 (r229469) +++ head/sys/dev/hwpmc/pmc_events.h Wed Jan 4 07:58:36 2012 (r229470) @@ -1669,7 +1669,7 @@ __PMC_EV_ALIAS("X87_OPS_RETIRED.FXCH", /* * Core i7 and Xeon 5500 events removed between 253669-031US June 2009 - * and 253669-033US December 2009. + * and 253669-040US October 2011. */ #define __PMC_EV_ALIAS_COREI7_OLD() \ __PMC_EV_ALIAS("SB_FORWARD.ANY", IAP_EVENT_02H_01H) \ @@ -1682,6 +1682,7 @@ __PMC_EV_ALIAS("MISALIGN_MEM_REF.ANY", I __PMC_EV_ALIAS("STORE_BLOCKS.NOT_STA", IAP_EVENT_06H_01H) \ __PMC_EV_ALIAS("STORE_BLOCKS.STA", IAP_EVENT_06H_02H) \ __PMC_EV_ALIAS("STORE_BLOCKS.ANY", IAP_EVENT_06H_0FH) \ +__PMC_EV_ALIAS("DTLB_LOAD_MISSES.PDP_MISS", IAP_EVENT_08H_40H) \ __PMC_EV_ALIAS("MEMORY_DISAMBIGURATION.RESET", IAP_EVENT_09H_01H) \ __PMC_EV_ALIAS("MEMORY_DISAMBIGURATION.SUCCESS", IAP_EVENT_09H_02H) \ __PMC_EV_ALIAS("MEMORY_DISAMBIGURATION.WATCHDOG", IAP_EVENT_09H_04H) \ @@ -1693,9 +1694,8 @@ __PMC_EV_ALIAS("L2_WRITE.RFO.E_STATE", I __PMC_EV_ALIAS("UOPS_DECODED.DEC0", IAP_EVENT_3DH_01H) \ __PMC_EV_ALIAS("L1D_CACHE_ST.I_STATE", IAP_EVENT_41H_01H) \ __PMC_EV_ALIAS("L1D_CACHE_ST.MESI", IAP_EVENT_41H_0FH) \ -__PMC_EV_ALIAS("DTLB_MISSES.PDE_MISS", IAP_EVENT_49H_20H) \ +__PMC_EV_ALIAS("L1D_PEND_MISS.LOAD_BUFFERS_FULL", IAP_EVENT_48H_02H) \ __PMC_EV_ALIAS("DTLB_MISSES.PDP_MISS", IAP_EVENT_49H_40H) \ -__PMC_EV_ALIAS("DTLB_MISSES.LARGE_WALK_COMPLETED", IAP_EVENT_49H_80H) \ __PMC_EV_ALIAS("SSE_MEM_EXEC.NTA", IAP_EVENT_4BH_01H) \ __PMC_EV_ALIAS("SSE_MEM_EXEC.STREAMING_STORES", IAP_EVENT_4BH_08H) \ __PMC_EV_ALIAS("SFENCE_CYCLES", IAP_EVENT_4DH_01H) \ @@ -1734,6 +1734,7 @@ __PMC_EV_ALIAS("PIC_ACCESSES.TPR_READS", __PMC_EV_ALIAS("PIC_ACCESSES.TPR_WRITES", IAP_EVENT_BAH_02H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.FUSION_ASSIST", IAP_EVENT_C3H_10H) \ __PMC_EV_ALIAS("BOGUS_BR", IAP_EVENT_E4H_01H) \ +__PMC_EV_ALIAS("BPU_CLEARS.ANY", IAP_EVENT_E8H_03H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.HIT", IAP_EVENT_F3H_01H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.ALLOC", IAP_EVENT_F3H_02H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.DATA_TRIGGER", IAP_EVENT_F3H_04H) \ @@ -1759,7 +1760,6 @@ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.ANY", I __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED", IAP_EVENT_08H_02H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT", IAP_EVENT_08H_10H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.PDE_MISS", IAP_EVENT_08H_20H) \ -__PMC_EV_ALIAS("DTLB_LOAD_MISSES.PDP_MISS", IAP_EVENT_08H_40H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.LARGE_WALK_COMPLETED", \ IAP_EVENT_08H_80H) \ __PMC_EV_ALIAS("MEM_INST_RETIRED.LOADS", IAP_EVENT_0BH_01H) \ @@ -1867,10 +1867,11 @@ __PMC_EV_ALIAS("L1D_CACHE_LOCK.E_STATE", __PMC_EV_ALIAS("L1D_CACHE_LOCK.M_STATE", IAP_EVENT_42H_08H) \ __PMC_EV_ALIAS("L1D_ALL_REF.ANY", IAP_EVENT_43H_01H) \ __PMC_EV_ALIAS("L1D_ALL_REF.CACHEABLE", IAP_EVENT_43H_02H) \ -__PMC_EV_ALIAS("L1D_PEND_MISS.LOAD_BUFFERS_FULL", IAP_EVENT_48H_02H) \ __PMC_EV_ALIAS("DTLB_MISSES.ANY", IAP_EVENT_49H_01H) \ __PMC_EV_ALIAS("DTLB_MISSES.WALK_COMPLETED", IAP_EVENT_49H_02H) \ __PMC_EV_ALIAS("DTLB_MISSES.STLB_HIT", IAP_EVENT_49H_10H) \ +__PMC_EV_ALIAS("DTLB_MISSES.PDE_MISS", IAP_EVENT_49H_20H) \ +__PMC_EV_ALIAS("DTLB_MISSES.LARGE_WALK_COMPLETED", IAP_EVENT_49H_80H) \ __PMC_EV_ALIAS("LOAD_HIT_PRE", IAP_EVENT_4CH_01H) \ __PMC_EV_ALIAS("L1D_PREFETCH.REQUESTS", IAP_EVENT_4EH_01H) \ __PMC_EV_ALIAS("L1D_PREFETCH.MISS", IAP_EVENT_4EH_02H) \ @@ -1996,7 +1997,6 @@ __PMC_EV_ALIAS("BACLEAR.CLEAR", IAP_EVEN __PMC_EV_ALIAS("BACLEAR.BAD_TARGET", IAP_EVENT_E6H_02H) \ __PMC_EV_ALIAS("BPU_CLEARS.EARLY", IAP_EVENT_E8H_01H) \ __PMC_EV_ALIAS("BPU_CLEARS.LATE", IAP_EVENT_E8H_02H) \ -__PMC_EV_ALIAS("BPU_CLEARS.ANY", IAP_EVENT_E8H_03H) \ __PMC_EV_ALIAS("L2_TRANSACTIONS.LOAD", IAP_EVENT_F0H_01H) \ __PMC_EV_ALIAS("L2_TRANSACTIONS.RFO", IAP_EVENT_F0H_02H) \ __PMC_EV_ALIAS("L2_TRANSACTIONS.IFETCH", IAP_EVENT_F0H_04H) \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 08:54:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F17631065673; Wed, 4 Jan 2012 08:54:59 +0000 (UTC) (envelope-from joel@freebsd.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 9BC9C8FC12; Wed, 4 Jan 2012 08:54:59 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 8E6E3E3F07A; Wed, 4 Jan 2012 09:54:58 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R2+XXgqKZrsw; Wed, 4 Jan 2012 09:54:56 +0100 (CET) Received: from goofy01.vnodelab.local (unknown [212.247.52.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 84CF0E3F079; Wed, 4 Jan 2012 09:54:55 +0100 (CET) Date: Wed, 4 Jan 2012 09:54:53 +0100 From: Joel Dahl To: John Baldwin Message-ID: <20120104085453.GD61584@goofy01.vnodelab.local> References: <201201032104.q03L4sTm043158@svn.freebsd.org> <201201031615.06873.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201031615.06873.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 08:55:00 -0000 On 03-01-2012 16:15, John Baldwin wrote: > On Tuesday, January 03, 2012 4:04:54 pm Pedro F. Giffuni wrote: > > Author: pfg > > Date: Tue Jan 3 21:04:54 2012 > > New Revision: 229430 > > URL: http://svn.freebsd.org/changeset/base/229430 > > > > Log: > > Replace a GPL'd header in the emu10k1 snd driver code. > > > > This brings in the emuxkireg.h from NetBSD (dev/pci) which > > is used for the same purpose but is smaller. The emu10k1 > > is now free from the GPL. > > Is this a common-enough chipset to enable in GENERIC now that it is safe to > do so? I think so, but I also think we should decide what to do with emu10kx (if anything) as I suspect it will remain GPL polluted. The emu10k1 and emu10kx drivers essentially support the same hardware, with a few exceptions (if memory serves me right -- I think there are a few cards that emu10kx does not support, someone should check with Yuriy). However, emu10kx has a few nice features like optional multichannel and MIDI I/O support... -- Joel From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 11:07:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C58E51065673; Wed, 4 Jan 2012 11:07:15 +0000 (UTC) Date: Wed, 4 Jan 2012 11:07:15 +0000 From: Alexey Dokuchaev To: Joel Dahl Message-ID: <20120104110715.GB3811@FreeBSD.org> References: <201201032104.q03L4sTm043158@svn.freebsd.org> <201201031615.06873.jhb@freebsd.org> <20120104085453.GD61584@goofy01.vnodelab.local> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120104085453.GD61584@goofy01.vnodelab.local> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 11:07:15 -0000 On Wed, Jan 04, 2012 at 09:54:53AM +0100, Joel Dahl wrote: > The emu10k1 and emu10kx drivers essentially support the same hardware, with > a few exceptions (if memory serves me right -- I think there are a few cards > that emu10kx does not support, someone should check with Yuriy). However, > emu10kx has a few nice features like optional multichannel and MIDI I/O > support... How hard would it be to (re)implement missing features with emu10k1 and nuke GPL-polluted emu10kx? ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 12:55:15 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D29F10656E4; Wed, 4 Jan 2012 12:55:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 040038FC23; Wed, 4 Jan 2012 12:55:14 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q04Ct5UV002978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Jan 2012 23:55:08 +1100 Date: Wed, 4 Jan 2012 23:55:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <20120103182020.GH1895@hoeg.nl> Message-ID: <20120104214707.Q1935@besplex.bde.org> References: <201201030714.q037E2qq010125@svn.freebsd.org> <20120104013401.S6960@besplex.bde.org> <20120103182020.GH1895@hoeg.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: r229368 - in head: lib/libc lib/libc/arm/string lib/libc/i386/string lib/libc/mips/string lib/libc/string lib/libstand sys/boot/userboot/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 12:55:15 -0000 On Tue, 3 Jan 2012, Ed Schouten wrote: > * Bruce Evans , 20120103 16:49: >> This breaks the Standard C namespace. When they are in the same object >> file, there is no way to get the standard name without getting the >> nonstandard name. So the following C-standard-conforming C program >> now gets a linkage error (multiple definition of `index'), at least with >> static linkage: >> >> #include >> int index; >> void foo(const char *p) { return strchr(p, '1'); } > > Though I sympathize, this problem is not just limited to strchr(). There > are other portions of the C library that use index() as well. For > example, if you use , ttyslot(), one of the exec*() functions > or the NIS functions, you already get index() linked into your binary. These are standard C or very often used parts of libc though. Your change gives the bizarre behaviour that any use of strchr() by an application prevents all uses of index by the application (except calling the library index()), while the only point of of cleaning up libraries to not use index() is to allow applications to use it for whatever they want. >> [...] and the C >> standard might require memcpy and memmove to have different addresses. > > I just skimmed through the standard, and if I haven't overlooked > anything, no such requirement is made. Also, I can imagine a compiler > with good support for link-time optimisation can already merge equal > pieces of code together, making it even harder to reason about > inequality of function addresses. > > Still, I am willing to address the issues you raised. index() and > rindex() aren't that important nowadays and I have a patchset ready in > my home directory that converts almost all apps in the base system to > use strchr() anyway. > > As I don't feel like polluting the MI strchr() implementations with > index()/rindex() support, would it be okay if I implement index() and > rindex() as simple C functions that call into strchr() and strrchr()? Just use a weak symbol. This is good enough for hundreds or thousands or existing aliases. I did a quick check what gprof does with the alises. It seems to be random. gprof reports that the symbol for open(2) is `open', irrespective of whether I spell it `open' or _open in the source code. OTOH, gprof reports that the symbol for vfscanf(3) is __vfscanf, irrespective of whether I spell it vfscanf or __vfscanf in the source code. The object code contains both symbols of course (after linking to libc). I think gprof just picks one of the symbols semi-randomly (for these 2 pairs, it uses the last symbol in symbol table order). To do the right thing, the object linked object code would have to contain a hint about which symbol the application used (which is only possible if the application only used 1 of the aliases), and gprof would have to understand the hint. I think there is no such hint. To do the next best thing, gprof would have to prefer the non-weak symbol. Is this possible? nm output doesn't distinguish the symbols. I tried doing something using chained aliases with a weak link, and only found lots of bugs. E.g.: % #include % % /* % * XXX __strong_alias() is unusable since it acts at the C level, but our % * intermediate symbol only exists at the asm level. % */ % #undef __strong_reference % #define __strong_reference(sym, alias) \ % __asm(".global " #alias); \ % __asm(#alias " = " #sym) % % void xstrchr(void) {} % % __weak_reference(xstrchr, __xindex); % __strong_reference(__xindex, xindex); This reimplementation of __strong_reference() worked like I wanted (on i386), but the chain didn't do anything interesting or fix gprof. I copied it from the STRONG_ALIAS() that you added in i386/include/asm.h, except STRONG_ALIAS() has the parameters reversed relative to all the macros in cdefs.h. STRONG_ALIAS() only exists on mips and now i386. The section that defines symbol macros in cdefs.h has lots of bugs: - wrong conditional. Old versions of gcc don't support the attribute that it uses, or __attribute__(()) at all. - __strong_reference() is only defined for !__INTEL_COMPILER. It is now used unconditionally in libc (in ptsname.c alone). Thus, icc cannot possibly compile libc. The above reemplmentation of __strong_reference() may be less unportable. All of these symbol definitions are unportable and don't belong in MI cdefs.h. They assume a particular dialect of asm and much more. But they are portable enough in practice since we only use the gas dialect. The rest are just style bugs: - no space after commas in parameter lists. The !STDC or the !ELF case may need this. Otherwise, it is just a style bug (copied from the older !ELF code). The !STDC case has probably never been used in FreeBSD. Both subcases of the ELF case were added in 1998 just before K&R support started being dismantled. Some !STDC support remains. But ELF support was removed soon after. I think it is only the removed !ELF && !STDC case that needs to misformat the parameter lists, since IIRC spaces in the list get into parameters for STDC, and this matters for !ELF since we want to add a prefix of `_' to symbol names. - __asm is misspelled __asm__ - there is a tab instead of a space before the comments on #endif's. More on the above reimplementation of __strong_reference(): here it is again: % #define __strong_reference(sym, alias) \ % __asm(".global " #alias); \ % __asm(#alias " = " #sym) I remembered that I can never remember the difference between "=" and "equ". In fact, there seems to be no difference, and "=" is just an alternative spelling with a difference syntax for the ".equ" directive. Using ".equ" is safer because "=" might be an arithmetic operator. And in cdefs.h, using "=" is a style bug because all other places (just the 2 implementations of __weak_reference()) use ".equ". Changing the above to use ".equ" as in __weak_reference gives: #define __strong_reference(sym, alias) \ __asm(".global " #alias); \ __asm(".equ " #alias ", " #sym) Now the only difference between __strong_reference() and the STDC __weak_reference() are: - one declares #alias as .global and the other declares it as .weak. Oops, I forgot to fix the misspelling of .globl as .global. It is spelled traditionally (to satisfy the limit of 6 characters in identifiers) in all instances in amd64 and mips, and in all places in i386 except in STRONG_REFERENCE(). The rest are just style differences: - I didn't duplicate the fancy formatting that puts extra spaces in the source code to line up the '#alias's. These should really be tabs to line up the symbols in the asm output, but tabs in strings in source code are even harder to format well (they should be spelled \t, but the macros are hard enough to read already. - I didn't duplicate the misspelling of __asm as __asm__. So it seems that __strong_reference() can be implemented in a way that is identically unportable to __weak_reference(). Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 13:23:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484A6106566B; Wed, 4 Jan 2012 13:23:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3734B8FC12; Wed, 4 Jan 2012 13:23: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 q04DNqC8079597; Wed, 4 Jan 2012 13:23:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04DNppc079595; Wed, 4 Jan 2012 13:23:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201041323.q04DNppc079595@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jan 2012 13:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229476 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 13:23:52 -0000 Author: jhb Date: Wed Jan 4 13:23:51 2012 New Revision: 229476 URL: http://svn.freebsd.org/changeset/base/229476 Log: Fix the SIOC[DG]LIFADDR ioctls in in_lifaddr_ioctl() to work with IPv4 interface address rather than IPv6. Submitted by: hrs Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 4 12:54:35 2012 (r229475) +++ head/sys/netinet/in.c Wed Jan 4 13:23:51 2012 (r229476) @@ -735,7 +735,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo if (iflr->flags & IFLR_PREFIX) return (EINVAL); - /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN6). */ + /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR). */ bzero(&ifra, sizeof(ifra)); bcopy(iflr->iflr_name, ifra.ifra_name, sizeof(ifra.ifra_name)); @@ -785,7 +785,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != AF_INET6) + if (ifa->ifa_addr->sa_family != AF_INET) continue; if (match.s_addr == 0) break; @@ -817,7 +817,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } else { struct in_aliasreq ifra; - /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN6) */ + /* fill in_aliasreq and do ioctl(SIOCDIFADDR) */ bzero(&ifra, sizeof(ifra)); bcopy(iflr->iflr_name, ifra.ifra_name, sizeof(ifra.ifra_name)); From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 13:26:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88E97106564A; Wed, 4 Jan 2012 13:26:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77E368FC13; Wed, 4 Jan 2012 13:26:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q04DQvlO079719; Wed, 4 Jan 2012 13:26:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04DQv1k079717; Wed, 4 Jan 2012 13:26:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201041326.q04DQv1k079717@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jan 2012 13:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229477 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 13:26:57 -0000 Author: jhb Date: Wed Jan 4 13:26:56 2012 New Revision: 229477 URL: http://svn.freebsd.org/changeset/base/229477 Log: In the handling of the SIOC[DG]LIFADDR icotls in in_lifaddr_ioctl(), add missing interface address list locking and grab a reference on the matching interface address after dropping the lock while it is used to avoid a potential use after free. Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 4 13:23:51 2012 (r229476) +++ head/sys/netinet/in.c Wed Jan 4 13:26:56 2012 (r229477) @@ -784,6 +784,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } } + IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET) continue; @@ -794,6 +795,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo if (candidate.s_addr == match.s_addr) break; } + if (ifa != NULL) + ifa_ref(ifa); + IF_ADDR_UNLOCK(ifp); if (ifa == NULL) return (EADDRNOTAVAIL); ia = (struct in_ifaddr *)ifa; @@ -812,6 +816,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo in_mask2len(&ia->ia_sockmask.sin_addr); iflr->flags = 0; /*XXX*/ + ifa_free(ifa); return (0); } else { @@ -830,6 +835,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } bcopy(&ia->ia_sockmask, &ifra.ifra_dstaddr, ia->ia_sockmask.sin_len); + ifa_free(ifa); return (in_control(so, SIOCDIFADDR, (caddr_t)&ifra, ifp, td)); From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 13:29:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBBFB106566B; Wed, 4 Jan 2012 13:29:26 +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 DAEBB8FC08; Wed, 4 Jan 2012 13:29: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 q04DTQZp079826; Wed, 4 Jan 2012 13:29:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04DTQc7079824; Wed, 4 Jan 2012 13:29:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201041329.q04DTQc7079824@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jan 2012 13:29: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: r229478 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 13:29:27 -0000 Author: jhb Date: Wed Jan 4 13:29:26 2012 New Revision: 229478 URL: http://svn.freebsd.org/changeset/base/229478 Log: Use a helper variable to wrap a long line. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 4 13:26:56 2012 (r229477) +++ head/sys/netinet/in.c Wed Jan 4 13:29:26 2012 (r229478) @@ -790,7 +790,8 @@ in_lifaddr_ioctl(struct socket *so, u_lo continue; if (match.s_addr == 0) break; - candidate.s_addr = ((struct sockaddr_in *)&ifa->ifa_addr)->sin_addr.s_addr; + sin = (struct sockaddr_in *)&ifa->ifa_addr; + candidate.s_addr = sin->sin_addr.s_addr; candidate.s_addr &= mask.s_addr; if (candidate.s_addr == match.s_addr) break; From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 13:35:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A54106567A; Wed, 4 Jan 2012 13:35: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 6BEB88FC0C; Wed, 4 Jan 2012 13:35: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 q04DZLVe080058; Wed, 4 Jan 2012 13:35:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04DZLen080056; Wed, 4 Jan 2012 13:35:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201041335.q04DZLen080056@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jan 2012 13:35: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: r229479 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 13:35:21 -0000 Author: jhb Date: Wed Jan 4 13:35:20 2012 New Revision: 229479 URL: http://svn.freebsd.org/changeset/base/229479 Log: Use the mli_relinmhead list normally used to defer calls to in6m_release_locked() to defer calls to mld_v1_transmit_report() until after the IF_ADDR_LOCK is dropped. This removes a race where the lock is dropped and reacquired while attempting to walk an interface's address list. Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Wed Jan 4 13:29:26 2012 (r229478) +++ head/sys/netinet6/mld6.c Wed Jan 4 13:35:20 2012 (r229479) @@ -121,7 +121,8 @@ static int mld_v1_input_query(struct ifn /*const*/ struct mld_hdr *); static int mld_v1_input_report(struct ifnet *, const struct ip6_hdr *, /*const*/ struct mld_hdr *); -static void mld_v1_process_group_timer(struct in6_multi *, const int); +static void mld_v1_process_group_timer(struct mld_ifinfo *, + struct in6_multi *); static void mld_v1_process_querier_timers(struct mld_ifinfo *); static int mld_v1_transmit_report(struct in6_multi *, const int); static void mld_v1_update_group(struct in6_multi *, const int); @@ -1336,8 +1337,8 @@ mld_fasttimo_vnet(void) struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; struct mld_ifinfo *mli; - struct ifmultiaddr *ifma, *tifma; - struct in6_multi *inm; + struct ifmultiaddr *ifma; + struct in6_multi *inm, *tinm; int uri_fasthz; uri_fasthz = 0; @@ -1401,24 +1402,14 @@ mld_fasttimo_vnet(void) } IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, - tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6 || ifma->ifma_protospec == NULL) continue; inm = (struct in6_multi *)ifma->ifma_protospec; switch (mli->mli_version) { case MLD_VERSION_1: - /* - * XXX Drop IF_ADDR lock temporarily to - * avoid recursion caused by a potential - * call by in6ifa_ifpforlinklocal(). - * rwlock candidate? - */ - IF_ADDR_UNLOCK(ifp); - mld_v1_process_group_timer(inm, - mli->mli_version); - IF_ADDR_LOCK(ifp); + mld_v1_process_group_timer(mli, inm); break; case MLD_VERSION_2: mld_v2_process_group_timers(mli, &qrq, @@ -1428,9 +1419,25 @@ mld_fasttimo_vnet(void) } IF_ADDR_UNLOCK(ifp); - if (mli->mli_version == MLD_VERSION_2) { - struct in6_multi *tinm; - + switch (mli->mli_version) { + case MLD_VERSION_1: + /* + * Transmit reports for this lifecycle. This + * is done while not holding IF_ADDR_LOCK + * since this can call + * in6ifa_ifpforlinklocal() which locks + * IF_ADDR_LOCK internally as well as + * ip6_output() to transmit a packet. + */ + SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, + in6m_nrele, tinm) { + SLIST_REMOVE_HEAD(&mli->mli_relinmhead, + in6m_nrele); + (void)mld_v1_transmit_report(inm, + MLD_LISTENER_REPORT); + } + break; + case MLD_VERSION_2: mld_dispatch_queue(&qrq, 0); mld_dispatch_queue(&scq, 0); @@ -1444,6 +1451,7 @@ mld_fasttimo_vnet(void) in6m_nrele); in6m_release_locked(inm); } + break; } } @@ -1457,7 +1465,7 @@ out_locked: * Will update the global pending timer flags. */ static void -mld_v1_process_group_timer(struct in6_multi *inm, const int version) +mld_v1_process_group_timer(struct mld_ifinfo *mli, struct in6_multi *inm) { int report_timer_expired; @@ -1484,8 +1492,8 @@ mld_v1_process_group_timer(struct in6_mu case MLD_REPORTING_MEMBER: if (report_timer_expired) { inm->in6m_state = MLD_IDLE_MEMBER; - (void)mld_v1_transmit_report(inm, - MLD_LISTENER_REPORT); + SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm, + in6m_nrele); } break; case MLD_G_QUERY_PENDING_MEMBER: From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 13:58:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 661F11065670 for ; Wed, 4 Jan 2012 13:58:12 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm4.bullet.mail.sp2.yahoo.com (nm4.bullet.mail.sp2.yahoo.com [98.139.91.74]) by mx1.freebsd.org (Postfix) with SMTP id 3D1658FC18 for ; Wed, 4 Jan 2012 13:58:12 +0000 (UTC) Received: from [98.139.91.68] by nm4.bullet.mail.sp2.yahoo.com with NNFMP; 04 Jan 2012 13:58:12 -0000 Received: from [98.139.91.17] by tm8.bullet.mail.sp2.yahoo.com with NNFMP; 04 Jan 2012 13:58:12 -0000 Received: from [127.0.0.1] by omp1017.mail.sp2.yahoo.com with NNFMP; 04 Jan 2012 13:58:12 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 5479.44599.bm@omp1017.mail.sp2.yahoo.com Received: (qmail 643 invoked by uid 60001); 4 Jan 2012 13:58:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1325685490; bh=zYNZgQ0Oijtvf3Mh/hiPTF8b30X3C5TeDP6ejwTseqI=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=kBW7pZXBTkBCJyziGafq1n5EDw82+P0sr0JPbdN4Y4NTvCZZuEki62/OLkTSJrtEO7waAf9rGhG3wMAaahArvAt2bfQeYXZO/W8GXcl8Jc2BK1UnGeKjGEfug5G1JoRwt/+K4JUngAOpb4xtiQ4Tez8eTbstAhMQa4znOh1JDu4= X-YMail-OSG: dB7t2lsVM1kT92iZu6hm6kj1wur2Jq2IUX3hoBVWkeuMa2i y3QeWpdQeWlI4mOssaWNRZnCXc1VZNp_4GUBaPF_YKT4liKiRm4tUjj4nSYW 5k0S5S_jObbMSgyIh.uh49j2EP2fpx0vnOtSaEwVtcBE_4pwCk.bfioLHO8A Ax1DGfUd69e9X3BOo65SjQb_UJPxil.WsHtsZA6cJ1WOxzK6xCuBfam5eQ7O ykf_gPSzIOUruMgqg2dZclAq.DJV.xLg3Aqe3WUnO46xuQP8AmIQ6__anA2L r3YBCxjUWjXFuxZ0WIHrvfKqtaOYj79FAgqcBooZE.Cc1BOyqbW9zeePTFVE 6mdQvMX5AyWnpdc2EHFX5xOcnfZTS7Legw8I2ZOXGpvr1Z5iYLVwBKTZMJab bpn9nnOMD8GPmMNTdyzBDOGbnN3N_Maiki2b._FGl0D2x6IxooPIFtr4HrzE _D1_6UU9zuNJOTEz8ZFaq77Po_g-- Received: from [200.118.157.7] by web113511.mail.gq1.yahoo.com via HTTP; Wed, 04 Jan 2012 05:58:10 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1325685490.99537.YahooMailClassic@web113511.mail.gq1.yahoo.com> Date: Wed, 4 Jan 2012 05:58:10 -0800 (PST) From: Pedro Giffuni To: Joel Dahl , Alexey Dokuchaev In-Reply-To: <20120104110715.GB3811@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 13:58:12 -0000 Hello;=0A=0A--- Mer 4/1/12, Alexey Dokuchaev ha scritto= :=0A=0A...=0A> =0A> How hard would it be to (re)implement missing features = with=0A> emu10k1 and nuke GPL-polluted emu10kx?=0A> =0A=0AThe emu10kx start= ed from the emu10k1 and is mostly BSD licensed,=0AI did start cleaning it i= n kern/153901 but I didn't commit the=0Athe emu10kx part.=0A=0AThe only iss= ue is getting rid of the remaining (small)=0AGPL'd headers. Alternatively t= his driver is already available=0Aas a port (audio/emu10kx).=0A=0Acheers,= =0A=0APedro.=0A From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 14:11:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1552C1065673; Wed, 4 Jan 2012 14:11:42 +0000 (UTC) Date: Wed, 4 Jan 2012 14:11:42 +0000 From: Alexey Dokuchaev To: Pedro Giffuni Message-ID: <20120104141141.GA34976@FreeBSD.org> References: <20120104110715.GB3811@FreeBSD.org> <1325685490.99537.YahooMailClassic@web113511.mail.gq1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <1325685490.99537.YahooMailClassic@web113511.mail.gq1.yahoo.com> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , Joel Dahl Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 14:11:42 -0000 On Wed, Jan 04, 2012 at 05:58:10AM -0800, Pedro Giffuni wrote: > --- Mer 4/1/12, Alexey Dokuchaev ha scritto: > > How hard would it be to (re)implement missing features with > > emu10k1 and nuke GPL-polluted emu10kx? > > The emu10kx started from the emu10k1 and is mostly BSD licensed, > I did start cleaning it in kern/153901 but I didn't commit the > the emu10kx part. > > The only issue is getting rid of the remaining (small) > GPL'd headers. Alternatively this driver is already available > as a port (audio/emu10kx). Yes, I am aware of the port existence. My point was to leave just one, BSD licensed, full featured emu10k driver in the base (i.e. merge emu10k1 and emu10kx into one). Good to know that you're up to this; I hope we'll get there eventually. :-) ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 14:25:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 520541065673 for ; Wed, 4 Jan 2012 14:25:25 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm40-vm7.bullet.mail.ne1.yahoo.com (nm40-vm7.bullet.mail.ne1.yahoo.com [98.138.229.183]) by mx1.freebsd.org (Postfix) with SMTP id D5BEF8FC19 for ; Wed, 4 Jan 2012 14:25:24 +0000 (UTC) Received: from [98.138.90.55] by nm40.bullet.mail.ne1.yahoo.com with NNFMP; 04 Jan 2012 14:25:24 -0000 Received: from [98.138.89.194] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 04 Jan 2012 14:25:24 -0000 Received: from [127.0.0.1] by omp1052.mail.ne1.yahoo.com with NNFMP; 04 Jan 2012 14:25:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 240062.54102.bm@omp1052.mail.ne1.yahoo.com Received: (qmail 14559 invoked by uid 60001); 4 Jan 2012 14:25:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1325687123; bh=UHIfQtXJ7B73g6+PbhmUlA6fdgwjitz1KOxS3cg1Ymc=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=WcT8gAC4j+GBf2TtHFLbk/VvUegxxVAvlBenuat7fbmamofqLeG7ZNfVptdOK1FqfJ+0h8kFhdm/yS5xpYA4nTcMNr9jZeKayuRlmAAZe8lJKJDbnCreZ/FuRE6//UxxbGDQPYjRP7CJbTfWinu9WgZgGOf0FgpqaH/5W3xILxc= X-YMail-OSG: 3z8yXZQVM1mfrIY4uGhBgaOjrcJuqEpYDqGtXw82HRHO_uX g0VFmP8PDVszKN9Xzghd5U8VvBHyCHeC0fhipYzwKfdyapOnBiI8P_EdYB.t y7anN.avN_gVZNbD79LRQvi8tJZ1qvtqKZRDBsT6Np1.nvP8ps5eZS5XJCrt Hp0TdQVHIJUHdvSfAkpp_VSGRHCwX1WBtsAiJo6o4j.UgA3KMelwGr1kF.99 IHbo0s7842jpokC8PH4AzviT1lvl6S7jMcrH2iTcoB3nKhX6Obf0Z.xmaV5M _hKls9XGEjnHQcdhn56rb.NLgz8.uS4j_q80X45xpVkAbTGS8v6O_55kDI2S TPOAFBmhE9kUa3ysMnU1_QAXanZlZ1ZBYegsKDL2_IGesMwYuj_ATvJb.oh1 zGOHdU53Sgt2DqXVv8eKdvaUCQNgOVdG4oPzanWJ3z5X_6NUjla9BxyOSOCU ZKtItwkhllSxL_IgbByuD1W2Neg-- Received: from [200.118.157.7] by web113504.mail.gq1.yahoo.com via HTTP; Wed, 04 Jan 2012 06:25:23 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1325687123.3425.YahooMailClassic@web113504.mail.gq1.yahoo.com> Date: Wed, 4 Jan 2012 06:25:23 -0800 (PST) From: Pedro Giffuni To: Alexey Dokuchaev In-Reply-To: <20120104141141.GA34976@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , Joel Dahl Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 14:25:25 -0000 =0A=0A--- Mer 4/1/12, Alexey Dokuchaev ha scritto:=0A..= .=0A> > The only issue is getting rid of the remaining=0A> (small)=0A> > GP= L'd headers. Alternatively this driver is already=0A> available=0A> > as a = port (audio/emu10kx).=0A> =0A> Yes, I am aware of the port existence.=A0 My= point was=0A> to leave just one, BSD licensed, full featured emu10k=0A> dr= iver in the base (i.e. merge emu10k1 and=0A> emu10kx into one).=A0 Good to = know that you're up to=0A> this; I hope we'll get there eventually.=A0 :-)= =0A> =0A=0AWell, when I made the changes for emu10k1 it was easy=0Ato do th= em for emu10kx too but I don't have the card so I=0Aam not really up to it = (sorry). =0A=0AI will be glad to help if someone else is interested.=0A=0AP= edro. From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 14:43:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 177D61065670; Wed, 4 Jan 2012 14:43:13 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 972D08FC27; Wed, 4 Jan 2012 14:43:11 +0000 (UTC) Received: by eekc50 with SMTP id c50so19870346eek.13 for ; Wed, 04 Jan 2012 06:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=2OwleSnXTdza3gej/K6bzidB0aD1J8HZjeTGZCfYVKM=; b=W7ZaqAIptgR9h7v4mRJ3+IibinP92JvcaiuJrc6nS8O4BXksHdJsDh5uc80iQs7s5R Sdk0uGwFvw8TrOc4Mgg9B5iUI2aGnYQxcdAH9sKtay6VKjFelCOXENbDbXw0uxhLcgEp Eq3VHzPfLH0p6GiGaXdy8IGUKCDrJxUGqMoL4= Received: by 10.14.127.68 with SMTP id c44mr23757008eei.47.1325688190355; Wed, 04 Jan 2012 06:43:10 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id e12sm69549991eea.5.2012.01.04.06.43.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jan 2012 06:43:08 -0800 (PST) Sender: Alexander Motin Message-ID: <4F046579.2020502@FreeBSD.org> Date: Wed, 04 Jan 2012 16:43:05 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111227 Thunderbird/9.0 MIME-Version: 1.0 To: pfg@freebsd.org References: <1325687123.3425.YahooMailClassic@web113504.mail.gq1.yahoo.com> In-Reply-To: <1325687123.3425.YahooMailClassic@web113504.mail.gq1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexey Dokuchaev , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Joel Dahl , svn-src-head@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 14:43:13 -0000 On 01/04/12 16:25, Pedro Giffuni wrote: > --- Mer 4/1/12, Alexey Dokuchaev ha scritto: > ... >>> The only issue is getting rid of the remaining >> (small) >>> GPL'd headers. Alternatively this driver is already >> available >>> as a port (audio/emu10kx). >> >> Yes, I am aware of the port existence. My point was >> to leave just one, BSD licensed, full featured emu10k >> driver in the base (i.e. merge emu10k1 and >> emu10kx into one). Good to know that you're up to >> this; I hope we'll get there eventually. :-) > > Well, when I made the changes for emu10k1 it was easy > to do them for emu10kx too but I don't have the card so I > am not really up to it (sorry). > > I will be glad to help if someone else is interested. I have Audigy2ZS (model SB0350) in my table if any help with testing needed, but I've never looked into emu10k code, preferring to hack more widespread and documented HDA. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 14:52:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43498106566B; Wed, 4 Jan 2012 14:52:18 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9E0CB8FC0A; Wed, 4 Jan 2012 14:52:17 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so20436386obb.13 for ; Wed, 04 Jan 2012 06:52:17 -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=NIDrei+btHo6CiGr6RiD7fybKWfkmAYgV5RVb2PnLss=; b=JZtkqV/NZB01y0qmngy7LfaNKlW5tZmevZlNQGOvElbCsDZwg9wez9tjQ8LD7sYeKx cw+QYyCWHiHSscVYjuVaA7NaZOflHV0oLgR9BY9waY/TX/J/jICkfzuV4efHGYxMtEDF WM69rG0dSrJwROvlsYXKiMRhzuBGuI4pZMW4M= MIME-Version: 1.0 Received: by 10.182.1.67 with SMTP id 3mr48580510obk.31.1325688737053; Wed, 04 Jan 2012 06:52:17 -0800 (PST) Received: by 10.182.152.6 with HTTP; Wed, 4 Jan 2012 06:52:17 -0800 (PST) In-Reply-To: <4F046579.2020502@FreeBSD.org> References: <1325687123.3425.YahooMailClassic@web113504.mail.gq1.yahoo.com> <4F046579.2020502@FreeBSD.org> Date: Wed, 4 Jan 2012 06:52:17 -0800 Message-ID: From: Garrett Cooper To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Alexey Dokuchaev , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, pfg@freebsd.org, Joel Dahl , svn-src-head@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 14:52:18 -0000 On Wed, Jan 4, 2012 at 6:43 AM, Alexander Motin wrote: > On 01/04/12 16:25, Pedro Giffuni wrote: >> >> --- Mer 4/1/12, Alexey Dokuchaev =A0ha scritto: >> ... >>>> >>>> The only issue is getting rid of the remaining >>> >>> (small) >>>> >>>> GPL'd headers. Alternatively this driver is already >>> >>> available >>>> >>>> as a port (audio/emu10kx). >>> >>> >>> Yes, I am aware of the port existence. =A0My point was >>> to leave just one, BSD licensed, full featured emu10k >>> driver in the base (i.e. merge emu10k1 and >>> emu10kx into one). =A0Good to know that you're up to >>> this; I hope we'll get there eventually. =A0:-) >> >> >> Well, when I made the changes for emu10k1 it was easy >> to do them for emu10kx too but I don't have the card so I >> am not really up to it (sorry). >> >> I will be glad to help if someone else is interested. > > > I have Audigy2ZS (model SB0350) in my table if any help with testing need= ed, > but I've never looked into emu10k code, preferring to hack more widesprea= d > and documented HDA. I have an Audigy 4 I can slap into the machine at work. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 15:26:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 450671065672; Wed, 4 Jan 2012 15:26:02 +0000 (UTC) Date: Wed, 4 Jan 2012 15:26:02 +0000 From: Alexey Dokuchaev To: Garrett Cooper Message-ID: <20120104152602.GA46922@FreeBSD.org> References: <1325687123.3425.YahooMailClassic@web113504.mail.gq1.yahoo.com> <4F046579.2020502@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: src-committers@freebsd.org, John Baldwin , Alexander Motin , pfg@freebsd.org, Joel Dahl , svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r229430 - in head/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 15:26:02 -0000 On Wed, Jan 04, 2012 at 06:52:17AM -0800, Garrett Cooper wrote: > On Wed, Jan 4, 2012 at 6:43 AM, Alexander Motin wrote: > > I have Audigy2ZS (model SB0350) in my table if any help with testing > > needed, but I've never looked into emu10k code, preferring to hack more > > widespread and documented HDA. > > I have an Audigy 4 I can slap into the machine at work. OK, how about this: I have an E-MU 1212m. Any takers? :-) ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 16:02:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B08F0106564A; Wed, 4 Jan 2012 16:02:52 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0518FC08; Wed, 4 Jan 2012 16:02: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 q04G2qSH085437; Wed, 4 Jan 2012 16:02:52 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04G2qjX085435; Wed, 4 Jan 2012 16:02:52 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201041602.q04G2qjX085435@svn.freebsd.org> From: Andreas Tobler Date: Wed, 4 Jan 2012 16:02: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: r229494 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 16:02:52 -0000 Author: andreast Date: Wed Jan 4 16:02:52 2012 New Revision: 229494 URL: http://svn.freebsd.org/changeset/base/229494 Log: Introduce internal macros for __U/INT64_C to define the U/INT64_MAX/MIN values properly. The previous definition only worked if __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS were defined at the same time. Modified: head/sys/powerpc/include/_stdint.h Modified: head/sys/powerpc/include/_stdint.h ============================================================================== --- head/sys/powerpc/include/_stdint.h Wed Jan 4 15:59:49 2012 (r229493) +++ head/sys/powerpc/include/_stdint.h Wed Jan 4 16:02:52 2012 (r229494) @@ -65,6 +65,14 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#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 + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -73,19 +81,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-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 INT64_C(0x7fffffffffffffff) +#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 0xffffffff -#define UINT64_MAX UINT64_C(0xffffffffffffffff) +#define UINT64_MAX __UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 16:04:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2767106564A; Wed, 4 Jan 2012 16:04: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 C177A8FC23; Wed, 4 Jan 2012 16:04: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 q04G4KBC085519; Wed, 4 Jan 2012 16:04:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04G4KoP085517; Wed, 4 Jan 2012 16:04:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201041604.q04G4KoP085517@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jan 2012 16:04: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: r229495 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 16:04:20 -0000 Author: kib Date: Wed Jan 4 16:04:20 2012 New Revision: 229495 URL: http://svn.freebsd.org/changeset/base/229495 Log: Do not restart the scan in vm_object_page_clean() on the object generation change if requested mode is async. The object generation is only changed when the object is marked as OBJ_MIGHTBEDIRTY. For async mode it is enough to write each dirty page, not to make a guarantee that all pages are cleared after the vm_object_page_clean() returned. Diagnosed by: truckman Tested by: flo Reviewed by: alc, truckman MFC after: 2 weeks Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Jan 4 16:02:52 2012 (r229494) +++ head/sys/vm/vm_object.c Wed Jan 4 16:04:20 2012 (r229495) @@ -841,8 +841,12 @@ rescan: if (p->valid == 0) continue; if (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) { - if (object->generation != curgeneration) - goto rescan; + if (object->generation != curgeneration) { + if ((flags & OBJPC_SYNC) != 0) + goto rescan; + else + clearobjflags = 0; + } np = vm_page_find_least(object, pi); continue; } @@ -851,8 +855,12 @@ rescan: n = vm_object_page_collect_flush(object, p, pagerflags, flags, &clearobjflags); - if (object->generation != curgeneration) - goto rescan; + if (object->generation != curgeneration) { + if ((flags & OBJPC_SYNC) != 0) + goto rescan; + else + clearobjflags = 0; + } /* * If the VOP_PUTPAGES() did a truncated write, so From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 16:07:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BB1106566B; Wed, 4 Jan 2012 16:07:16 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B83848FC19; Wed, 4 Jan 2012 16:07: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 q04G7G7Y085645; Wed, 4 Jan 2012 16:07:16 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04G7GqM085643; Wed, 4 Jan 2012 16:07:16 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201041607.q04G7GqM085643@svn.freebsd.org> From: Andreas Tobler Date: Wed, 4 Jan 2012 16:07: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: r229496 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 16:07:16 -0000 Author: andreast Date: Wed Jan 4 16:07:16 2012 New Revision: 229496 URL: http://svn.freebsd.org/changeset/base/229496 Log: Apply the same change as in r229494. Requested by: ed Modified: head/sys/mips/include/_stdint.h Modified: head/sys/mips/include/_stdint.h ============================================================================== --- head/sys/mips/include/_stdint.h Wed Jan 4 16:04:20 2012 (r229495) +++ head/sys/mips/include/_stdint.h Wed Jan 4 16:07:16 2012 (r229496) @@ -66,6 +66,14 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifdef __mips_n64 +#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 + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -74,19 +82,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-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 INT64_C(0x7fffffffffffffff) +#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 0xffffffff -#define UINT64_MAX UINT64_C(0xffffffffffffffff) +#define UINT64_MAX __UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 17:17:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF3D1065679; Wed, 4 Jan 2012 17:17:12 +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 6D9648FC19; Wed, 4 Jan 2012 17:17: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 q04HHCES088507; Wed, 4 Jan 2012 17:17:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04HHCBr088505; Wed, 4 Jan 2012 17:17:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201041717.q04HHCBr088505@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jan 2012 17:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229508 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 17:17:12 -0000 Author: kib Date: Wed Jan 4 17:17:11 2012 New Revision: 229508 URL: http://svn.freebsd.org/changeset/base/229508 Log: Postpone the resolution of IRELATIVE relocations and IFUNC-targeted relocations until tls is initialized and stacks permissions correctly set. This allows the ifunc to call malloc(3) and some other heavy services. Add debug banner. MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jan 4 17:01:12 2012 (r229507) +++ head/libexec/rtld-elf/rtld.c Wed Jan 4 17:17:11 2012 (r229508) @@ -515,10 +515,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ ld_bind_now != NULL && *ld_bind_now != '\0', &obj_rtld, NULL) == -1) die(); - if (resolve_objects_ifunc(obj_main, - ld_bind_now != NULL && *ld_bind_now != '\0', NULL) == -1) - die(); - dbg("doing copy relocations"); if (do_copy_relocations(obj_main) == -1) die(); @@ -549,6 +545,11 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ map_stacks_exec(NULL); + dbg("resolving ifuncs"); + if (resolve_objects_ifunc(obj_main, + ld_bind_now != NULL && *ld_bind_now != '\0', NULL) == -1) + die(); + wlock_acquire(rtld_bind_lock, &lockstate); objlist_call_init(&initlist, &lockstate); objlist_clear(&initlist); From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 19:37:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 388FB106566B; Wed, 4 Jan 2012 19:37:26 +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 1CF658FC1D; Wed, 4 Jan 2012 19:37: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 q04JbP6J092992; Wed, 4 Jan 2012 19:37:25 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04JbPdT092989; Wed, 4 Jan 2012 19:37:25 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201041937.q04JbPdT092989@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 4 Jan 2012 19:37: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: r229511 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 19:37:26 -0000 Author: luigi Date: Wed Jan 4 19:37:25 2012 New Revision: 229511 URL: http://svn.freebsd.org/changeset/base/229511 Log: remove some stale options (such as running without /boot/loader) improve support for multi-arch and cross-arch builds, by adding a suffix to the kernel config file and build_directory. (cross builds not clean yet, a cross-built kernel boots but fails when starting /sbin/init) Modified: head/release/picobsd/build/Makefile.conf head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/Makefile.conf ============================================================================== --- head/release/picobsd/build/Makefile.conf Wed Jan 4 17:25:41 2012 (r229510) +++ head/release/picobsd/build/Makefile.conf Wed Jan 4 19:37:25 2012 (r229511) @@ -13,6 +13,7 @@ BINMAKE?=make SRC?=/usr/src CONFIG?=config MODULES?=-DNO_MODULES # do not build them as a default +KERNCONF ?= PICOBSD # caller will set MODULES to empty if modules are needed. # Indeed, it can be used to specify other Makefile options as well. @@ -45,10 +46,10 @@ ${COMPILE}: ${CONF}/${CONFFILE} (cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \ cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} depend ) -${CONF}/${CONFFILE}: PICOBSD +${CONF}/${CONFFILE}: ${KERNCONF} # -mkdir -p ${CONF} # XXX not needed yet. cp ${.OODATE} ${.TARGET} - if [ -f PICOBSD.hints ] ; then cp PICOBSD.hints ${CONF}/PICOBSD.hints ; fi + [ -f PICOBSD.hints ] && cp PICOBSD.hints ${CONF}/ # This part creates crunch1.conf and crunch.mk from crunch.conf ${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Wed Jan 4 17:25:41 2012 (r229510) +++ head/release/picobsd/build/picobsd Wed Jan 4 19:37:25 2012 (r229511) @@ -105,11 +105,6 @@ set_defaults() { # no arguments EDITOR=${EDITOR:-vi} fd_size=${fd_size:-1440} - o_use_loader="yes" # use /boot/loader - # You should not change it unless you are really short - # of space, and your kernel is small enough that the - # bootblocks manage to load it. - o_all_in_mfs="yes" # put all files in mfs so you can boot # and run the image via diskless boot. o_clean="" # set if you want to clean prev.builds. @@ -179,7 +174,17 @@ create_includes_and_libraries2() { # opt if [ -d "$1" ] ; then cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so else - ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries + # export WITH_RESCUE=yes # build crunchide + # ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries + ( + # eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V BMAKEENV` + eval "export XMAKE=\"`cd ${SRC}; make -f Makefile -V XMAKE`\"" + ${BINMAKE} ${o_par} _+_= $no toolchain + ) + eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` + ${BINMAKE} ${o_par} _+_= $no _includes _libraries + [ ${o_arch} != `uname -m` ] && \ + (cd ${l_objtree}; ln -s . ${o_arch}.${o_arch} || true ) fi ) } @@ -242,16 +247,19 @@ set_type() { # the_type the_site name="" # clear in case of errors for i in ${c_startdir}/${a} ${PICO_TREE}/${a} ; do log "set_type: checking $i" - [ -d $i -a -f $i/PICOBSD -a -f $i/crunch.conf ] || continue - set -- `cat $i/PICOBSD | \ + [ -d $i -a -f $i/crunch.conf ] || continue + # look for a kernel config file, privilege arch-specific + l_kernconf=$i/PICOBSD.${o_arch} + [ -f $l_kernconf ] || l_kernconf=$i/PICOBSD + [ -f $l_kernconf ] || continue + set -- `cat $l_kernconf | \ awk '/^#PicoBSD/ {print $2, $3, $4, $5, $6}'` [ x"$1" != "x" ] || continue - MFS_SIZE=$1 ; init_name=$2 - mfs_inodes=$3 ; fd_inodes=$4 + MFS_SIZE=$1 name=`(cd $i ; pwd) ` name=`basename $name` MY_TREE=$i - BUILDDIR=${c_startdir}/build_dir-${name} + BUILDDIR=${c_startdir}/build_dir-${name}-${o_arch} log "Matching file $name in $i" return ; done @@ -328,10 +336,7 @@ main_dialog() { K "edit Kernel config file" \ E "Edit crunch.conf file" \ S "MFS Size: ${MFS_SIZE}kB" \ - I "Init type: ${init_name}" \ F "Floppy size: ${fd_size}kB" \ - M "MFS bytes per inode: ${mfs_inodes}" \ - U "UFS bytes per inode: ${fd_inodes}" \ $ "Site-info: ${SITE}" \ Q "Quit" \ 2> ${c_reply} @@ -349,12 +354,6 @@ main_dialog() { { dialog --menu "Setup the type of configuration" 12 70 5 $l \ 2> ${c_reply} && set_type "`cat ${c_reply}`" ${SITE} ; } || true ;; - I) - { dialog --menu "Choose your init(8) program" \ - 10 70 2 init "Standard init (requires getty)" \ - oinit "small init from TinyWare" 2> ${c_reply} \ - && init_name=`cat ${c_reply}` ; } || true - ;; K) ${EDITOR} ${MY_TREE}/PICOBSD ;; @@ -386,20 +385,6 @@ this as small as possible. " 10 70 2> ${ 2> ${c_reply} && fd_size=`cat ${c_reply}` ; } || true ;; - M) - { dialog --title "MFS bytes per inode:" --inputbox \ - "Enter MFS bytes per inode (typically 4096..65536). \ - A larger value means fewer inodes but more space on MFS" \ - 10 70 2> ${c_reply} && mfs_inodes=`cat ${c_reply}` ; } || true - ;; - - U) - { dialog --title "Floppy bytes per inode:" --inputbox \ - "Enter floppy bytes per inode (typically 3072..65536). \ - A larger value means fewer inodes but more space on the floppy." \ - 10 70 2> ${c_reply} && fd_inodes=`cat ${c_reply}` ; } || true - ;; - N) break 2 ;; @@ -454,8 +439,9 @@ do_kernel() { # OK # export CONFIG export WARNS CWARNFLAGS [ "${o_do_modules}" = "yes" ] && export MODULES="" - ${BINMAKE} ${o_par} -v -f ${PICO_TREE}/build/Makefile.conf ) || \ - fail $? missing_kernel + ${BINMAKE} ${o_par} KERNCONF=${l_kernconf} \ + -v -f ${PICO_TREE}/build/Makefile.conf ) || \ + fail $? missing_kernel } # Populate the variable part of the floppy filesystem. Must be done before @@ -604,6 +590,7 @@ find_progs() { # programs i="`( LD_LIBRARY_PATH=$lp ldd ${u_progs} ) | \ grep -v '^/' | awk '{print $1}' | sort | uniq`" u_libs="`find_progs_helper $o $i`" + log "--- done find_progs ---" return 0 } @@ -637,8 +624,12 @@ find_progs_helper() { # programs [ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}" done fi + for i in $progs ; do + # full pathnames are just listed + [ -f "$i" ] && echo $i && continue + find ${places} -maxdepth 3 -type f -name ${i} | head -1 + done # use maxdepth 3 because some libs are way down - find ${places} -maxdepth 3 -type f \( ${names} \) } # Populate the memory filesystem with binaries and non-variable @@ -788,7 +779,6 @@ populate_mfs_tree() { final_cleanup() { log "final_cleanup()" rm -rf ${c_mnt} ${c_reply} 2> /dev/null || true - rm -f ${c_reply} } # fail errno errcode @@ -857,17 +847,6 @@ fill_floppy_image() { fi log "Labeling floppy image" - b2=${BUILDDIR}/boot2 # modified boot2 - cp -f ${c_boot2} ${b2} - chmod 0644 ${b2} - - if [ ${o_use_loader} = "no" ] ; then - log "patch ${c_boot2} to boot /kernel right away" - set `strings -at d ${b2} | grep "/boot/loader"` - echo -e "/kernel\0\0\0\0\0" | \ - dd of=${b2} obs=$1 oseek=1 conv=notrunc 2>/dev/null - fi - chmod 0444 ${b2} dst=${BUILDDIR}/image.tree rm -rf ${dst} @@ -893,17 +872,13 @@ fill_floppy_image() { log "not loading mfs, size ${mfs_size} img ${imgsize}" fi log "Compress with kgzip and copy to floppy image" - if [ ${o_use_loader} = "no" ] ; then - kgzip -o kernel.gz kernel - cp -p kernel.gz ${dst}/kernel || fail $? no_space "copying kernel" - else - gzip kernel - mkdir -p ${dst}/boot/kernel - echo "hint.acpi.0.disabled=\"1\"" > ${dst}/boot/loader.conf - echo "console=\"comconsole\"" >> ${dst}/boot/loader.conf - cp -p /boot/loader ${dst}/boot/loader || fail $? no_space "copying bootloader" - cp -p kernel.gz ${dst}/boot/kernel/kernel.gz || fail $? no_space "copying kernel" - fi + + mkdir -p ${dst}/boot/kernel + # XXX update loader.conf + echo "hint.acpi.0.disabled=\"1\"" > ${dst}/boot/loader.conf + echo "console=\"comconsole\"" >> ${dst}/boot/loader.conf + cp -p /boot/loader ${dst}/boot/loader || fail $? no_space "copying bootloader" + gzip -c kernel > ${dst}/boot/kernel/kernel.gz || fail $? no_space "copying kernel" # now transfer the floppy tree. If it is already in mfs, dont bother. if [ "${o_all_in_mfs}" != "yes" ] ; then @@ -953,10 +928,13 @@ fill_floppy_image() { # so we skip 276 from the source, and 276+512=788 from dst # the old style blocks used 512 and 1024 respectively - dd if=${b2} iseek=1 ibs=276 2> /dev/null | \ + dd if=${c_boot2} iseek=1 ibs=276 2> /dev/null | \ dd of=${BUILDDIR}/${c_img} oseek=1 obs=788 conv=notrunc 2>/dev/null log "done disk image" # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *) + # leave build stuff if verbose + [ ${o_verbose} -gt 0 ] && return + rm -rf ${BUILDDIR}/floppy.tree || true # cleanup # df -ik ${dst} | colrm 70 > .build.reply rm -rf ${dst} @@ -984,9 +962,10 @@ set_build_parameters() { if [ ${OSVERSION} -ge 500035 ] ; then export MAKEOBJDIRPREFIX=${l_objtree} export TARGET_ARCH=${o_arch} TARGET=${o_arch} + # XXX why change machine_arch ? + #-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m` # export CWARNFLAGS="-Wextra -Wno-sign-compare -Wno-missing-field-initializers" eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" - eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` fi if [ "${o_init_src}" != "" ] ; then @@ -995,6 +974,8 @@ set_build_parameters() { else create_includes_and_libraries2 fi + else + eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` fi if [ ${OSVERSION} -lt 500035 ] ; then # Create the right LIBS and CFLAGS for further builds. @@ -1030,29 +1011,29 @@ set_defaults while [ true ]; do log "Parsing $1" case $1 in + --par) + o_par="-j 8" + ;; + --src) # set the source path instead of /usr/src SRC=`realpath $2` shift ;; - --init) + + --init) # run a partial buildworld on the source tree o_init_src="YES" ;; - --arch) + --arch) # override the target architecture o_arch=$2 shift ;; - --floppy_size) + --floppy_size) # image size fd_size=$2 shift ;; - --no_loader) # omit /boot/loader, just rely on boot2 - # (it may have problems with kernels > 4MB) - o_use_loader="no" - ;; - --all_in_mfs) o_all_in_mfs="yes" ;; @@ -1064,6 +1045,7 @@ while [ true ]; do --modules) # also build kernel modules o_do_modules="yes" ;; + -n) o_interactive="NO" ;; From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 20:05:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3CEE106566B; Wed, 4 Jan 2012 20:05:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2E3C8FC08; Wed, 4 Jan 2012 20:05: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 q04K5cqk094139; Wed, 4 Jan 2012 20:05:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04K5cCg094137; Wed, 4 Jan 2012 20:05:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201042005.q04K5cCg094137@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 4 Jan 2012 20:05: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: r229516 - head/lib/libvgl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 20:05:39 -0000 Author: pfg Date: Wed Jan 4 20:05:38 2012 New Revision: 229516 URL: http://svn.freebsd.org/changeset/base/229516 Log: Quiet down clang -Werror. Reported by: Pawel Worach Approved by: jhb (mentor) Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Wed Jan 4 19:53:32 2012 (r229515) +++ head/lib/libvgl/simple.c Wed Jan 4 20:05:38 2012 (r229516) @@ -242,8 +242,8 @@ VGLLine(VGLBitmap *object, int x1, int y if (x1 > x2) { /* start from the smaller coordinate */ x = x2; y = y2; - x1 = x1; - y1 = y1; +/* x1 = x1; + y1 = y1; */ } else { x = x1; y = y1; From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 21:04:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCA1A106566B; Wed, 4 Jan 2012 21:04:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB9BF8FC1B; Wed, 4 Jan 2012 21:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q04L4vc6096190; Wed, 4 Jan 2012 21:04:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04L4vSG096187; Wed, 4 Jan 2012 21:04:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201042104.q04L4vSG096187@svn.freebsd.org> From: Robert Watson Date: Wed, 4 Jan 2012 21:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229518 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 21:04:57 -0000 Author: rwatson Date: Wed Jan 4 21:04:57 2012 New Revision: 229518 URL: http://svn.freebsd.org/changeset/base/229518 Log: Adjust the VLAN section of the ifconfig(8) man page to better reflect reality: 1. Only 12-bit VLAN Identifiers, not full 16-bit VLAN tags can be set using ifconfig vlan. 2. When we mean VLAN Identifiers, spell it that way, rather than as VLAN tag. MFC after: 3 days Sponsored by: Adara Networks, Inc. Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Jan 4 20:14:07 2012 (r229517) +++ head/sbin/ifconfig/ifconfig.8 Wed Jan 4 21:04:57 2012 (r229518) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd December 17, 2011 +.Dd January 4, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2378,7 +2378,7 @@ interfaces: .It Cm vlan Ar vlan_tag Set the VLAN tag value to .Ar vlan_tag . -This value is a 16-bit number which is used to create an 802.1Q +This value is a 12-bit VLAN Identifier (VID) which is used to create an 802.1Q VLAN header for packets sent from the .Xr vlan 4 interface. @@ -2400,7 +2400,7 @@ diverted to the specified physical inter .Ar iface with 802.1Q VLAN encapsulation. Packets with 802.1Q encapsulation received -by the parent interface with the correct VLAN tag will be diverted to +by the parent interface with the correct VLAN Identifier will be diverted to the associated .Xr vlan 4 pseudo-interface. @@ -2439,7 +2439,8 @@ pseudo device, disassociate the parent i This breaks the link between the .Xr vlan 4 interface and its parent, -clears its VLAN tag, flags and its link address and shuts the interface down. +clears its VLAN Identifier, flags and its link address and shuts the interface +down. The .Ar iface argument is useless and hence deprecated. From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 21:14:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE381065675; Wed, 4 Jan 2012 21:14: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 EE36A8FC0A; Wed, 4 Jan 2012 21:14: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 q04LEMFL096524; Wed, 4 Jan 2012 21:14:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04LEMOt096522; Wed, 4 Jan 2012 21:14:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201042114.q04LEMOt096522@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jan 2012 21:14: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: r229519 - head/sys/modules/kgssapi_krb5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 21:14:23 -0000 Author: jhb Date: Wed Jan 4 21:14:22 2012 New Revision: 229519 URL: http://svn.freebsd.org/changeset/base/229519 Log: Fix 'make clean' for this module so it cleans up the generated gssd.h. MFC after: 1 week Modified: head/sys/modules/kgssapi_krb5/Makefile Modified: head/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- head/sys/modules/kgssapi_krb5/Makefile Wed Jan 4 21:04:57 2012 (r229518) +++ head/sys/modules/kgssapi_krb5/Makefile Wed Jan 4 21:14:22 2012 (r229519) @@ -13,6 +13,7 @@ SRCS= krb5_mech.c \ SRCS+= kgss_if.h gssd.h MFILES= kgssapi/kgss_if.m +CLEANFILES= gssd.h S= ${.CURDIR}/../.. From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 21:26:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1F9106566B; Wed, 4 Jan 2012 21:26:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D90BB8FC0C; Wed, 4 Jan 2012 21:26: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 q04LQlM4096997; Wed, 4 Jan 2012 21:26:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04LQlWV096995; Wed, 4 Jan 2012 21:26:47 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201042126.q04LQlWV096995@svn.freebsd.org> From: Robert Watson Date: Wed, 4 Jan 2012 21:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229521 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 21:26:48 -0000 Author: rwatson Date: Wed Jan 4 21:26:47 2012 New Revision: 229521 URL: http://svn.freebsd.org/changeset/base/229521 Log: Add missing -w to kgdb(1)'s usage(). Sponsored by: Adara Networks, Inc. MFC after: 3 days Modified: head/gnu/usr.bin/gdb/kgdb/main.c Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Wed Jan 4 21:25:11 2012 (r229520) +++ head/gnu/usr.bin/gdb/kgdb/main.c Wed Jan 4 21:26:47 2012 (r229521) @@ -83,7 +83,7 @@ usage(void) { fprintf(stderr, - "usage: %s [-afqv] [-d crashdir] [-c core | -n dumpnr | -r device]\n" + "usage: %s [-afqvw] [-d crashdir] [-c core | -n dumpnr | -r device]\n" "\t[kernel [core]]\n", getprogname()); exit(1); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 23:00:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8125106564A; Wed, 4 Jan 2012 23:00:25 +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 C6F9D8FC08; Wed, 4 Jan 2012 23:00: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 q04N0PBV000830; Wed, 4 Jan 2012 23:00:25 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04N0PYJ000828; Wed, 4 Jan 2012 23:00:25 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201042300.q04N0PYJ000828@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 4 Jan 2012 23:00: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: r229532 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 23:00:28 -0000 Author: luigi Date: Wed Jan 4 23:00:25 2012 New Revision: 229532 URL: http://svn.freebsd.org/changeset/base/229532 Log: now picobsd cross builds work (tried with host amd64, target i386 ). The fix involved adding a proper build of ld-elf.so.1 , and also replacing ldd with objdump (suggested by Garrett Cooper) to build the list of shared libraries needed by the binaries and libraries on the target. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Wed Jan 4 22:57:04 2012 (r229531) +++ head/release/picobsd/build/picobsd Wed Jan 4 23:00:25 2012 (r229532) @@ -161,19 +161,19 @@ set_defaults() { # no arguments # and also to build a specific target create_includes_and_libraries2() { # opt_dir opt_target local no - log "create_includes_and_libraries2() for ${SRC}" + log "create_includes_and_libraries2() for ${SRC} $1" if [ ${OSVERSION} -ge 600000 ] ; then no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi - MAKEOBJDIRPREFIX=${l_objtree} - export MAKEOBJDIRPREFIX ( cd ${SRC}; # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld if [ -d "$1" ] ; then cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so else + MAKEOBJDIRPREFIX=${l_objtree} + export MAKEOBJDIRPREFIX # export WITH_RESCUE=yes # build crunchide # ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries ( @@ -551,7 +551,7 @@ do_links() { # rootdir varname # find_progs is a helper function to locate the named programs # or libraries in ${o_objdir} or ${_SHLIBDIRPREFIX}, # and return the full pathnames. -# Called as "find_progs [-L libpath] [-P binpath] prog1 prog2 ... " +# Called as "find_progs [[-L libpath] [-P binpath]] prog1 prog2 ... " # On return it sets ${u_progs} to the list of programs, and ${u_libs} # to the list of shared libraries used. # @@ -574,24 +574,32 @@ do_links() { # rootdir varname # } find_progs() { # programs - local i - local oo=${o_objdir:-${_SHLIBDIRPREFIX}} # default objdir - local lp=$oo/lib # default lib.prefix - local o="" # additional objdir + local pass i old_libs="" tmp o="" if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path - o=$2; shift; shift - lp="$lp:$o/lib:$o/usr/lib:$o/usr/local/lib" - o="-P $o" + o="-P $2"; shift; shift fi - u_libs="" - u_progs="`find_progs_helper $*`" - log "looking for libs for <$u_progs> in $lp" + # Result returned in global variables + u_libs="" ; u_progs="`find_progs_helper $*`" [ -z "${u_progs}" ] && return 1 # not found, error - i="`( LD_LIBRARY_PATH=$lp ldd ${u_progs} ) | \ - grep -v '^/' | awk '{print $1}' | sort | uniq`" - u_libs="`find_progs_helper $o $i`" - log "--- done find_progs ---" - return 0 + # use objdump to find libraries. Iterate to fetch recursive + # dependencies. + tmp="${u_progs}" ; pass=1 + while [ $pass -lt 10 ] ; do + pass=$(($pass + 1)) + i="`objdump -x ${tmp} | \ + awk '$1 == "NEEDED" { print $2 }' | sort | uniq`" + if [ "$old_libs" = "$i" ] ; then + log "libraries for: $my_progs ($u_progs) are ($i) $u_libs" + log "--- done find_progs ---" + return 0 + else + # logverbose "old--- $old_libs --- new +++ $i +++" + fi + u_libs="`find_progs_helper $o $i`" + old_libs="$i" + tmp="$tmp $u_libs" + done + log "WARNING: Too many passes, giving up" } find_progs_helper() { # programs From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 23:26:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70FB71065678; Wed, 4 Jan 2012 23:26:22 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D1FD8FC1C; Wed, 4 Jan 2012 23:26: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 q04NQMdK003273; Wed, 4 Jan 2012 23:26:22 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04NQMLK003266; Wed, 4 Jan 2012 23:26:22 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201201042326.q04NQMLK003266@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 4 Jan 2012 23:26: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: r229533 - in head/sys: conf contrib/xz-embedded/freebsd contrib/xz-embedded/linux/include/linux contrib/xz-embedded/linux/lib/xz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 23:26:22 -0000 Author: ray Date: Wed Jan 4 23:26:22 2012 New Revision: 229533 URL: http://svn.freebsd.org/changeset/base/229533 Log: Update contrib/xz-embedded to build with new GEOM_UNCOMPRESS module. Approved by: adrian (mentor) Added: head/sys/contrib/xz-embedded/freebsd/ head/sys/contrib/xz-embedded/freebsd/xz_config.h (contents, props changed) head/sys/contrib/xz-embedded/freebsd/xz_malloc.c (contents, props changed) head/sys/contrib/xz-embedded/freebsd/xz_malloc.h (contents, props changed) Modified: head/sys/conf/files head/sys/contrib/xz-embedded/linux/include/linux/xz.h head/sys/contrib/xz-embedded/linux/lib/xz/xz_private.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 4 23:00:25 2012 (r229532) +++ head/sys/conf/files Wed Jan 4 23:26:22 2012 (r229533) @@ -2266,6 +2266,21 @@ geom/raid3/g_raid3.c optional geom_raid geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec geom/stripe/g_stripe.c optional geom_stripe +contrib/xz-embedded/freebsd/xz_malloc.c \ + optional xz_embedded \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_crc32.c \ + optional xz_embedded \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \ + optional xz_embedded \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \ + optional xz_embedded \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \ + optional xz_embedded \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip geom/virstor/binstream.c optional geom_virstor geom/virstor/g_virstor.c optional geom_virstor Added: head/sys/contrib/xz-embedded/freebsd/xz_config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/xz-embedded/freebsd/xz_config.h Wed Jan 4 23:26:22 2012 (r229533) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2010-2012 Aleksandr Rybalko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __FREEBSD_XZ_CONFIG_H__ +#define __FREEBSD_XZ_CONFIG_H__ + +#include +#include +#include +#include + +#include +#include "xz_malloc.h" + +#define XZ_DEC_SINGLE 1 +#define XZ_PREBOOT 1 + +#undef XZ_EXTERN +#define XZ_EXTERN extern + +#undef STATIC +#define STATIC + +#undef INIT +#define INIT + +#undef bool +#undef true +#undef false +#define bool int +#define true 1 +#define false 0 + +#define kmalloc(size, flags) xz_malloc(size) +#define kfree(ptr) xz_free(ptr) +#define vmalloc(size) xz_malloc(size) +#define vfree(ptr) xz_free(ptr) + +#define memeq(a, b, size) (memcmp((a), (b), (size)) == 0) +#define memzero(buf, size) bzero((buf), (size)) + +#ifndef min +# define min(x, y) MIN((x), (y)) +#endif + +#define min_t(type, x, y) min((x), (y)) + +#define get_le32(ptr) le32toh(*(const uint32_t *)(ptr)) + +#endif /* __FREEBSD_XZ_CONFIG_H__ */ Added: head/sys/contrib/xz-embedded/freebsd/xz_malloc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/xz-embedded/freebsd/xz_malloc.c Wed Jan 4 23:26:22 2012 (r229533) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2010-2012 Aleksandr Rybalko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include "xz_malloc.h" + +/* Wraper for XZ decompressor memmory pool */ + +static MALLOC_DEFINE(XZ_DEC, "XZ_DEC", "XZ decompressor data"); + +void * +xz_malloc(unsigned long size) +{ + void *addr; + + addr = malloc(size, XZ_DEC, M_NOWAIT); + return (addr); +} + +void +xz_free(void *addr) +{ + + free(addr, XZ_DEC); +} Added: head/sys/contrib/xz-embedded/freebsd/xz_malloc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/xz-embedded/freebsd/xz_malloc.h Wed Jan 4 23:26:22 2012 (r229533) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2010-2012 Aleksandr Rybalko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __XZ_MALLOC_H__ +#define __XZ_MALLOC_H__ + +extern void *xz_malloc(unsigned long size); +extern void xz_free(void *addr); + +#endif /* __XZ_MALLOC_H__ */ + Modified: head/sys/contrib/xz-embedded/linux/include/linux/xz.h ============================================================================== --- head/sys/contrib/xz-embedded/linux/include/linux/xz.h Wed Jan 4 23:00:25 2012 (r229532) +++ head/sys/contrib/xz-embedded/linux/include/linux/xz.h Wed Jan 4 23:26:22 2012 (r229533) @@ -15,9 +15,14 @@ # include # include #else +#ifdef __FreeBSD__ +# include +# include +#else # include # include #endif +#endif #ifdef __cplusplus extern "C" { Modified: head/sys/contrib/xz-embedded/linux/lib/xz/xz_private.h ============================================================================== --- head/sys/contrib/xz-embedded/linux/lib/xz/xz_private.h Wed Jan 4 23:00:25 2012 (r229532) +++ head/sys/contrib/xz-embedded/linux/lib/xz/xz_private.h Wed Jan 4 23:26:22 2012 (r229533) @@ -47,7 +47,7 @@ * macros and functions. This makes it easier to adapt the code into * different environments and avoids clutter in the Linux kernel tree. */ -# include "xz_config.h" +# include #endif /* If no specific decoding mode is requested, enable support for all modes. */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 23:39:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C47331065673; Wed, 4 Jan 2012 23:39:11 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1A2E8FC0C; Wed, 4 Jan 2012 23:39: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 q04NdB6V003995; Wed, 4 Jan 2012 23:39:11 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04NdBB4003990; Wed, 4 Jan 2012 23:39:11 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201201042339.q04NdBB4003990@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 4 Jan 2012 23:39: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: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 23:39:11 -0000 Author: ray Date: Wed Jan 4 23:39:11 2012 New Revision: 229537 URL: http://svn.freebsd.org/changeset/base/229537 Log: GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma images. Approved by: adrian (mentor) Added: head/sys/geom/uncompress/ head/sys/geom/uncompress/g_uncompress.c (contents, props changed) head/sys/modules/geom/geom_uncompress/ head/sys/modules/geom/geom_uncompress/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 4 23:32:50 2012 (r229536) +++ head/sys/conf/files Wed Jan 4 23:39:11 2012 (r229537) @@ -2266,20 +2266,21 @@ geom/raid3/g_raid3.c optional geom_raid geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec geom/stripe/g_stripe.c optional geom_stripe +geom/uncompress/g_uncompress.c optional geom_uncompress contrib/xz-embedded/freebsd/xz_malloc.c \ - optional xz_embedded \ + optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_crc32.c \ - optional xz_embedded \ + optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \ - optional xz_embedded \ + optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \ - optional xz_embedded \ + optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \ - optional xz_embedded \ + optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip geom/virstor/binstream.c optional geom_virstor @@ -2651,7 +2652,7 @@ net/slcompress.c optional netgraph_vjc net/vnet.c optional vimage net/zlib.c optional crypto | geom_uzip | ipsec | \ mxge | netgraph_deflate | \ - ddb_ctf | gzio + ddb_ctf | gzio | geom_uncompress net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jan 4 23:32:50 2012 (r229536) +++ head/sys/conf/options Wed Jan 4 23:39:11 2012 (r229537) @@ -112,6 +112,7 @@ GEOM_RAID3 opt_geom.h GEOM_SHSEC opt_geom.h GEOM_STRIPE opt_geom.h GEOM_SUNLABEL opt_geom.h +GEOM_UNCOMPRESS opt_geom.h GEOM_UZIP opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h Added: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/uncompress/g_uncompress.c Wed Jan 4 23:39:11 2012 (r229537) @@ -0,0 +1,670 @@ +/*- + * Copyright (c) 2010-2012 Aleksandr Rybalko + * Copyright (c) 2004 Max Khon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * GEOM UNCOMPRESS module - simple decompression module for use with read-only + * copressed images maked by mkuzip(8) or mkulzma(8) utilities. + * + * To enable module in kernel config, put this line: + * device geom_uncompress + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef GEOM_UNCOMPRESS_DEBUG +#define DPRINTF(a) printf a +extern int g_debugflags; +#else +#define DPRINTF(a) +#endif + +static MALLOC_DEFINE(M_GEOM_UNCOMPRESS, "geom_uncompress", + "GEOM UNCOMPRESS data structures"); + +#define UNCOMPRESS_CLASS_NAME "UNCOMPRESS" +#define GEOM_UZIP_MAJVER '2' +#define GEOM_ULZMA_MAJVER '3' + +/* + * Maximum allowed valid block size (to prevent foot-shooting) + */ +#define MAX_BLKSZ (MAXPHYS) + +/* + * Integer values (block size, number of blocks, offsets) + * are stored in big-endian (network) order on disk and struct cloop_header + * and in native order in struct g_uncompress_softc + */ + +#define CLOOP_MAGIC_LEN 128 +static char CLOOP_MAGIC_START[] = "#!/bin/sh\n"; + +struct cloop_header { + char magic[CLOOP_MAGIC_LEN]; /* cloop magic */ + uint32_t blksz; /* block size */ + uint32_t nblocks; /* number of blocks */ +}; + +struct g_uncompress_softc { + uint32_t blksz; /* block size */ + uint32_t nblocks; /* number of blocks */ + uint64_t *offsets; + enum { + GEOM_UZIP = 1, + GEOM_ULZMA + } type; + + struct mtx last_mtx; + uint32_t last_blk; /* last blk no */ + char *last_buf; /* last blk data */ + int req_total; /* total requests */ + int req_cached; /* cached requests */ + + /* XZ decoder structs */ + struct xz_buf *b; + struct xz_dec *s; + z_stream *zs; +}; + +static void +g_uncompress_softc_free(struct g_uncompress_softc *sc, struct g_geom *gp) +{ + + if (gp != NULL) { + printf("%s: %d requests, %d cached\n", + gp->name, sc->req_total, sc->req_cached); + } + if (sc->offsets != NULL) { + free(sc->offsets, M_GEOM_UNCOMPRESS); + sc->offsets = 0; + } + + switch (sc->type) { + case GEOM_ULZMA: + if (sc->b) { + free(sc->b, M_GEOM_UNCOMPRESS); + sc->b = 0; + } + if (sc->s) { + xz_dec_end(sc->s); + sc->s = 0; + } + break; + case GEOM_UZIP: + if (sc->zs) { + inflateEnd(sc->zs); + free(sc->zs, M_GEOM_UNCOMPRESS); + sc->zs = 0; + } + break; + } + + mtx_destroy(&sc->last_mtx); + free(sc->last_buf, M_GEOM_UNCOMPRESS); + free(sc, M_GEOM_UNCOMPRESS); +} + +static void * +z_alloc(void *nil, u_int type, u_int size) +{ + void *ptr; + + ptr = malloc(type * size, M_GEOM_UNCOMPRESS, M_NOWAIT); + return (ptr); +} + +static void +z_free(void *nil, void *ptr) +{ + + free(ptr, M_GEOM_UNCOMPRESS); +} + +static void +g_uncompress_done(struct bio *bp) +{ + struct g_uncompress_softc *sc; + struct g_provider *pp, *pp2; + struct g_consumer *cp; + struct g_geom *gp; + struct bio *bp2; + uint32_t start_blk, i; + off_t pos, upos; + size_t bsize; + int err; + + err = 0; + bp2 = bp->bio_parent; + pp = bp2->bio_to; + gp = pp->geom; + cp = LIST_FIRST(&gp->consumer); + pp2 = cp->provider; + sc = gp->softc; + DPRINTF(("%s: done\n", gp->name)); + + bp2->bio_error = bp->bio_error; + if (bp2->bio_error != 0) + goto done; + + /* + * Example: + * Uncompressed block size = 65536 + * User request: 65540-261632 + * (4 uncompressed blocks -4B at start, -512B at end) + * + * We have 512(secsize)*63(nsec) = 32256B at offset 1024 + * From: 1024 bp->bio_offset = 1024 + * To: 33280 bp->bio_length = 33280 - 1024 = 32256 + * Compressed blocks: 0-1020, 1020-1080, 1080-4845, 4845-12444, + * 12444-33210, 33210-44100, ... + * + * Get start_blk from user request: + * start_blk = bp2->bio_offset / 65536 = 65540/65536 = 1 + * bsize (block size of parent) = pp2->sectorsize (Now is 4B) + * pos(in stream from parent) = sc->offsets[start_blk] % bsize = + * = sc->offsets[1] % 4 = 1020 % 4 = 0 + */ + + /* + * Uncompress data. + */ + start_blk = bp2->bio_offset / sc->blksz; + bsize = pp2->sectorsize; + pos = sc->offsets[start_blk] % bsize; + upos = 0; + + DPRINTF(("%s: done: bio_length %lld bio_completed %lld start_blk %d, " + "pos %lld, upos %lld (%lld, %d, %d)\n", + gp->name, bp->bio_length, bp->bio_completed, start_blk, pos, upos, + bp2->bio_offset, sc->blksz, bsize)); + + for (i = start_blk; upos < bp2->bio_length; i++) { + off_t len, dlen, ulen, uoff; + + uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; + ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); + dlen = len = sc->offsets[i + 1] - sc->offsets[i]; + + DPRINTF(("%s: done: inflate block %d, start %lld, end %lld " + "len %lld\n", + gp->name, i, sc->offsets[i], sc->offsets[i + 1], len)); + + if (len == 0) { + /* All zero block: no cache update */ + bzero(bp2->bio_data + upos, ulen); + upos += ulen; + bp2->bio_completed += ulen; + continue; + } + + mtx_lock(&sc->last_mtx); + +#ifdef GEOM_UNCOMPRESS_DEBUG + if (g_debugflags & 32) + hexdump(bp->bio_data + pos, dlen, 0, 0); +#endif + + switch (sc->type) { + case GEOM_ULZMA: + sc->b->in = bp->bio_data + pos; + sc->b->out = sc->last_buf; + sc->b->in_pos = sc->b->out_pos = 0; + sc->b->in_size = dlen; + sc->b->out_size = (size_t)-1; + + err = (xz_dec_run(sc->s, sc->b) != XZ_STREAM_END) ? + 1 : 0; + /* TODO decoder recovery, if needed */ + break; + case GEOM_UZIP: + sc->zs->next_in = bp->bio_data + pos; + sc->zs->avail_in = dlen; + sc->zs->next_out = sc->last_buf; + sc->zs->avail_out = sc->blksz; + + err = (inflate(sc->zs, Z_FINISH) != Z_STREAM_END) ? + 1 : 0; + if ((err) && (inflateReset(sc->zs) != Z_OK)) + printf("%s: UZIP decoder reset failed\n", + gp->name); + break; + } + + if (err) { + sc->last_blk = -1; + mtx_unlock(&sc->last_mtx); + DPRINTF(("%s: done: inflate failed, code=%d\n", + gp->name, err)); + bp2->bio_error = EIO; + goto done; + } + +#ifdef GEOM_UNCOMPRESS_DEBUG + if (g_debugflags & 32) + hexdump(sc->last_buf, sc->b->out_size, 0, 0); +#endif + + sc->last_blk = i; + DPRINTF(("%s: done: inflated \n", gp->name)); + memcpy(bp2->bio_data + upos, sc->last_buf + uoff, ulen); + mtx_unlock(&sc->last_mtx); + + pos += len; + upos += ulen; + bp2->bio_completed += ulen; + } + +done: + /* + * Finish processing the request. + */ + DPRINTF(("%s: done: (%d, %lld, %ld)\n", + gp->name, bp2->bio_error, bp2->bio_completed, bp2->bio_resid)); + free(bp->bio_data, M_GEOM_UNCOMPRESS); + g_destroy_bio(bp); + g_io_deliver(bp2, bp2->bio_error); +} + +static void +g_uncompress_start(struct bio *bp) +{ + struct g_uncompress_softc *sc; + struct g_provider *pp, *pp2; + struct g_consumer *cp; + struct g_geom *gp; + struct bio *bp2; + uint32_t start_blk, end_blk; + size_t bsize; + + + pp = bp->bio_to; + gp = pp->geom; + DPRINTF(("%s: start (%s) to %s off=%lld len=%lld\n", gp->name, + (bp->bio_cmd==BIO_READ) ? "BIO_READ" : "BIO_WRITE*", + pp->name, bp->bio_offset, bp->bio_length)); + + if (bp->bio_cmd != BIO_READ) { + g_io_deliver(bp, EOPNOTSUPP); + return; + } + + cp = LIST_FIRST(&gp->consumer); + pp2 = cp->provider; + sc = gp->softc; + + start_blk = bp->bio_offset / sc->blksz; + end_blk = howmany(bp->bio_offset + bp->bio_length, sc->blksz); + KASSERT(start_blk < sc->nblocks, + ("start_blk out of range")); + KASSERT(end_blk <= sc->nblocks, + ("end_blk out of range")); + + sc->req_total++; + if (start_blk + 1 == end_blk) { + mtx_lock(&sc->last_mtx); + if (start_blk == sc->last_blk) { + off_t uoff; + + uoff = bp->bio_offset % sc->blksz; + KASSERT(bp->bio_length <= sc->blksz - uoff, + ("cached data error")); + memcpy(bp->bio_data, sc->last_buf + uoff, + bp->bio_length); + sc->req_cached++; + mtx_unlock(&sc->last_mtx); + + DPRINTF(("%s: start: cached 0 + %lld, " + "%lld + 0 + %lld\n", + gp->name, bp->bio_length, uoff, bp->bio_length)); + bp->bio_completed = bp->bio_length; + g_io_deliver(bp, 0); + return; + } + mtx_unlock(&sc->last_mtx); + } + + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + DPRINTF(("%s: start (%d..%d), %s: %d + %llu, %s: %d + %llu\n", + gp->name, start_blk, end_blk, + pp->name, pp->sectorsize, pp->mediasize, + pp2->name, pp2->sectorsize, pp2->mediasize)); + + bsize = pp2->sectorsize; + + bp2->bio_done = g_uncompress_done; + bp2->bio_offset = rounddown(sc->offsets[start_blk],bsize); + bp2->bio_length = roundup(sc->offsets[end_blk],bsize) - + bp2->bio_offset; + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); + + DPRINTF(("%s: start %lld + %lld -> %lld + %lld -> %lld + %lld\n", + gp->name, + bp->bio_offset, bp->bio_length, + sc->offsets[start_blk], + sc->offsets[end_blk] - sc->offsets[start_blk], + bp2->bio_offset, bp2->bio_length)); + + if (bp2->bio_data == NULL) { + g_destroy_bio(bp2); + g_io_deliver(bp, ENOMEM); + return; + } + + g_io_request(bp2, cp); + DPRINTF(("%s: start ok\n", gp->name)); +} + +static void +g_uncompress_orphan(struct g_consumer *cp) +{ + struct g_geom *gp; + + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, + cp->provider->name); + g_topology_assert(); + KASSERT(cp->provider->error != 0, + ("g_uncompress_orphan with error == 0")); + + gp = cp->geom; + g_uncompress_softc_free(gp->softc, gp); + gp->softc = NULL; + g_wither_geom(gp, cp->provider->error); +} + +static int +g_uncompress_access(struct g_provider *pp, int dr, int dw, int de) +{ + struct g_consumer *cp; + struct g_geom *gp; + + gp = pp->geom; + cp = LIST_FIRST(&gp->consumer); + KASSERT (cp != NULL, ("g_uncompress_access but no consumer")); + + if (cp->acw + dw > 0) + return (EROFS); + + return (g_access(cp, dr, dw, de)); +} + +static void +g_uncompress_spoiled(struct g_consumer *cp) +{ + struct g_geom *gp; + + gp = cp->geom; + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, gp->name); + g_topology_assert(); + + g_uncompress_softc_free(gp->softc, gp); + gp->softc = NULL; + g_wither_geom(gp, ENXIO); +} + +static struct g_geom * +g_uncompress_taste(struct g_class *mp, struct g_provider *pp, int flags) +{ + struct cloop_header *header; + struct g_uncompress_softc *sc; + struct g_provider *pp2; + struct g_consumer *cp; + struct g_geom *gp; + uint32_t i, total_offsets, offsets_read, type; + uint8_t *buf; + int error; + + g_trace(G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name); + g_topology_assert(); + + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + + buf = NULL; + + /* + * Create geom instance. + */ + gp = g_new_geomf(mp, "%s.uncompress", pp->name); + cp = g_new_consumer(gp); + error = g_attach(cp, pp); + if (error == 0) + error = g_access(cp, 1, 0, 0); + if (error) { + g_detach(cp); + g_destroy_consumer(cp); + g_destroy_geom(gp); + return (NULL); + } + g_topology_unlock(); + + /* + * Read cloop header, look for CLOOP magic, perform + * other validity checks. + */ + DPRINTF(("%s: media sectorsize %u, mediasize %lld\n", + gp->name, pp->sectorsize, pp->mediasize)); + + i = roundup(sizeof(struct cloop_header), pp->sectorsize); + buf = g_read_data(cp, 0, i, NULL); + if (buf == NULL) + goto err; + + header = (struct cloop_header *) buf; + if (strncmp(header->magic, CLOOP_MAGIC_START, + sizeof(CLOOP_MAGIC_START) - 1) != 0) { + DPRINTF(("%s: no CLOOP magic\n", gp->name)); + goto err; + } + + switch (header->magic[0x0b]) { + case 'L': + type = GEOM_ULZMA; + if (header->magic[0x0c] < GEOM_ULZMA_MAJVER) { + DPRINTF(("%s: image version too old\n", gp->name)); + goto err; + } + printf("%s: GEOM_ULZMA image found\n", gp->name); + break; + case 'V': + type = GEOM_UZIP; + if (header->magic[0x0c] < GEOM_UZIP_MAJVER) { + DPRINTF(("%s: image version too old\n", gp->name)); + goto err; + } + printf("%s: GEOM_UZIP image found\n", gp->name); + break; + default: + DPRINTF(("%s: unsupported image type\n", gp->name)); + goto err; + } + + DPRINTF(("%s: found CLOOP magic\n", gp->name)); + /* + * Initialize softc and read offsets. + */ + sc = malloc(sizeof(*sc), M_GEOM_UNCOMPRESS, M_WAITOK | M_ZERO); + gp->softc = sc; + sc->type = type; + sc->blksz = ntohl(header->blksz); + sc->nblocks = ntohl(header->nblocks); + if (sc->blksz % 4 != 0) { + printf("%s: block size (%u) should be multiple of 4.\n", + gp->name, sc->blksz); + goto err; + } + if (sc->blksz > MAX_BLKSZ) { + printf("%s: block size (%u) should not be larger than %d.\n", + gp->name, sc->blksz, MAX_BLKSZ); + } + total_offsets = sc->nblocks + 1; + if (sizeof(struct cloop_header) + + total_offsets * sizeof(uint64_t) > pp->mediasize) { + printf("%s: media too small for %u blocks\n", + gp->name, sc->nblocks); + goto err; + } + sc->offsets = malloc( + total_offsets * sizeof(uint64_t), M_GEOM_UNCOMPRESS, M_WAITOK); + offsets_read = MIN(total_offsets, + (pp->sectorsize - sizeof(*header)) / sizeof(uint64_t)); + for (i = 0; i < offsets_read; i++) + sc->offsets[i] = be64toh(((uint64_t *) (header + 1))[i]); + DPRINTF(("%s: %u offsets in the first sector\n", + gp->name, offsets_read)); + + free(buf, M_GEOM); + i = roundup((sizeof(struct cloop_header) + + total_offsets * sizeof(uint64_t)),pp->sectorsize); + buf = g_read_data(cp, 0, i, NULL); + if (buf == NULL) + goto err; + for (i = 0; i <= total_offsets; i++) { + sc->offsets[i] = be64toh(((uint64_t *) + (buf+sizeof(struct cloop_header)))[i]); + } + DPRINTF(("%s: done reading offsets\n", gp->name)); + mtx_init(&sc->last_mtx, "geom_uncompress cache", NULL, MTX_DEF); + sc->last_blk = -1; + sc->last_buf = malloc(sc->blksz, M_GEOM_UNCOMPRESS, M_WAITOK); + sc->req_total = 0; + sc->req_cached = 0; + + switch (sc->type) { + case GEOM_ULZMA: + xz_crc32_init(); + sc->s = xz_dec_init(XZ_SINGLE, 0); + sc->b = (struct xz_buf*)malloc(sizeof(struct xz_buf), + M_GEOM_UNCOMPRESS, M_WAITOK); + break; + case GEOM_UZIP: + sc->zs = (z_stream *)malloc(sizeof(z_stream), + M_GEOM_UNCOMPRESS, M_WAITOK); + sc->zs->zalloc = z_alloc; + sc->zs->zfree = z_free; + if (inflateInit(sc->zs) != Z_OK) { + goto err; + } + break; + } + + g_topology_lock(); + pp2 = g_new_providerf(gp, "%s", gp->name); + pp2->sectorsize = 512; + pp2->mediasize = (off_t)sc->nblocks * sc->blksz; + pp2->flags = pp->flags & G_PF_CANDELETE; + if (pp->stripesize > 0) { + pp2->stripesize = pp->stripesize; + pp2->stripeoffset = pp->stripeoffset; + } + g_error_provider(pp2, 0); + free(buf, M_GEOM); + g_access(cp, -1, 0, 0); + + DPRINTF(("%s: taste ok (%d, %lld), (%d, %d), %x\n", + gp->name, + pp2->sectorsize, pp2->mediasize, + pp2->stripeoffset, pp2->stripesize, pp2->flags)); + printf("%s: %u x %u blocks\n", + gp->name, sc->nblocks, sc->blksz); + return (gp); + +err: + g_topology_lock(); + g_access(cp, -1, 0, 0); + if (buf != NULL) + free(buf, M_GEOM); + if (gp->softc != NULL) { + g_uncompress_softc_free(gp->softc, NULL); + gp->softc = NULL; + } + g_detach(cp); + g_destroy_consumer(cp); + g_destroy_geom(gp); + return (NULL); +} + +static int +g_uncompress_destroy_geom(struct gctl_req *req, struct g_class *mp, + struct g_geom *gp) +{ + struct g_provider *pp; + + g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); + g_topology_assert(); + + if (gp->softc == NULL) { + printf("%s(%s): gp->softc == NULL\n", __func__, gp->name); + return (ENXIO); + } + + KASSERT(gp != NULL, ("NULL geom")); + pp = LIST_FIRST(&gp->provider); + KASSERT(pp != NULL, ("NULL provider")); + if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) + return (EBUSY); + + g_uncompress_softc_free(gp->softc, gp); + gp->softc = NULL; + g_wither_geom(gp, ENXIO); + return (0); +} + +static struct g_class g_uncompress_class = { + .name = UNCOMPRESS_CLASS_NAME, + .version = G_VERSION, + .taste = g_uncompress_taste, + .destroy_geom = g_uncompress_destroy_geom, + + .start = g_uncompress_start, + .orphan = g_uncompress_orphan, + .access = g_uncompress_access, + .spoiled = g_uncompress_spoiled, +}; + +DECLARE_GEOM_CLASS(g_uncompress_class, g_uncompress); + Added: head/sys/modules/geom/geom_uncompress/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/geom/geom_uncompress/Makefile Wed Jan 4 23:39:11 2012 (r229537) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../geom/uncompress \ + ${.CURDIR}/../../../contrib/xz-embedded/freebsd/ \ + ${.CURDIR}/../../../contrib/xz-embedded/linux/lib/xz/ \ + ${.CURDIR}/../../../contrib/xz-embedded/linux/include/linux/ \ + ${.CURDIR}/../../../net + +KMOD= geom_uncompress +CFLAGS= -I${.CURDIR}/../../../geom/uncompress/ \ + -I${.CURDIR}/../../../contrib/xz-embedded/freebsd \ + -I${.CURDIR}/../../../contrib/xz-embedded/linux/lib/xz/ +SRCS= g_uncompress.c xz_crc32.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ + xz_malloc.c zlib.c +SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h zlib.h + +.include From owner-svn-src-head@FreeBSD.ORG Wed Jan 4 23:45:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 588D9106564A; Wed, 4 Jan 2012 23:45:11 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 460ED8FC08; Wed, 4 Jan 2012 23:45: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 q04NjBmu004258; Wed, 4 Jan 2012 23:45:11 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04NjBBD004255; Wed, 4 Jan 2012 23:45:11 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201201042345.q04NjBBD004255@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 4 Jan 2012 23:45: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: r229538 - head/usr.bin/mkulzma X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 23:45:11 -0000 Author: ray Date: Wed Jan 4 23:45:10 2012 New Revision: 229538 URL: http://svn.freebsd.org/changeset/base/229538 Log: mkulzma used to create lzma compressed images, just like mkuzip do. Approved by: adrian (mentor) Added: head/usr.bin/mkulzma/ head/usr.bin/mkulzma/Makefile (contents, props changed) head/usr.bin/mkulzma/mkulzma.8 (contents, props changed) head/usr.bin/mkulzma/mkulzma.c (contents, props changed) Added: head/usr.bin/mkulzma/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkulzma/Makefile Wed Jan 4 23:45:10 2012 (r229538) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= mkulzma +MAN= mkulzma.8 +DPADD= ${LIBLZMA} +LDADD= -llzma + +.include Added: head/usr.bin/mkulzma/mkulzma.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkulzma/mkulzma.8 Wed Jan 4 23:45:10 2012 (r229538) @@ -0,0 +1,107 @@ +.\" ---------------------------------------------------------------------------- +.\" Derived from mkuzip.8 by Aleksandr Rybalko +.\" ---------------------------------------------------------------------------- +.\" "THE BEER-WARE LICENSE" (Revision 42): +.\" wrote this file. As long as you retain this notice you +.\" can do whatever you want with this stuff. If we meet some day, and you think +.\" this stuff is worth it, you can buy me a beer in return. Maxim Sobolev +.\" ---------------------------------------------------------------------------- +.\" +.\" $FreeBSD$ +.\" +.Dd March 17, 2006 +.Dt mkulzma 8 +.Os +.Sh NAME +.Nm mkulzma +.Nd compress disk image for use with +.Xr geom_uncompress 4 +class +.Sh SYNOPSIS +.Nm +.Op Fl v +.Op Fl o Ar outfile +.Op Fl s Ar cluster_size +.Ar infile +.Sh DESCRIPTION +The +.Nm +utility compresses a disk image file so that the +.Xr geom_uncompress 4 +class will be able to decompress the resulting image at run-time. +This allows for a significant reduction of size of disk image at +the expense of some CPU time required to decompress the data each +time it is read. +The +.Nm +utility +works in two phases: +.Bl -enum +.It +An +.Ar infile +image is split into clusters; each cluster is compressed using liblzma. +.It +The resulting set of compressed clusters along with headers that allow +locating each individual cluster is written to the output file. +.El +.Pp +The options are: +.Bl -tag -width indent +.It Fl o Ar outfile +Name of the output file +.Ar outfile . +The default is to use the input name with the suffix +.Pa .ulzma . +.It Fl s Ar cluster_size +Split the image into clusters of +.Ar cluster_size +bytes, 16384 bytes by default. +The +.Ar cluster_size +should be a multiple of 512 bytes. +.It Fl v +Display verbose messages. +.El +.Sh NOTES +The compression ratio largely depends on the cluster size used. +.\" The following two sentences are unclear: how can xz(1) be +.\" used in a comparable fashion, and wouldn't a lzma-compressed +.\" image suffer from larger cluster sizes as well? +For large cluster sizes (16K and higher), typical compression ratios +are only 1-2% less than those achieved with +.Xr lzma 1 . +However, it should be kept in mind that larger cluster +sizes lead to higher overhead in the +.Xr geom_uncompress 4 +class, as the class has to decompress the whole cluster even if +only a few bytes from that cluster have to be read. +.Pp +The +.Nm +utility +inserts a short shell script at the beginning of the generated image, +which makes it possible to +.Dq run +the image just like any other shell script. +The script tries to load the +.Xr geom_uncompress 4 +class if it is not loaded, configure the image as an +.Xr md 4 +disk device using +.Xr mdconfig 8 , +and automatically mount it using +.Xr mount_cd9660 8 +on the mount point provided as the first argument to the script. +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr lzma 1 , +.Xr geom 4 , +.Xr geom_uncompress 4 , +.Xr md 4 , +.Xr mdconfig 8 , +.Xr mount_cd9660 8 +.Sh AUTHORS +.An Maxim Sobolev Aq sobomax@FreeBSD.org +.An Aleksandr Rybalko Aq ray@ddteam.net Added: head/usr.bin/mkulzma/mkulzma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkulzma/mkulzma.c Wed Jan 4 23:45:10 2012 (r229538) @@ -0,0 +1,330 @@ +/* + * ---------------------------------------------------------------------------- + * Derived from mkuzip.c by Aleksandr Rybalko + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Maxim Sobolev + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define CLSTSIZE 16384 +#define DEFAULT_SUFX ".ulzma" + +#define USED_BLOCKSIZE DEV_BSIZE + +#define CLOOP_MAGIC_LEN 128 +/* Format L3.0, since we move to XZ API */ +static char CLOOP_MAGIC_START[] = + "#!/bin/sh\n" + "#L3.0\n" + "n=uncompress\n" + "m=geom_$n\n" + "(kldstat -m $m 2>&-||kldload $m)>&-&&" + "mount_cd9660 /dev/`mdconfig -af $0`.$n $1\n" + "exit $?\n"; + +static char *readblock(int, char *, u_int32_t); +static void usage(void); +static void *safe_malloc(size_t); +static void cleanup(void); + +static char *cleanfile = NULL; + +int main(int argc, char **argv) +{ + char *iname, *oname, *obuf, *ibuf; + int fdr, fdw, i, opt, verbose, tmp; + struct iovec iov[2]; + struct stat sb; + uint32_t destlen; + uint64_t offset; + uint64_t *toc; + lzma_filter filters[2]; + lzma_options_lzma opt_lzma; + lzma_ret ret; + lzma_stream strm = LZMA_STREAM_INIT; + struct cloop_header { + char magic[CLOOP_MAGIC_LEN]; /* cloop magic */ + uint32_t blksz; /* block size */ + uint32_t nblocks; /* number of blocks */ + } hdr; + + memset(&hdr, 0, sizeof(hdr)); + hdr.blksz = CLSTSIZE; + strcpy(hdr.magic, CLOOP_MAGIC_START); + oname = NULL; + verbose = 0; + + while((opt = getopt(argc, argv, "o:s:v")) != -1) { + switch(opt) { + case 'o': + oname = optarg; + break; + + case 's': + tmp = atoi(optarg); + if (tmp <= 0) { + errx(1, + "invalid cluster size specified: %s", + optarg); + /* Not reached */ + } + if (tmp % USED_BLOCKSIZE != 0) { + errx(1, + "cluster size should be multiple of %d", + USED_BLOCKSIZE); + /* Not reached */ + } + if ( tmp > MAXPHYS) { + errx(1, "cluster size is too large"); + /* Not reached */ + } + hdr.blksz = tmp; + break; + + case 'v': + verbose = 1; + break; + + default: + usage(); + /* Not reached */ + } + } + argc -= optind; + argv += optind; + + if (argc != 1) { + usage(); + /* Not reached */ + } + + iname = argv[0]; + if (oname == NULL) { + asprintf(&oname, "%s%s", iname, DEFAULT_SUFX); + if (oname == NULL) { + err(1, "can't allocate memory"); + /* Not reached */ + } + } + + obuf = safe_malloc(hdr.blksz*2); + ibuf = safe_malloc(hdr.blksz); + + signal(SIGHUP, exit); + signal(SIGINT, exit); + signal(SIGTERM, exit); + signal(SIGXCPU, exit); + signal(SIGXFSZ, exit); + atexit(cleanup); + + fdr = open(iname, O_RDONLY); + if (fdr < 0) { + err(1, "open(%s)", iname); + /* Not reached */ + } + if (fstat(fdr, &sb) != 0) { + err(1, "fstat(%s)", iname); + /* Not reached */ + } + if (S_ISCHR(sb.st_mode)) { + off_t ms; + + if (ioctl(fdr, DIOCGMEDIASIZE, &ms) < 0) { + err(1, "ioctl(DIOCGMEDIASIZE)"); + /* Not reached */ + } + sb.st_size = ms; + } else if (!S_ISREG(sb.st_mode)) { + fprintf(stderr, + "%s: not a character device or regular file\n", + iname); + exit(1); + } + hdr.nblocks = sb.st_size / hdr.blksz; + if ((sb.st_size % hdr.blksz) != 0) { + if (verbose != 0) + fprintf(stderr, "file size is not multiple " + "of %d, padding data\n", hdr.blksz); + hdr.nblocks++; + } + toc = safe_malloc((hdr.nblocks + 1) * sizeof(*toc)); + + fdw = open(oname, O_WRONLY | O_TRUNC | O_CREAT, + S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + if (fdw < 0) { + err(1, "open(%s)", oname); + /* Not reached */ + } + cleanfile = oname; + + /* + * Prepare header that we will write later when we have index ready. + */ + iov[0].iov_base = (char *)&hdr; + iov[0].iov_len = sizeof(hdr); + iov[1].iov_base = (char *)toc; + iov[1].iov_len = (hdr.nblocks + 1) * sizeof(*toc); + offset = iov[0].iov_len + iov[1].iov_len; + + /* Reserve space for header */ + lseek(fdw, offset, SEEK_SET); + + if (verbose != 0) + fprintf(stderr, "data size %ju bytes, number of clusters " + "%u, index length %zu bytes\n", sb.st_size, + hdr.nblocks, iov[1].iov_len); + + /* Init lzma encoder */ + if (lzma_lzma_preset(&opt_lzma, LZMA_PRESET_DEFAULT)) + errx(1, "Error loading LZMA preset"); + + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = &opt_lzma; + filters[1].id = LZMA_VLI_UNKNOWN; + + for(i = 0; i == 0 || ibuf != NULL; i++) { + ibuf = readblock(fdr, ibuf, hdr.blksz); + if (ibuf != NULL) { + destlen = hdr.blksz*2; + + ret = lzma_stream_encoder(&strm, filters, + LZMA_CHECK_CRC32); + if (ret != LZMA_OK) { + if (ret == LZMA_MEMLIMIT_ERROR) + errx(1, "can't compress data: " + "LZMA_MEMLIMIT_ERROR"); + + errx(1, "can't compress data: " + "LZMA compressor ERROR"); + } + + strm.next_in = ibuf; + strm.avail_in = hdr.blksz; + strm.next_out = obuf; + strm.avail_out = hdr.blksz*2; + + ret = lzma_code(&strm, LZMA_FINISH); + + if (ret != LZMA_STREAM_END) { + /* Error */ + errx(1, "lzma_code FINISH failed, code=%d, " + "pos(in=%zd, out=%zd)", + ret, + (hdr.blksz - strm.avail_in), + (hdr.blksz*2 - strm.avail_out)); + } + + destlen -= strm.avail_out; + + lzma_end(&strm); + + if (verbose != 0) + fprintf(stderr, "cluster #%d, in %u bytes, " + "out %u bytes\n", i, hdr.blksz, destlen); + } else { + destlen = USED_BLOCKSIZE - (offset % USED_BLOCKSIZE); + memset(obuf, 0, destlen); + if (verbose != 0) + fprintf(stderr, "padding data with %u bytes" + " so that file size is multiple of %d\n", + destlen, + USED_BLOCKSIZE); + } + if (write(fdw, obuf, destlen) < 0) { + err(1, "write(%s)", oname); + /* Not reached */ + } + toc[i] = htobe64(offset); + offset += destlen; + } + close(fdr); + + if (verbose != 0) + fprintf(stderr, "compressed data to %ju bytes, saved %lld " + "bytes, %.2f%% decrease.\n", offset, + (long long)(sb.st_size - offset), + 100.0 * (long long)(sb.st_size - offset) / + (float)sb.st_size); + + /* Convert to big endian */ + hdr.blksz = htonl(hdr.blksz); + hdr.nblocks = htonl(hdr.nblocks); + /* Write headers into pre-allocated space */ + lseek(fdw, 0, SEEK_SET); + if (writev(fdw, iov, 2) < 0) { + err(1, "writev(%s)", oname); + /* Not reached */ + } + cleanfile = NULL; + close(fdw); + + exit(0); +} + +static char * +readblock(int fd, char *ibuf, u_int32_t clstsize) +{ + int numread; + + bzero(ibuf, clstsize); + numread = read(fd, ibuf, clstsize); + if (numread < 0) { + err(1, "read() failed"); + /* Not reached */ + } + if (numread == 0) { + return NULL; + } + return ibuf; +} + +static void +usage(void) +{ + + fprintf(stderr, "usage: mkulzma [-v] [-o outfile] [-s cluster_size] " + "infile\n"); + exit(1); +} + +static void * +safe_malloc(size_t size) +{ + void *retval; + + retval = malloc(size); + if (retval == NULL) { + err(1, "can't allocate memory"); + /* Not reached */ + } + return retval; +} + +static void +cleanup(void) +{ + + if (cleanfile != NULL) + unlink(cleanfile); +} From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 01:13:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4E4B106566B; Thu, 5 Jan 2012 01:13:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3E548FC0A; Thu, 5 Jan 2012 01:13: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 q051DP5p007565; Thu, 5 Jan 2012 01:13:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q051DPbn007563; Thu, 5 Jan 2012 01:13:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201050113.q051DPbn007563@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 5 Jan 2012 01:13: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: r229546 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 01:13:25 -0000 Author: bz Date: Thu Jan 5 01:13:25 2012 New Revision: 229546 URL: http://svn.freebsd.org/changeset/base/229546 Log: Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT. MFC after: 1 week Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Jan 5 00:11:04 2012 (r229545) +++ head/sys/netinet6/in6_ifattach.c Thu Jan 5 01:13:25 2012 (r229546) @@ -513,12 +513,8 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); + ifa_free(&ia->ia_ifa); /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 01:14:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CDC0106564A; Thu, 5 Jan 2012 01:14:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1180D8FC0C; Thu, 5 Jan 2012 01:14: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 q051EZrE007644; Thu, 5 Jan 2012 01:14:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q051EZBI007641; Thu, 5 Jan 2012 01:14:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201050114.q051EZBI007641@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 5 Jan 2012 01:14: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: r229547 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 01:14:36 -0000 Author: bz Date: Thu Jan 5 01:14:35 2012 New Revision: 229547 URL: http://svn.freebsd.org/changeset/base/229547 Log: Mark a couple of file local functions static and stop exporting them. MFC after: 1 week Modified: head/sys/netinet6/nd6.h head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Jan 5 01:13:25 2012 (r229546) +++ head/sys/netinet6/nd6.h Thu Jan 5 01:14:35 2012 (r229547) @@ -434,15 +434,12 @@ void nd6_dad_duplicated __P((struct ifad void nd6_rs_input __P((struct mbuf *, int, int)); void nd6_ra_input __P((struct mbuf *, int, int)); void prelist_del __P((struct nd_prefix *)); -void defrouter_addreq __P((struct nd_defrouter *)); void defrouter_reset __P((void)); void defrouter_select __P((void)); void defrtrlist_del __P((struct nd_defrouter *)); void prelist_remove __P((struct nd_prefix *)); int nd6_prelist_add __P((struct nd_prefixctl *, struct nd_defrouter *, struct nd_prefix **)); -int nd6_prefix_onlink __P((struct nd_prefix *)); -int nd6_prefix_offlink __P((struct nd_prefix *)); void pfxlist_onlink_check __P((void)); struct nd_defrouter *defrouter_lookup __P((struct in6_addr *, struct ifnet *)); struct nd_prefix *nd6_prefix_lookup __P((struct nd_prefixctl *)); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Thu Jan 5 01:13:25 2012 (r229546) +++ head/sys/netinet6/nd6_rtr.c Thu Jan 5 01:14:35 2012 (r229547) @@ -84,6 +84,9 @@ static int in6_init_prefix_ltimes(struct static void in6_init_address_ltimes __P((struct nd_prefix *, struct in6_addrlifetime *)); +static int nd6_prefix_onlink(struct nd_prefix *); +static int nd6_prefix_offlink(struct nd_prefix *); + static int rt6_deleteroute(struct radix_node *, void *); VNET_DECLARE(int, nd6_recalc_reachtm_interval); @@ -465,7 +468,7 @@ nd6_rtmsg(int cmd, struct rtentry *rt) ifa_free(ifa); } -void +static void defrouter_addreq(struct nd_defrouter *new) { struct sockaddr_in6 def, mask, gate; @@ -1537,7 +1540,7 @@ pfxlist_onlink_check() } } -int +static int nd6_prefix_onlink(struct nd_prefix *pr) { struct ifaddr *ifa; @@ -1662,7 +1665,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) return (error); } -int +static int nd6_prefix_offlink(struct nd_prefix *pr) { int error = 0; From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 03:38:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 336FB106564A; Thu, 5 Jan 2012 03:38:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21DC78FC08; Thu, 5 Jan 2012 03:38: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 q053cZnL012839; Thu, 5 Jan 2012 03:38:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q053cZs5012837; Thu, 5 Jan 2012 03:38:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201050338.q053cZs5012837@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 03:38: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: r229556 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 03:38:35 -0000 Author: adrian Date: Thu Jan 5 03:38:34 2012 New Revision: 229556 URL: http://svn.freebsd.org/changeset/base/229556 Log: Use geom_uncompress now, rather than geom_uzip. This results in a much smaller rootfs image and it easily fits in the 8MB flash. Modified: head/sys/mips/conf/PB47 Modified: head/sys/mips/conf/PB47 ============================================================================== --- head/sys/mips/conf/PB47 Thu Jan 5 03:22:21 2012 (r229555) +++ head/sys/mips/conf/PB47 Thu Jan 5 03:38:34 2012 (r229556) @@ -40,12 +40,12 @@ nooptions IEEE80211_SUPPORT_TDMA #options GEOM_PART_MBR #options MSDOSFS -# uzip - to boot natively from flash -device geom_uzip -options GEOM_UZIP +# uncompress - to boot read-only lzma natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 06:22:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6464106564A; Thu, 5 Jan 2012 06:22:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0DBF8FC08; Thu, 5 Jan 2012 06:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q056M9sf018049; Thu, 5 Jan 2012 06:22:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q056M9EW018047; Thu, 5 Jan 2012 06:22:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201050622.q056M9EW018047@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 06:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229560 - head/sys/modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 06:22:10 -0000 Author: adrian Date: Thu Jan 5 06:22:09 2012 New Revision: 229560 URL: http://svn.freebsd.org/changeset/base/229560 Log: Re-enable this bit of logic from before, which only sets a default opt_ah.h file if KERNBUILDDIR isn't defined. For now, AH_SUPPORT_AR5416 is required, so I'll just fix any configuration file in /usr/src which is missing this option. Pointy hat when things do break to: adrian Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Thu Jan 5 04:50:28 2012 (r229559) +++ head/sys/modules/ath/Makefile Thu Jan 5 06:22:09 2012 (r229560) @@ -140,8 +140,10 @@ SRCS+= dfs_null.c CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal +.if !defined(KERNBUILDDIR) opt_ah.h: echo '#define AH_SUPPORT_AR5416 1' > $@ +.endif .include From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 07:19:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6873C106566B; Thu, 5 Jan 2012 07:19:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52BD38FC0A; Thu, 5 Jan 2012 07:19:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q057J6Cj019745; Thu, 5 Jan 2012 07:19:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q057J5d2019743; Thu, 5 Jan 2012 07:19:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201050719.q057J5d2019743@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 07:19: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: r229561 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 07:19:06 -0000 Author: adrian Date: Thu Jan 5 07:19:05 2012 New Revision: 229561 URL: http://svn.freebsd.org/changeset/base/229561 Log: This isn't required any longer - it turns out the flash has ~ 1.7MB of space for a kernel. There's thus plenty of space for a full, non-module kernel. Modified: head/sys/mips/conf/PB47 Modified: head/sys/mips/conf/PB47 ============================================================================== --- head/sys/mips/conf/PB47 Thu Jan 5 06:22:09 2012 (r229560) +++ head/sys/mips/conf/PB47 Thu Jan 5 07:19:05 2012 (r229561) @@ -24,21 +24,12 @@ options AR71XX_ENV_UBOOT # XXX TODO: add uboot boot parameter parsing to extract MAC, RAM. # Right now it will just detect 32mb out of 64mb, as well as # return a garbage MAC address. - -# don't compile these in - the default flash area for kernel space -# is only 1.2 megabytes. To keep the flash allocation in line with -# what the documentation says for this board, we'll just have to keep -# the kernel smaller than that. -nodevice wlan, wlan_wep, wlan_ccmp, wlan_tkip, wlan_xauth -nodevice ath, ath_pci, ath_hal, ath_rate_sample - -# Since the module build doesn't like TDMA.. -nooptions IEEE80211_SUPPORT_TDMA +options AR71XX_REALMEM=64*1024*1024 # For DOS - enable if required -#options GEOM_PART_BSD -#options GEOM_PART_MBR -#options MSDOSFS +options GEOM_PART_BSD +options GEOM_PART_MBR +options MSDOSFS # uncompress - to boot read-only lzma natively from flash device geom_uncompress From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 08:51:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 647111065672; Thu, 5 Jan 2012 08:51:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7368FC15; Thu, 5 Jan 2012 08:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q058p7mm022646; Thu, 5 Jan 2012 08:51:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q058p7IP022644; Thu, 5 Jan 2012 08:51:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201050851.q058p7IP022644@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 08:51: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: r229562 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 08:51:07 -0000 Author: ed Date: Thu Jan 5 08:51:06 2012 New Revision: 229562 URL: http://svn.freebsd.org/changeset/base/229562 Log: Also import WEAK_ALIAS() from the MIPS code. Modified: head/sys/i386/include/asm.h Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Thu Jan 5 07:19:05 2012 (r229561) +++ head/sys/i386/include/asm.h Thu Jan 5 08:51:06 2012 (r229562) @@ -90,6 +90,13 @@ #endif /* + * WEAK_ALIAS: create a weak alias. + */ +#define WEAK_ALIAS(alias,sym) \ + .weak alias; \ + alias = sym + +/* * STRONG_ALIAS: create a strong alias. */ #define STRONG_ALIAS(alias,sym) \ From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 10:32:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A52106566B; Thu, 5 Jan 2012 10:32:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A61578FC15; Thu, 5 Jan 2012 10:32: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 q05AWrkh027260; Thu, 5 Jan 2012 10:32:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05AWriJ027252; Thu, 5 Jan 2012 10:32:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051032.q05AWriJ027252@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 10:32: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: r229571 - in head/lib/libc: i386/string mips/string string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 10:32:53 -0000 Author: ed Date: Thu Jan 5 10:32:53 2012 New Revision: 229571 URL: http://svn.freebsd.org/changeset/base/229571 Log: Change index() and rindex() to a weak alias. This allows people to still write statically linked applications that call strchr() or strrchr() and have a local variable or function called index. Discussed with: bde@ Modified: head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strrchr.S head/lib/libc/mips/string/strchr.S head/lib/libc/mips/string/strrchr.S head/lib/libc/string/strchr.c head/lib/libc/string/strrchr.c Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/i386/string/strchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -63,6 +63,6 @@ L2: ret END(strchr) -STRONG_ALIAS(index, strchr) +WEAK_ALIAS(index, strchr) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/i386/string/strrchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -64,6 +64,6 @@ L2: ret END(strrchr) -STRONG_ALIAS(rindex, strrchr) +WEAK_ALIAS(rindex, strrchr) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/mips/string/strchr.S ============================================================================== --- head/lib/libc/mips/string/strchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/mips/string/strchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -58,4 +58,4 @@ fnd: j ra END(strchr) -STRONG_ALIAS(index, strchr) +WEAK_ALIAS(index, strchr) Modified: head/lib/libc/mips/string/strrchr.S ============================================================================== --- head/lib/libc/mips/string/strrchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/mips/string/strrchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -56,4 +56,4 @@ LEAF(strrchr) j ra END(strrchr) -STRONG_ALIAS(rindex, strrchr) +WEAK_ALIAS(rindex, strrchr) Modified: head/lib/libc/string/strchr.c ============================================================================== --- head/lib/libc/string/strchr.c Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/string/strchr.c Thu Jan 5 10:32:53 2012 (r229571) @@ -51,4 +51,4 @@ strchr(const char *p, int ch) /* NOTREACHED */ } -__strong_reference(strchr, index); +__weak_reference(strchr, index); Modified: head/lib/libc/string/strrchr.c ============================================================================== --- head/lib/libc/string/strrchr.c Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/string/strrchr.c Thu Jan 5 10:32:53 2012 (r229571) @@ -52,4 +52,4 @@ strrchr(const char *p, int ch) /* NOTREACHED */ } -__strong_reference(strrchr, rindex); +__weak_reference(strrchr, rindex); From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 10:40:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ABB3106566B; Thu, 5 Jan 2012 10:40:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5514A8FC08; Thu, 5 Jan 2012 10:40:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05AePGB027830; Thu, 5 Jan 2012 10:40:25 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05AePQI027827; Thu, 5 Jan 2012 10:40:25 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201201051040.q05AePQI027827@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 5 Jan 2012 10:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229572 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 10:40:25 -0000 Author: bapt Date: Thu Jan 5 10:40:24 2012 New Revision: 229572 URL: http://svn.freebsd.org/changeset/base/229572 Log: Add new pw_make_v7 to make a passwd line (in v7 format) out of a struct passwd while here, fix missing parentheses of the return statement of pw_make. Approved by: des (mentor) Modified: head/lib/libutil/libutil.h head/lib/libutil/pw_util.c Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 5 10:32:53 2012 (r229571) +++ head/lib/libutil/libutil.h Thu Jan 5 10:40:24 2012 (r229572) @@ -144,6 +144,7 @@ int pw_equal(const struct passwd *_pw1, void pw_fini(void); int pw_init(const char *_dir, const char *_master); char *pw_make(const struct passwd *_pw); +char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); int pw_lock(void); struct passwd *pw_scan(const char *_line, int _flags); Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Thu Jan 5 10:32:53 2012 (r229571) +++ head/lib/libutil/pw_util.c Thu Jan 5 10:40:24 2012 (r229572) @@ -406,7 +406,21 @@ pw_make(const struct passwd *pw) pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire, pw->pw_gecos, pw->pw_dir, pw->pw_shell); - return line; + return (line); +} + +/* + * Make a passwd line (in v7 format) out of a struct passwd + */ +char * +pw_make_v7(const struct passwd *pw) +{ + char *line; + + asprintf(&line, "%s:*:%ju:%ju:%s:%s:%s", pw->pw_name, + (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, + pw->pw_gecos, pw->pw_dir, pw->pw_shell); + return (line); } /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 10:43:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88BDC1065672; Thu, 5 Jan 2012 10:43:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73E7D8FC0C; Thu, 5 Jan 2012 10:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05Ah4hE028124; Thu, 5 Jan 2012 10:43:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05Ah4ea028122; Thu, 5 Jan 2012 10:43:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051043.q05Ah4ea028122@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 10:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229574 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 10:43:04 -0000 Author: ed Date: Thu Jan 5 10:43:03 2012 New Revision: 229574 URL: http://svn.freebsd.org/changeset/base/229574 Log: Add __generic(), to be able to use a very simple _Generic(). Already introducing this allows us to be forward compatible with C11 compilers. By implementing on top of this interface, it becomes trivial to support both our existing GCC and newer compilers. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Jan 5 10:42:19 2012 (r229573) +++ head/sys/sys/cdefs.h Thu Jan 5 10:43:03 2012 (r229574) @@ -248,6 +248,24 @@ #endif #endif +/* + * Emulation of C11 _Generic(). Unlike the previously defined C11 + * keywords, it is not possible to implement this using exactly the same + * syntax. Therefore implement something similar under the name + * __generic(). Unlike _Generic(), this macro can only distinguish + * between a single type, so it requires nested invocations to + * distinguish multiple cases. + */ + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#define __generic(expr, t, yes, no) \ + _Generic(expr, t: yes, default: no) +#elif __GNUC_PREREQ__(3, 1) +#define __generic(expr, t, yes, no) \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(expr), t), yes, no) +#endif + #if __GNUC_PREREQ__(2, 96) #define __malloc_like __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 10:46:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A20A1065678; Thu, 5 Jan 2012 10:46:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 734E68FC14; Thu, 5 Jan 2012 10:46: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 q05AkNM2028464; Thu, 5 Jan 2012 10:46:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05AkNAU028461; Thu, 5 Jan 2012 10:46:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051046.q05AkNAU028461@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 10:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229575 - in head: include share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 10:46:23 -0000 Author: ed Date: Thu Jan 5 10:46:22 2012 New Revision: 229575 URL: http://svn.freebsd.org/changeset/base/229575 Log: Reimplement on top of __generic(). The macro construction used now, is almost identical to the code provided in C11 proposal N1404. This new version doesn't seem to introduce any regressions according to the regression test in tools/, but still seems to malfunction with Clang on certain aspects. The new code does work successfully with GCC 4.2, 4.6 and 4.7. With 4.7, it also works when __generic() is implemented on top of _Generic(). Discussed with: stefanf Modified: head/include/tgmath.h head/share/man/man3/tgmath.3 Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Thu Jan 5 10:43:03 2012 (r229574) +++ head/include/tgmath.h Thu Jan 5 10:46:22 2012 (r229575) @@ -2,6 +2,9 @@ * Copyright (c) 2004 Stefan Farfeleder. * All rights reserved. * + * Copyright (c) 2012 Ed Schouten + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -33,64 +36,83 @@ #include /* - * This implementation of requires two implementation-dependent - * macros to be defined: - * __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) + * This implementation of uses the two following macros, + * which are based on the macros described in C11 proposal N1404: + * __tg_impl_simple(x, y, z, fnl, fn, fnf, ...) * Invokes fnl() if the corresponding real type of x, y or z is long * double, fn() if it is double or any has an integer type, and fnf() * otherwise. - * __tg_impl_full(x, y, z, fn, fnf, fnl, cfn, cfnf, cfnl, ...) - * Invokes [c]fnl() if the corresponding real type of x, y or z is long + * __tg_impl_full(x, y, cfnl, cfn, cfnf, fnl, fn, fnf, ...) + * Invokes [c]fnl() if the corresponding real type of x or y is long * double, [c]fn() if it is double or any has an integer type, and * [c]fnf() otherwise. The function with the 'c' prefix is called if - * any of x, y or z is a complex number. + * any of x or y is a complex number. * Both macros call the chosen function with all additional arguments passed * to them, as given by __VA_ARGS__. * * Note that these macros cannot be implemented with C's ?: operator, * because the return type of the whole expression would incorrectly be long * double complex regardless of the argument types. + * + * The _Complex_I distinction should not be needed, but due to a bug in + * GCC 4.2, _Complex_I is not of type float _Complex. */ -#if __GNUC_PREREQ__(3, 1) -#define __tg_type(e, t) __builtin_types_compatible_p(__typeof__(e), t) -#define __tg_type3(e1, e2, e3, t) \ - (__tg_type(e1, t) || __tg_type(e2, t) || __tg_type(e3, t)) -#define __tg_type_corr(e1, e2, e3, t) \ - (__tg_type3(e1, e2, e3, t) || __tg_type3(e1, e2, e3, t _Complex)) -#define __tg_integer(e1, e2, e3) \ - (((__typeof__(e1))1.5 == 1) || ((__typeof__(e2))1.5 == 1) || \ - ((__typeof__(e3))1.5 == 1)) -#define __tg_is_complex(e1, e2, e3) \ - (__tg_type3(e1, e2, e3, float _Complex) || \ - __tg_type3(e1, e2, e3, double _Complex) || \ - __tg_type3(e1, e2, e3, long double _Complex) || \ - __tg_type3(e1, e2, e3, __typeof__(_Complex_I))) - -#define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \ - __builtin_choose_expr(__tg_type_corr(x, y, z, long double), \ - fnl(__VA_ARGS__), __builtin_choose_expr( \ - __tg_type_corr(x, y, z, double) || __tg_integer(x, y, z),\ - fn(__VA_ARGS__), fnf(__VA_ARGS__))) - -#define __tg_impl_full(x, y, z, fn, fnf, fnl, cfn, cfnf, cfnl, ...) \ - __builtin_choose_expr(__tg_is_complex(x, y, z), \ - __tg_impl_simple(x, y, z, cfn, cfnf, cfnl, __VA_ARGS__), \ - __tg_impl_simple(x, y, z, fn, fnf, fnl, __VA_ARGS__)) - -#else /* __GNUC__ */ +#ifndef __generic #error " not implemented for this compiler" -#endif /* !__GNUC__ */ +#endif + +#define __tg_generic_simple(x, fnl, fn, fnf) \ + __generic(x, long double _Complex, fnl, \ + __generic(x, double _Complex, fn, \ + __generic(x, float _Complex, fnf, \ + __generic(x, __typeof(_Complex_I), fnf, \ + __generic(x, long double, fnl, \ + __generic(x, float, fnf, fn)))))) +#define __tg_impl_simple(x, y, z, fnl, fn, fnf, ...) \ + __tg_generic_simple(x, \ + __tg_generic_simple(y, \ + __tg_generic_simple(z, fnl, fnl, fnl), \ + __tg_generic_simple(z, fnl, fnl, fnl), \ + __tg_generic_simple(z, fnl, fnl, fnl)), \ + __tg_generic_simple(y, \ + __tg_generic_simple(z, fnl, fnl, fnl), \ + __tg_generic_simple(z, fnl, fn , fn ), \ + __tg_generic_simple(z, fnl, fn , fn )), \ + __tg_generic_simple(y, \ + __tg_generic_simple(z, fnl, fnl, fnl), \ + __tg_generic_simple(z, fnl, fn , fn ), \ + __tg_generic_simple(z, fnl, fn , fnf)))(__VA_ARGS__) +#define __tg_generic_full(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ + __generic(x, long double _Complex, cfnl, \ + __generic(x, double _Complex, cfn, \ + __generic(x, float _Complex, cfnf, \ + __generic(x, __typeof(_Complex_I), cfnf, \ + __generic(x, long double, fnl, \ + __generic(x, float, fnf, fn)))))) +#define __tg_impl_full(x, y, cfnl, cfn, cfnf, fnl, fn, fnf, ...) \ + __tg_generic_full(x, \ + __tg_generic_full(y, cfnl, cfnl, cfnl, cfnl, cfnl, cfnl), \ + __tg_generic_full(y, cfnl, cfn , cfn , cfnl, cfn , cfn ), \ + __tg_generic_full(y, cfnl, cfn , cfnf, cfnl, cfn , cfnf), \ + __tg_generic_full(y, cfnl, cfnl, cfnl, fnl , fnl , fnl ), \ + __tg_generic_full(y, cfnl, cfn , cfn , fnl , fn , fn ), \ + __tg_generic_full(y, cfnl, cfn , cfnf, fnl , fn , fnf )) \ + (__VA_ARGS__) /* Macros to save lots of repetition below */ #define __tg_simple(x, fn) \ - __tg_impl_simple(x, x, x, fn, fn##f, fn##l, x) + __tg_impl_simple(x, x, x, fn##l, fn, fn##f, x) #define __tg_simple2(x, y, fn) \ - __tg_impl_simple(x, x, y, fn, fn##f, fn##l, x, y) + __tg_impl_simple(x, x, y, fn##l, fn, fn##f, x, y) +#define __tg_simple3(x, y, z, fn) \ + __tg_impl_simple(x, y, z, fn##l, fn, fn##f, x, y, z) #define __tg_simplev(x, fn, ...) \ - __tg_impl_simple(x, x, x, fn, fn##f, fn##l, __VA_ARGS__) + __tg_impl_simple(x, x, x, fn##l, fn, fn##f, __VA_ARGS__) #define __tg_full(x, fn) \ - __tg_impl_full(x, x, x, fn, fn##f, fn##l, c##fn, c##fn##f, c##fn##l, x) + __tg_impl_full(x, x, c##fn##l, c##fn, c##fn##f, fn##l, fn, fn##f, x) +#define __tg_full2(x, y, fn) \ + __tg_impl_full(x, y, c##fn##l, c##fn, c##fn##f, fn##l, fn, fn##f, x, y) /* 7.22#4 -- These macros expand to real or complex functions, depending on * the type of their arguments. */ @@ -108,13 +130,12 @@ #define tanh(x) __tg_full(x, tanh) #define exp(x) __tg_full(x, exp) #define log(x) __tg_full(x, log) -#define pow(x, y) __tg_impl_full(x, x, y, pow, powf, powl, \ - cpow, cpowf, cpowl, x, y) +#define pow(x, y) __tg_full2(x, y, pow) #define sqrt(x) __tg_full(x, sqrt) /* "The corresponding type-generic macro for fabs and cabs is fabs." */ -#define fabs(x) __tg_impl_full(x, x, x, fabs, fabsf, fabsl, \ - cabs, cabsf, cabsl, x) +#define fabs(x) __tg_impl_full(x, x, cabsl, cabs, cabsf, \ + fabsl, fabs, fabsf, x) /* 7.22#5 -- These macros are only defined for arguments with real type. */ #define atan2(x, y) __tg_simple2(x, y, atan2) @@ -127,7 +148,7 @@ #define expm1(x) __tg_simple(x, expm1) #define fdim(x, y) __tg_simple2(x, y, fdim) #define floor(x) __tg_simple(x, floor) -#define fma(x, y, z) __tg_impl_simple(x, y, z, fma, fmaf, fmal, x, y, z) +#define fma(x, y, z) __tg_simple3(x, y, z, fma) #define fmax(x, y) __tg_simple2(x, y, fmax) #define fmin(x, y) __tg_simple2(x, y, fmin) #define fmod(x, y) __tg_simple2(x, y, fmod) @@ -148,8 +169,8 @@ #define nextafter(x, y) __tg_simple2(x, y, nextafter) #define nexttoward(x, y) __tg_simplev(x, nexttoward, x, y) #define remainder(x, y) __tg_simple2(x, y, remainder) -#define remquo(x, y, z) __tg_impl_simple(x, x, y, remquo, remquof, \ - remquol, x, y, z) +#define remquo(x, y, z) __tg_impl_simple(x, x, y, remquol, remquo, \ + remquof, x, y, z) #define rint(x) __tg_simple(x, rint) #define round(x) __tg_simple(x, round) #define scalbn(x, y) __tg_simplev(x, scalbn, x, y) Modified: head/share/man/man3/tgmath.3 ============================================================================== --- head/share/man/man3/tgmath.3 Thu Jan 5 10:43:03 2012 (r229574) +++ head/share/man/man3/tgmath.3 Thu Jan 5 10:46:22 2012 (r229575) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2004 +.Dd January 4, 2012 .Dt TGMATH 3 .Os .Sh NAME @@ -139,15 +139,24 @@ The header .In tgmath.h first appeared in .Fx 5.3 . -.Sh BUGS -The header +.Sh COMPILER SUPPORT +Before +.St -isoC-11 , +the header .In tgmath.h -cannot be implemented with strictly conforming C code and needs +could not be implemented with strictly conforming C code and needed special compiler support. -The current implementation only works for GCC. -.Pp +As of +.St -isoC-11 , +this header file can be implemented using the +.Fn _Generic +language keyword. +In addition to compilers that support this keyword, this header file +works with GCC. +.Sh BUGS Many of the functions mentioned here are not prototyped in .In math.h or .In complex.h as they are not yet implemented. +This prevents the corresponding type-generic macro from working at all. From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 11:16:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F69B1065672; Thu, 5 Jan 2012 11:16:43 +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 7A9E48FC12; Thu, 5 Jan 2012 11:16: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 q05BGhFX031526; Thu, 5 Jan 2012 11:16:43 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05BGhvI031524; Thu, 5 Jan 2012 11:16:43 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201051116.q05BGhvI031524@svn.freebsd.org> From: Christian Brueffer Date: Thu, 5 Jan 2012 11:16: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: r229585 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 11:16:43 -0000 Author: brueffer Date: Thu Jan 5 11:16:42 2012 New Revision: 229585 URL: http://svn.freebsd.org/changeset/base/229585 Log: Fix typo. MFC after: 1 week Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Thu Jan 5 11:14:54 2012 (r229584) +++ head/share/man/man4/bce.4 Thu Jan 5 11:16:42 2012 (r229585) @@ -251,7 +251,7 @@ status block. .It "bce%d: Could not allocate status block DMA memory!" The driver could not allocate DMA addressable memory for the controller's status block. -.It "bce_d: Could not map status block DMA memory!" +.It "bce%d: Could not map status block DMA memory!" The driver could not map the status block memory into the controller's DMA address space. .It "bce%d: Could not allocate statistics block DMA tag!" From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 11:24:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F318F106566C; Thu, 5 Jan 2012 11:24:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDF578FC08; Thu, 5 Jan 2012 11:24: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 q05BOMwj032165; Thu, 5 Jan 2012 11:24:22 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05BOMhf032163; Thu, 5 Jan 2012 11:24:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201051124.q05BOMhf032163@svn.freebsd.org> From: Robert Watson Date: Thu, 5 Jan 2012 11:24: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: r229586 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 11:24:23 -0000 Author: rwatson Date: Thu Jan 5 11:24:22 2012 New Revision: 229586 URL: http://svn.freebsd.org/changeset/base/229586 Log: Add comment to the VLAN code about its integration with VIMAGE: we see what the code is doing, we recognise the legitimacy of its goal, but we're not quite sure it's going about it the right way. More pondering is clearly required. Sponsored by: ADARA Networks, Inc. Discussed with: bz MFC after: 3 days Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Jan 5 11:16:42 2012 (r229585) +++ head/sys/net/if_vlan.c Thu Jan 5 11:24:22 2012 (r229586) @@ -1597,6 +1597,13 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd case SIOCSETVLAN: #ifdef VIMAGE + /* + * XXXRW/XXXBZ: The goal in these checks is to allow a VLAN + * interface to be delegated to a jail without allowing the + * jail to change what underlying interface/VID it is + * associated with. We are not entirely convinced that this + * is the right way to accomplish that goal policy goal. + */ if (ifp->if_vnet != ifp->if_home_vnet) { error = EPERM; break; From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 11:42:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A9FA106566B; Thu, 5 Jan 2012 11:42:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4585A8FC17; Thu, 5 Jan 2012 11:42: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 q05BgZ1k033222; Thu, 5 Jan 2012 11:42:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05BgZ92033220; Thu, 5 Jan 2012 11:42:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201051142.q05BgZ92033220@svn.freebsd.org> From: Robert Watson Date: Thu, 5 Jan 2012 11:42: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: r229587 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 11:42:35 -0000 Author: rwatson Date: Thu Jan 5 11:42:34 2012 New Revision: 229587 URL: http://svn.freebsd.org/changeset/base/229587 Log: Refine last comment. Submitted by: joeld Sponsored by: ADARA Networks, Inc. MFC after: 3 days Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Jan 5 11:24:22 2012 (r229586) +++ head/sys/net/if_vlan.c Thu Jan 5 11:42:34 2012 (r229587) @@ -1602,7 +1602,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd * interface to be delegated to a jail without allowing the * jail to change what underlying interface/VID it is * associated with. We are not entirely convinced that this - * is the right way to accomplish that goal policy goal. + * is the right way to accomplish that policy goal. */ if (ifp->if_vnet != ifp->if_home_vnet) { error = EPERM; From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 12:05:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAAC5106566B; Thu, 5 Jan 2012 12:05:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5CD58FC15; Thu, 5 Jan 2012 12:05: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 q05C5muR034367; Thu, 5 Jan 2012 12:05:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05C5mOG034365; Thu, 5 Jan 2012 12:05:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051205.q05C5mOG034365@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 12:05: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: r229590 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 12:05:49 -0000 Author: ed Date: Thu Jan 5 12:05:48 2012 New Revision: 229590 URL: http://svn.freebsd.org/changeset/base/229590 Log: Make _Complex_I a proper float _Complex when using GCC 4.2. It turns out our GCC has quite an interesting bug: typeof(1.0fi) != float _Complex typeof((float _Complex)1.0fi) != float _Complex typeof((float _Complex)1.0i) == float _Complex In other words: if casting to an equal size, GCC seems to take a shortcut. By casting down from a double to a float, GCC doesn't take this shortcut, yielding the proper type. To prevent foot-shooting, add a _Static_assert() to guarantee that _Complex_I is always a float _Complex. I'm not going to MFC this part of the diff. MFC after: 2 weeks Modified: head/include/complex.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Thu Jan 5 11:45:22 2012 (r229589) +++ head/include/complex.h Thu Jan 5 12:05:48 2012 (r229590) @@ -29,11 +29,15 @@ #ifndef _COMPLEX_H #define _COMPLEX_H +#include + #ifdef __GNUC__ #if __STDC_VERSION__ < 199901 #define _Complex __complex__ #endif -#define _Complex_I 1.0fi +#define _Complex_I ((float _Complex)1.0i) +_Static_assert(__generic(_Complex_I, float _Complex, 1, 0), + "_Complex_I must be of type float _Complex"); #endif #define complex _Complex From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 12:06:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77A3D106566C; Thu, 5 Jan 2012 12:06:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27E098FC0A; Thu, 5 Jan 2012 12:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05C6n1G034452; Thu, 5 Jan 2012 12:06:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05C6n9Y034450; Thu, 5 Jan 2012 12:06:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051206.q05C6n9Y034450@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 12:06: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: r229591 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 12:06:51 -0000 Author: ed Date: Thu Jan 5 12:06:49 2012 New Revision: 229591 URL: http://svn.freebsd.org/changeset/base/229591 Log: Remove _Complex_I workaround from . This removes the use of __typeof() from this header, thus making it work with a plain C11 compiler. Modified: head/include/tgmath.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Thu Jan 5 12:05:48 2012 (r229590) +++ head/include/tgmath.h Thu Jan 5 12:06:49 2012 (r229591) @@ -53,9 +53,6 @@ * Note that these macros cannot be implemented with C's ?: operator, * because the return type of the whole expression would incorrectly be long * double complex regardless of the argument types. - * - * The _Complex_I distinction should not be needed, but due to a bug in - * GCC 4.2, _Complex_I is not of type float _Complex. */ #ifndef __generic @@ -66,9 +63,8 @@ __generic(x, long double _Complex, fnl, \ __generic(x, double _Complex, fn, \ __generic(x, float _Complex, fnf, \ - __generic(x, __typeof(_Complex_I), fnf, \ - __generic(x, long double, fnl, \ - __generic(x, float, fnf, fn)))))) + __generic(x, long double, fnl, \ + __generic(x, float, fnf, fn))))) #define __tg_impl_simple(x, y, z, fnl, fn, fnf, ...) \ __tg_generic_simple(x, \ __tg_generic_simple(y, \ @@ -87,9 +83,8 @@ __generic(x, long double _Complex, cfnl, \ __generic(x, double _Complex, cfn, \ __generic(x, float _Complex, cfnf, \ - __generic(x, __typeof(_Complex_I), cfnf, \ - __generic(x, long double, fnl, \ - __generic(x, float, fnf, fn)))))) + __generic(x, long double, fnl, \ + __generic(x, float, fnf, fn))))) #define __tg_impl_full(x, y, cfnl, cfn, cfnf, fnl, fn, fnf, ...) \ __tg_generic_full(x, \ __tg_generic_full(y, cfnl, cfnl, cfnl, cfnl, cfnl, cfnl), \ From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 12:09:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19EF7106566B; Thu, 5 Jan 2012 12:09:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF8DD8FC1B; Thu, 5 Jan 2012 12:09: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 q05C9d18034775; Thu, 5 Jan 2012 12:09:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05C9dNs034773; Thu, 5 Jan 2012 12:09:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051209.q05C9dNs034773@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 12:09: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: r229594 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 12:09:40 -0000 Author: ed Date: Thu Jan 5 12:09:39 2012 New Revision: 229594 URL: http://svn.freebsd.org/changeset/base/229594 Log: Remove redundant inclusion of . Mea culpa. Modified: head/include/complex.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Thu Jan 5 12:07:42 2012 (r229593) +++ head/include/complex.h Thu Jan 5 12:09:39 2012 (r229594) @@ -43,8 +43,6 @@ _Static_assert(__generic(_Complex_I, flo #define complex _Complex #define I _Complex_I -#include - __BEGIN_DECLS double cabs(double complex); From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 16:27:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6442106564A; Thu, 5 Jan 2012 16:27:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9DD48FC13; Thu, 5 Jan 2012 16:27: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 q05GRWe1044216; Thu, 5 Jan 2012 16:27:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05GRWC0044213; Thu, 5 Jan 2012 16:27:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201051627.q05GRWC0044213@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jan 2012 16:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229598 - head/sys/dev/ichwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 16:27:33 -0000 Author: jhb Date: Thu Jan 5 16:27:32 2012 New Revision: 229598 URL: http://svn.freebsd.org/changeset/base/229598 Log: Remove use of explicit bus space tags and handles and use methods that operate on resource objects instead. MFC after: 1 week Modified: head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Thu Jan 5 14:51:43 2012 (r229597) +++ head/sys/dev/ichwd/ichwd.c Thu Jan 5 16:27:32 2012 (r229598) @@ -198,26 +198,26 @@ static struct ichwd_device ichwd_devices static devclass_t ichwd_devclass; #define ichwd_read_tco_1(sc, off) \ - bus_space_read_1((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_1((sc)->tco_res, (off)) #define ichwd_read_tco_2(sc, off) \ - bus_space_read_2((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_2((sc)->tco_res, (off)) #define ichwd_read_tco_4(sc, off) \ - bus_space_read_4((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_4((sc)->tco_res, (off)) #define ichwd_read_smi_4(sc, off) \ - bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off)) + bus_read_4((sc)->smi_res, (off)) #define ichwd_read_gcs_4(sc, off) \ - bus_space_read_4((sc)->gcs_bst, (sc)->gcs_bsh, (off)) + bus_read_4((sc)->gcs_res, (off)) #define ichwd_write_tco_1(sc, off, val) \ - bus_space_write_1((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_1((sc)->tco_res, (off), (val)) #define ichwd_write_tco_2(sc, off, val) \ - bus_space_write_2((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_2((sc)->tco_res, (off), (val)) #define ichwd_write_tco_4(sc, off, val) \ - bus_space_write_4((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_4((sc)->tco_res, (off), (val)) #define ichwd_write_smi_4(sc, off, val) \ - bus_space_write_4((sc)->smi_bst, (sc)->smi_bsh, (off), (val)) + bus_write_4((sc)->smi_res, (off), (val)) #define ichwd_write_gcs_4(sc, off, val) \ - bus_space_write_4((sc)->gcs_bst, (sc)->gcs_bsh, (off), (val)) + bus_write_4((sc)->gcs_res, (off), (val)) #define ichwd_verbose_printf(dev, ...) \ do { \ @@ -519,8 +519,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve SMI registers\n"); goto fail; } - sc->smi_bst = rman_get_bustag(sc->smi_res); - sc->smi_bsh = rman_get_bushandle(sc->smi_res); sc->tco_rid = 1; sc->tco_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->tco_rid, @@ -530,8 +528,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve TCO registers\n"); goto fail; } - sc->tco_bst = rman_get_bustag(sc->tco_res); - sc->tco_bsh = rman_get_bushandle(sc->tco_res); sc->gcs_rid = 0; if (sc->ich_version >= 6) { @@ -541,12 +537,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve GCS registers\n"); goto fail; } - sc->gcs_bst = rman_get_bustag(sc->gcs_res); - sc->gcs_bsh = rman_get_bushandle(sc->gcs_res); - } else { - sc->gcs_res = 0; - sc->gcs_bst = 0; - sc->gcs_bsh = 0; } if (ichwd_clear_noreboot(sc) != 0) Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Thu Jan 5 14:51:43 2012 (r229597) +++ head/sys/dev/ichwd/ichwd.h Thu Jan 5 16:27:32 2012 (r229598) @@ -48,18 +48,12 @@ struct ichwd_softc { int smi_enabled; int smi_rid; struct resource *smi_res; - bus_space_tag_t smi_bst; - bus_space_handle_t smi_bsh; int tco_rid; struct resource *tco_res; - bus_space_tag_t tco_bst; - bus_space_handle_t tco_bsh; int gcs_rid; struct resource *gcs_res; - bus_space_tag_t gcs_bst; - bus_space_handle_t gcs_bsh; eventhandler_tag ev_tag; }; From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 17:06:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAEF106564A; Thu, 5 Jan 2012 17:06:05 +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 6BD298FC08; Thu, 5 Jan 2012 17:06: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 q05H65oV045517; Thu, 5 Jan 2012 17:06:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05H65F2045515; Thu, 5 Jan 2012 17:06:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201051706.q05H65F2045515@svn.freebsd.org> From: Dimitry Andric Date: Thu, 5 Jan 2012 17:06: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: r229600 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 17:06:05 -0000 Author: dim Date: Thu Jan 5 17:06:04 2012 New Revision: 229600 URL: http://svn.freebsd.org/changeset/base/229600 Log: In sys/fs/nullfs/null_subr.c, in a KASSERT, output the correct vnode pointer 'lowervp' instead of 'vp', which is uninitialized at that point. Reviewed by: kib MFC after: 1 week Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Thu Jan 5 16:43:54 2012 (r229599) +++ head/sys/fs/nullfs/null_subr.c Thu Jan 5 17:06:04 2012 (r229600) @@ -201,7 +201,7 @@ null_nodeget(mp, lowervp, vpp) int error; ASSERT_VOP_LOCKED(lowervp, "lowervp"); - KASSERT(lowervp->v_usecount >= 1, ("Unreferenced vnode %p\n", vp)); + KASSERT(lowervp->v_usecount >= 1, ("Unreferenced vnode %p\n", lowervp)); /* Lookup the hash firstly */ *vpp = null_hashget(mp, lowervp); From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 17:28:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58FCD106566C; Thu, 5 Jan 2012 17:28:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480DD8FC14; Thu, 5 Jan 2012 17:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05HS6Gi046483; Thu, 5 Jan 2012 17:28:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05HS6vo046481; Thu, 5 Jan 2012 17:28:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201051728.q05HS6vo046481@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 17:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229605 - head/sys/ia64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 17:28:06 -0000 Author: adrian Date: Thu Jan 5 17:28:05 2012 New Revision: 229605 URL: http://svn.freebsd.org/changeset/base/229605 Log: Flip on IEEE80211_SUPPORT_MESH and AH_SUPPORT_AR5416, the wlan and ath modules respectively assume this is set. Pointy hat to: adrian Modified: head/sys/ia64/conf/GENERIC Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Thu Jan 5 17:22:32 2012 (r229604) +++ head/sys/ia64/conf/GENERIC Thu Jan 5 17:28:05 2012 (r229605) @@ -180,6 +180,15 @@ device uslcom # SI Labs CP2101/CP2102 device uvisor # Visor and Palm devices device uvscom # USB serial support for DDI pocket's PHS +# Wireless NIC cards. +# The wlan(4) module assumes this, so just define it so it +# at least correctly loads. +options IEEE80211_SUPPORT_MESH + +# The ath(4) and ath_hal(4) code requires this. The module currently +# builds everything including AR5416 (and later 11n NIC) support. +options AH_SUPPORT_AR5416 + # FireWire support device fwip # IP over FireWire (RFC 2734,3146) # sbp(4) works for some systems but causes boot failure on others From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 17:30:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1C91065691; Thu, 5 Jan 2012 17:30:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1378FC18; Thu, 5 Jan 2012 17:30: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 q05HUGgQ046595; Thu, 5 Jan 2012 17:30:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05HUGDE046591; Thu, 5 Jan 2012 17:30:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201051730.q05HUGDE046591@svn.freebsd.org> From: Robert Watson Date: Thu, 5 Jan 2012 17:30: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: r229606 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 17:30:16 -0000 Author: rwatson Date: Thu Jan 5 17:30:15 2012 New Revision: 229606 URL: http://svn.freebsd.org/changeset/base/229606 Log: When extracting the VLAN tag from if_em and if_lem receive descriptor rings, copy the whole VLAN tag, not just the VLAN ID. This fixes a problem in which VLAN priority information was dropped when using offloaded VLAN processing with these drivers. Discussed with: jfv, rrs Sponsored by: ADARA Networks, Inc. MFC after: 3 days Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 5 17:28:05 2012 (r229605) +++ head/sys/dev/e1000/if_em.c Thu Jan 5 17:30:15 2012 (r229606) @@ -4480,8 +4480,7 @@ em_rxeof(struct rx_ring *rxr, int count, #endif if (status & E1000_RXD_STAT_VP) { sendmp->m_pkthdr.ether_vtag = - (le16toh(cur->special) & - E1000_RXD_SPC_VLAN_MASK); + le16toh(cur->special); sendmp->m_flags |= M_VLANTAG; } #ifndef __NO_STRICT_ALIGNMENT Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Thu Jan 5 17:28:05 2012 (r229605) +++ head/sys/dev/e1000/if_lem.c Thu Jan 5 17:30:15 2012 (r229606) @@ -3591,8 +3591,7 @@ lem_rxeof(struct adapter *adapter, int c #endif if (status & E1000_RXD_STAT_VP) { adapter->fmp->m_pkthdr.ether_vtag = - (le16toh(current_desc->special) & - E1000_RXD_SPC_VLAN_MASK); + le16toh(current_desc->special); adapter->fmp->m_flags |= M_VLANTAG; } #ifndef __NO_STRICT_ALIGNMENT From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 18:32:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08477106566B; Thu, 5 Jan 2012 18:32: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 EB0E88FC08; Thu, 5 Jan 2012 18:32: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 q05IWbCS048992; Thu, 5 Jan 2012 18:32:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05IWbDg048988; Thu, 5 Jan 2012 18:32:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201051832.q05IWbDg048988@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jan 2012 18:32: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: r229613 - in head/sys/dev: bxe qlxgb sfxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 18:32:38 -0000 Author: jhb Date: Thu Jan 5 18:32:37 2012 New Revision: 229613 URL: http://svn.freebsd.org/changeset/base/229613 Log: Update recently added drivers to use the if_*addr_r*lock() wrapper functions instead of using the IF_ADDR_LOCK directly. The wrapper functions are the supported interface for device drivers. Reviewed by: bz, philip MFC after: 1 week Modified: head/sys/dev/bxe/if_bxe.c head/sys/dev/qlxgb/qla_os.c head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Thu Jan 5 18:31:08 2012 (r229612) +++ head/sys/dev/bxe/if_bxe.c Thu Jan 5 18:32:37 2012 (r229613) @@ -14115,7 +14115,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) i = 0; config = BXE_SP(sc, mcast_config); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -14144,7 +14144,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) config_table->cam_entry.lsb_mac_addr); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); old = config->hdr.length; @@ -14172,7 +14172,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) /* Accept one or more multicasts */ memset(mc_filter, 0, 4 * MC_HASH_SIZE); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -14184,7 +14184,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) bit &= 0x1f; mc_filter[regidx] |= (1 << bit); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < MC_HASH_SIZE; i++) REG_WR(sc, MC_HASH_OFFSET(sc, i), mc_filter[i]); Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Thu Jan 5 18:31:08 2012 (r229612) +++ head/sys/dev/qlxgb/qla_os.c Thu Jan 5 18:32:37 2012 (r229613) @@ -760,7 +760,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a int mcnt = 0; struct ifnet *ifp = ha->ifp; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -776,7 +776,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); qla_hw_set_multi(ha, mta, mcnt, add_multi); Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Thu Jan 5 18:31:08 2012 (r229612) +++ head/sys/dev/sfxge/sfxge_port.c Thu Jan 5 18:32:37 2012 (r229613) @@ -301,7 +301,7 @@ sfxge_mac_filter_set_locked(struct sfxge * 0xff. */ bucket[0xff] = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family == AF_LINK) { sa = (struct sockaddr_dl *)ifma->ifma_addr; @@ -309,7 +309,7 @@ sfxge_mac_filter_set_locked(struct sfxge bucket[index] = 1; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } return efx_mac_hash_set(enp, bucket); } @@ -391,10 +391,10 @@ sfxge_port_start(struct sfxge_softc *sc) goto fail2; /* Set the unicast address */ - IF_ADDR_LOCK(ifp); + if_addr_rlock(ifp); bcopy(LLADDR((struct sockaddr_dl *)ifp->if_addr->ifa_addr), mac_addr, sizeof(mac_addr)); - IF_ADDR_UNLOCK(ifp); + if_addr_runlock(ifp); if ((rc = efx_mac_addr_set(enp, mac_addr)) != 0) goto fail; From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 18:35:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4080106564A; Thu, 5 Jan 2012 18:35:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C356B8FC18; Thu, 5 Jan 2012 18:35: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 q05IZnXV049135; Thu, 5 Jan 2012 18:35:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05IZnpC049132; Thu, 5 Jan 2012 18:35:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201051835.q05IZnpC049132@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jan 2012 18:35: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: r229614 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 18:35:49 -0000 Author: jhb Date: Thu Jan 5 18:35:49 2012 New Revision: 229614 URL: http://svn.freebsd.org/changeset/base/229614 Log: Add new variants of the IF_ADDR_*LOCK*() macros used for protecting interface address lists that distinguish read locks from write locks. To preserve the KPI, the previous operations are mapped to the write lock macros. The lock is still kept as a mutex for now. Reviewed by: bz MFC after: 2 weeks Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Jan 5 18:32:37 2012 (r229613) +++ head/sys/net/if_var.h Thu Jan 5 18:35:49 2012 (r229614) @@ -249,9 +249,15 @@ typedef void if_init_f_t(void *); #define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ "if_addr_mtx", NULL, MTX_DEF) #define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) -#define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_RLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_RUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) #define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +/* XXX: Compat. */ +#define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) +#define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) /* * Function variations on locking macros intended to be used by loadable From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 19:00:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83328106564A; Thu, 5 Jan 2012 19:00: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 707F88FC0A; Thu, 5 Jan 2012 19:00: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 q05J0b35050315; Thu, 5 Jan 2012 19:00:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05J0biI050301; Thu, 5 Jan 2012 19:00:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201051900.q05J0biI050301@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jan 2012 19:00: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: r229621 - in head/sys: kern net netatalk netinet netinet6 netipx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 19:00:37 -0000 Author: jhb Date: Thu Jan 5 19:00:36 2012 New Revision: 229621 URL: http://svn.freebsd.org/changeset/base/229621 Log: Convert all users of IF_ADDR_LOCK to use new locking macros that specify either a read lock or write lock. Reviewed by: bz MFC after: 2 weeks Modified: head/sys/kern/kern_uuid.c head/sys/net/if.c head/sys/net/rtsock.c head/sys/netatalk/aarp.c head/sys/netatalk/at_control.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_input.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/netipx/ipx.c Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/kern/kern_uuid.c Thu Jan 5 19:00:36 2012 (r229621) @@ -98,20 +98,20 @@ uuid_node(uint16_t *node) IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { /* Walk the address list */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sdl = (struct sockaddr_dl*)ifa->ifa_addr; if (sdl != NULL && sdl->sdl_family == AF_LINK && sdl->sdl_type == IFT_ETHER) { /* Got a MAC address. */ bcopy(LLADDR(sdl), node, UUID_NODE_LEN); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IFNET_RUNLOCK_NOSLEEP(); CURVNET_RESTORE(); return; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } IFNET_RUNLOCK_NOSLEEP(); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/net/if.c Thu Jan 5 19:00:36 2012 (r229621) @@ -786,10 +786,10 @@ if_purgemaddrs(struct ifnet *ifp) struct ifmultiaddr *ifma; struct ifmultiaddr *next; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) if_delmulti_locked(ifp, ifma, 1); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } /* @@ -1133,10 +1133,10 @@ if_addgroup(struct ifnet *ifp, const cha ifgl->ifgl_group = ifg; ifgm->ifgm_ifp = ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifg->ifg_members, ifgm, ifgm_next); TAILQ_INSERT_TAIL(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); IFNET_WUNLOCK(); @@ -1163,9 +1163,9 @@ if_delgroup(struct ifnet *ifp, const cha return (ENOENT); } - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) if (ifgm->ifgm_ifp == ifp) @@ -1206,9 +1206,9 @@ if_delgroups(struct ifnet *ifp) strlcpy(groupname, ifgl->ifgl_group->ifg_group, IFNAMSIZ); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) if (ifgm->ifgm_ifp == ifp) @@ -1250,33 +1250,33 @@ if_getgroup(struct ifgroupreq *data, str struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) ifgr->ifgr_len += sizeof(struct ifg_req); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (0); } len = ifgr->ifgr_len; ifgp = ifgr->ifgr_groups; /* XXX: wire */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { if (len < sizeof(ifgrq)) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (EINVAL); } bzero(&ifgrq, sizeof ifgrq); strlcpy(ifgrq.ifgrq_group, ifgl->ifgl_group->ifg_group, sizeof(ifgrq.ifgrq_group)); if ((error = copyout(&ifgrq, ifgp, sizeof(struct ifg_req)))) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (error); } len -= sizeof(ifgrq); ifgp++; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (0); } @@ -1383,28 +1383,28 @@ void if_addr_rlock(struct ifnet *ifp) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); } void if_addr_runlock(struct ifnet *ifp) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } void if_maddr_rlock(struct ifnet *ifp) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); } void if_maddr_runlock(struct ifnet *ifp) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } /* @@ -1516,14 +1516,14 @@ ifa_ifwithaddr_internal(struct sockaddr IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; if (sa_equal(addr, ifa->ifa_addr)) { if (getref) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } /* IP6 doesn't have broadcast */ @@ -1533,11 +1533,11 @@ ifa_ifwithaddr_internal(struct sockaddr sa_equal(ifa->ifa_broadaddr, addr)) { if (getref) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1571,7 +1571,7 @@ ifa_ifwithbroadaddr(struct sockaddr *add IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; @@ -1580,11 +1580,11 @@ ifa_ifwithbroadaddr(struct sockaddr *add ifa->ifa_broadaddr->sa_len != 0 && sa_equal(ifa->ifa_broadaddr, addr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1606,18 +1606,18 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) continue; if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = NULL; done: @@ -1651,12 +1651,12 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_LOCK() that kept it stable + * we find one, as we release the IF_ADDR_RLOCK() that kept it stable * when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; @@ -1675,7 +1675,7 @@ next: continue; if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } else { @@ -1686,7 +1686,7 @@ next: continue; if (ifa->ifa_claim_addr) { if ((*ifa->ifa_claim_addr)(ifa, addr)) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } continue; @@ -1726,7 +1726,7 @@ next: continue; } } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } ifa = ifa_maybe; ifa_maybe = NULL; @@ -1752,7 +1752,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, if (af >= AF_MAX) return (NULL); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != af) continue; @@ -1784,7 +1784,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, done: if (ifa != NULL) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (ifa); } @@ -2334,9 +2334,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, * lose a race while we check if the membership * already exists. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifma = if_findmulti(ifp, &ifr->ifr_addr); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifma != NULL) error = EADDRINUSE; else @@ -2762,7 +2762,7 @@ again: } addrs = 0; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2794,7 +2794,7 @@ again: if (sbuf_error(sb) == 0) valid_len = sbuf_len(sb); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); @@ -2952,13 +2952,13 @@ if_addmulti(struct ifnet *ifp, struct so * If the address is already present, return a new reference to it; * otherwise, allocate storage and set up a new address. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); ifma = if_findmulti(ifp, sa); if (ifma != NULL) { ifma->ifma_refcount++; if (retifma != NULL) *retifma = ifma; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } @@ -3024,7 +3024,7 @@ if_addmulti(struct ifnet *ifp, struct so * pointer is still valid. */ rt_newmaddrmsg(RTM_NEWMADDR, ifma); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); /* * We are certain we have added something, so call down to the @@ -3044,7 +3044,7 @@ free_llsa_out: free(llsa, M_IFMADDR); unlock_out: - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (error); } @@ -3078,12 +3078,12 @@ if_delmulti(struct ifnet *ifp, struct so if (ifp == NULL) return (ENOENT); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); lastref = 0; ifma = if_findmulti(ifp, sa); if (ifma != NULL) lastref = if_delmulti_locked(ifp, ifma, 0); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); if (ifma == NULL) return (ENOENT); @@ -3105,10 +3105,10 @@ if_delallmulti(struct ifnet *ifp) struct ifmultiaddr *ifma; struct ifmultiaddr *next; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) if_delmulti_locked(ifp, ifma, 0); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } /* @@ -3145,7 +3145,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm * If and only if the ifnet instance exists: Acquire the address lock. */ if (ifp != NULL) - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); lastref = if_delmulti_locked(ifp, ifma, 0); @@ -3155,7 +3155,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm * Release the address lock. * If the group was left: update the hardware hash filter. */ - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); if (lastref && ifp->if_ioctl != NULL) { (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); } @@ -3177,7 +3177,7 @@ if_delmulti_locked(struct ifnet *ifp, st if (ifp != NULL && ifma->ifma_ifp != NULL) { KASSERT(ifma->ifma_ifp == ifp, ("%s: inconsistent ifp %p", __func__, ifp)); - IF_ADDR_LOCK_ASSERT(ifp); + IF_ADDR_WLOCK_ASSERT(ifp); } ifp = ifma->ifma_ifp; @@ -3250,14 +3250,14 @@ if_setlladdr(struct ifnet *ifp, const u_ struct ifaddr *ifa; struct ifreq ifr; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; if (ifa == NULL) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (EINVAL); } ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); sdl = (struct sockaddr_dl *)ifa->ifa_addr; if (sdl == NULL) { ifa_free(ifa); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/net/rtsock.c Thu Jan 5 19:00:36 2012 (r229621) @@ -456,7 +456,7 @@ rtm_get_jailed(struct rt_addrinfo *info, * Try to find an address on the given outgoing interface * that belongs to the jail. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa; sa = ifa->ifa_addr; @@ -468,7 +468,7 @@ rtm_get_jailed(struct rt_addrinfo *info, break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (!found) { /* * As a last resort return the 'default' jail address. @@ -498,7 +498,7 @@ rtm_get_jailed(struct rt_addrinfo *info, * Try to find an address on the given outgoing interface * that belongs to the jail. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa; sa = ifa->ifa_addr; @@ -511,7 +511,7 @@ rtm_get_jailed(struct rt_addrinfo *info, break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (!found) { /* * As a last resort return the 'default' jail address. @@ -1547,7 +1547,7 @@ sysctl_iflist(int af, struct walkarg *w) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa->ifa_addr; len = rt_msg2(RTM_IFINFO, &info, NULL, w); @@ -1614,13 +1614,13 @@ sysctl_iflist(int af, struct walkarg *w) goto done; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] = info.rti_info[RTAX_BRD] = NULL; } done: if (ifp != NULL) - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IFNET_RUNLOCK(); return (error); } @@ -1641,7 +1641,7 @@ sysctl_ifmalist(int af, struct walkarg * continue; ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa ? ifa->ifa_addr : NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (af && af != ifma->ifma_addr->sa_family) continue; @@ -1662,12 +1662,12 @@ sysctl_ifmalist(int af, struct walkarg * ifmam->ifmam_addrs = info.rti_addrs; error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } done: IFNET_RUNLOCK(); Modified: head/sys/netatalk/aarp.c ============================================================================== --- head/sys/netatalk/aarp.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netatalk/aarp.c Thu Jan 5 19:00:36 2012 (r229621) @@ -406,7 +406,7 @@ at_aarpinput(struct ifnet *ifp, struct m * Since we don't know the net, we just look for the first * phase 1 address on the interface. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); for (aa = (struct at_ifaddr *)TAILQ_FIRST(&ifp->if_addrhead); aa; aa = (struct at_ifaddr *)aa->aa_ifa.ifa_link.tqe_next) { @@ -416,12 +416,12 @@ at_aarpinput(struct ifnet *ifp, struct m } } if (aa == NULL) { - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); m_freem(m); return; } ifa_ref(&aa->aa_ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); tpa.s_net = spa.s_net = AA_SAT(aa)->sat_addr.s_net; } Modified: head/sys/netatalk/at_control.c ============================================================================== --- head/sys/netatalk/at_control.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netatalk/at_control.c Thu Jan 5 19:00:36 2012 (r229621) @@ -254,9 +254,9 @@ at_control(struct socket *so, u_long cmd */ aa->aa_ifp = ifp; ifa_ref(&aa->aa_ifa); /* if_addrhead */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); } else { /* * If we DID find one then we clobber any routes @@ -357,9 +357,9 @@ at_control(struct socket *so, u_long cmd * remove the ifaddr from the interface */ ifa = (struct ifaddr *)aa; - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); /* if_addrhead */ /* Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/if_ether.c Thu Jan 5 19:00:36 2012 (r229621) @@ -608,17 +608,17 @@ in_arpinput(struct mbuf *m) * No match, use the first inet address on the receive interface * as a dummy address for the rest of the function. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && (ifa->ifa_carp == NULL || (*carp_iamatch_p)(ifa, &enaddr))) { ia = ifatoia(ifa); ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto match; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* * If bridging, fall back to using any inet address. Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/igmp.c Thu Jan 5 19:00:36 2012 (r229621) @@ -618,7 +618,7 @@ igmp_ifdetach(struct ifnet *ifp) igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; if (igi->igi_version == IGMP_VERSION_3) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -634,7 +634,7 @@ igmp_ifdetach(struct ifnet *ifp) } inm_clear_recorded(inm); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* * Free the in_multi reference(s) for this IGMP lifecycle. */ @@ -751,7 +751,7 @@ igmp_input_v1_query(struct ifnet *ifp, c * for the interface on which the query arrived, * except those which are already running. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -779,7 +779,7 @@ igmp_input_v1_query(struct ifnet *ifp, c break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); out_locked: IGMP_UNLOCK(); @@ -852,7 +852,7 @@ igmp_input_v2_query(struct ifnet *ifp, c */ CTR2(KTR_IGMPV3, "process v2 general query on ifp %p(%s)", ifp, ifp->if_xname); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -860,7 +860,7 @@ igmp_input_v2_query(struct ifnet *ifp, c inm = (struct in_multi *)ifma->ifma_protospec; igmp_v2_update_group(inm, timer); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } else { /* * Group-specific IGMPv2 query, we need only @@ -1708,7 +1708,7 @@ igmp_fasttimo_vnet(void) IFQ_SET_MAXLEN(&scq, IGMP_MAX_STATE_CHANGE_PACKETS); } - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -1726,7 +1726,7 @@ igmp_fasttimo_vnet(void) break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (igi->igi_version == IGMP_VERSION_3) { struct in_multi *tinm; @@ -2023,7 +2023,7 @@ igmp_v3_cancel_link_timers(struct igmp_i * for all memberships scoped to this link. */ ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -2068,7 +2068,7 @@ igmp_v3_cancel_link_timers(struct igmp_i inm->inm_timer = 0; _IF_DRAIN(&inm->inm_scq); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele); inm_release_locked(inm); @@ -3331,7 +3331,7 @@ igmp_v3_dispatch_general_query(struct ig ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -3362,7 +3362,7 @@ igmp_v3_dispatch_general_query(struct ig break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0; igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/in.c Thu Jan 5 19:00:36 2012 (r229621) @@ -363,7 +363,7 @@ in_control(struct socket *so, u_long cmd ifa_ref(&ia->ia_ifa); IN_IFADDR_RUNLOCK(); if (ia == NULL) { - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); if (iap->ia_addr.sin_family == AF_INET) { @@ -377,7 +377,7 @@ in_control(struct socket *so, u_long cmd } if (ia != NULL) ifa_ref(&ia->ia_ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } if (ia == NULL) iaIsFirst = 1; @@ -441,9 +441,9 @@ in_control(struct socket *so, u_long cmd ia->ia_ifp = ifp; ifa_ref(ifa); /* if_addrhead */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_ref(ifa); /* in_ifaddrhead */ IN_IFADDR_WLOCK(); TAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link); @@ -622,7 +622,7 @@ in_control(struct socket *so, u_long cmd if (ia->ia_ifa.ifa_carp) (*carp_detach_p)(&ia->ia_ifa); - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); /* Re-check that ia is still part of the list. */ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa == &ia->ia_ifa) @@ -634,12 +634,12 @@ in_control(struct socket *so, u_long cmd * try it again for the next loop as there is no other exit * path between here and out. */ - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); error = EADDRNOTAVAIL; goto out; } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); ifa_free(&ia->ia_ifa); /* if_addrhead */ IN_IFADDR_WLOCK(); @@ -784,7 +784,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } } - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET) continue; @@ -798,7 +798,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } if (ifa != NULL) ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) return (EADDRNOTAVAIL); ia = (struct in_ifaddr *)ifa; @@ -1302,7 +1302,7 @@ in_purgemaddrs(struct ifnet *ifp) * We need to do this as IF_ADDR_LOCK() may be re-acquired * by code further down. */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -1314,7 +1314,7 @@ in_purgemaddrs(struct ifnet *ifp) inm = (struct in_multi *)ifma->ifma_protospec; LIST_INSERT_HEAD(&purgeinms, inm, inm_link); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); LIST_FOREACH_SAFE(inm, &purgeinms, inm_link, tinm) { LIST_REMOVE(inm, inm_link); Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/in_mcast.c Thu Jan 5 19:00:36 2012 (r229621) @@ -429,7 +429,7 @@ in_getmulti(struct ifnet *ifp, const str return (error); /* XXX ifma_protospec must be covered by IF_ADDR_LOCK */ - IF_ADDR_LOCK(ifp); + IF_ADDR_WLOCK(ifp); /* * If something other than netinet is occupying the link-layer @@ -453,11 +453,11 @@ in_getmulti(struct ifnet *ifp, const str #endif ++inm->inm_refcount; *pinm = inm; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } - IF_ADDR_LOCK_ASSERT(ifp); + IF_ADDR_WLOCK_ASSERT(ifp); /* * A new in_multi record is needed; allocate and initialize it. @@ -469,7 +469,7 @@ in_getmulti(struct ifnet *ifp, const str inm = malloc(sizeof(*inm), M_IPMADDR, M_NOWAIT | M_ZERO); if (inm == NULL) { if_delmulti_ifma(ifma); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (ENOMEM); } inm->inm_addr = *group; @@ -492,7 +492,7 @@ in_getmulti(struct ifnet *ifp, const str *pinm = inm; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_WUNLOCK(ifp); return (0); } @@ -2832,7 +2832,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A IN_MULTI_LOCK(); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) @@ -2865,7 +2865,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A break; } } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); IN_MULTI_UNLOCK(); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/in_pcb.c Thu Jan 5 19:00:36 2012 (r229621) @@ -745,7 +745,7 @@ in_pcbladdr(struct inpcb *inp, struct in ifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); ia = NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; @@ -759,10 +759,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* 3. As a last resort return the 'default' jail address. */ error = prison_get_ip4(cred, laddr); @@ -804,7 +804,7 @@ in_pcbladdr(struct inpcb *inp, struct in */ ia = NULL; ifp = sro.ro_rt->rt_ifp; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; if (sa->sa_family != AF_INET) @@ -817,10 +817,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); /* 3. As a last resort return the 'default' jail address. */ error = prison_get_ip4(cred, laddr); @@ -868,7 +868,7 @@ in_pcbladdr(struct inpcb *inp, struct in ifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); ia = NULL; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; @@ -883,10 +883,10 @@ in_pcbladdr(struct inpcb *inp, struct in } if (ia != NULL) { laddr->s_addr = ia->ia_addr.sin_addr.s_addr; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); goto done; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); } /* 3. As a last resort return the 'default' jail address. */ Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/in_var.h Thu Jan 5 19:00:36 2012 (r229621) @@ -394,9 +394,9 @@ inm_lookup(struct ifnet *ifp, const stru struct in_multi *inm; IN_MULTI_LOCK_ASSERT(); - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); inm = inm_lookup_locked(ifp, ina); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (inm); } Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Jan 5 18:56:23 2012 (r229620) +++ head/sys/netinet/ip_carp.c Thu Jan 5 19:00:36 2012 (r229621) @@ -549,14 +549,14 @@ carp_input_c(struct mbuf *m, struct carp struct timeval sc_tv, ch_tv; /* verify that the VHID is valid on the receiving interface */ - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); IFNET_FOREACH_IFA(ifp, ifa) if (ifa->ifa_addr->sa_family == af && ifa->ifa_carp->sc_vhid == ch->carp_vhid) { ifa_ref(ifa); break; } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { CARPSTATS_INC(carps_badvhid); @@ -1003,16 +1003,16 @@ carp_iamatch6(struct ifnet *ifp, struct { struct ifaddr *ifa; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); IFNET_FOREACH_IFA(ifp, ifa) if (ifa->ifa_addr->sa_family == AF_INET6 && ifa->ifa_carp->sc_state == MASTER && IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa))) { ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (ifa); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (NULL); } @@ -1022,14 +1022,14 @@ carp_macmatch6(struct ifnet *ifp, struct { struct ifaddr *ifa; - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); IFNET_FOREACH_IFA(ifp, ifa) if (ifa->ifa_addr->sa_family == AF_INET6 && IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa))) { struct carp_softc *sc = ifa->ifa_carp; struct m_tag *mtag; - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); mtag = m_tag_get(PACKET_TAG_CARP, sizeof(struct ifnet *), M_NOWAIT); @@ -1043,7 +1043,7 @@ carp_macmatch6(struct ifnet *ifp, struct return (LLADDR(&sc->sc_addr)); } - IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); return (NULL); } @@ -1512,10 +1512,10 @@ carp_alloc_if(struct ifnet *ifp) cif->cif_ifp = ifp; TAILQ_INIT(&cif->cif_vrs); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 19:02:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E50106566B; Thu, 5 Jan 2012 19:02:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 813028FC14; Thu, 5 Jan 2012 19:02: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 q05J2rHm050419; Thu, 5 Jan 2012 19:02:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05J2rjm050417; Thu, 5 Jan 2012 19:02:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201051902.q05J2rjm050417@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jan 2012 19:02: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: r229622 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 19:02:53 -0000 Author: jhb Date: Thu Jan 5 19:02:52 2012 New Revision: 229622 URL: http://svn.freebsd.org/changeset/base/229622 Log: Fix a logic bug in change 228207 in the check for a thread's new user priority being a realtime priority. MFC after: 3 days Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Thu Jan 5 19:00:36 2012 (r229621) +++ head/sys/kern/kern_resource.c Thu Jan 5 19:02:52 2012 (r229622) @@ -497,7 +497,7 @@ rtp_to_pri(struct rtprio *rtp, struct th oldpri = td->td_user_pri; sched_user_prio(td, newpri); if (td->td_user_pri != oldpri && (td == curthread || - td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME)) + td->td_priority == oldpri || td->td_user_pri <= PRI_MAX_REALTIME)) sched_prio(td, td->td_user_pri); if (TD_ON_UPILOCK(td) && oldpri != newpri) { critical_enter(); From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 20:18:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FA3106566C; Thu, 5 Jan 2012 20:18:01 +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 81BBA8FC08; Thu, 5 Jan 2012 20:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05KI1bU053630; Thu, 5 Jan 2012 20:18:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05KI1eZ053628; Thu, 5 Jan 2012 20:18:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201052018.q05KI1eZ053628@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 20:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229639 - head/sys/arm/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 20:18:01 -0000 Author: adrian Date: Thu Jan 5 20:18:01 2012 New Revision: 229639 URL: http://svn.freebsd.org/changeset/base/229639 Log: Add missing options so modules build/load correctly. Modified: head/sys/arm/conf/KB920X Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Thu Jan 5 19:56:54 2012 (r229638) +++ head/sys/arm/conf/KB920X Thu Jan 5 20:18:01 2012 (r229639) @@ -138,3 +138,6 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm +options IEEE80211_SUPPORT_MESH + +options AH_SUPPORT_AR5416 From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 20:19:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAC71065679; Thu, 5 Jan 2012 20:19:34 +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 EBA528FC15; Thu, 5 Jan 2012 20:19:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05KJX4c053726; Thu, 5 Jan 2012 20:19:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05KJX8f053724; Thu, 5 Jan 2012 20:19:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201052019.q05KJX8f053724@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 20:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229640 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 20:19:34 -0000 Author: adrian Date: Thu Jan 5 20:19:33 2012 New Revision: 229640 URL: http://svn.freebsd.org/changeset/base/229640 Log: Fix build. Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu Jan 5 20:18:01 2012 (r229639) +++ head/sys/powerpc/conf/GENERIC Thu Jan 5 20:19:33 2012 (r229640) @@ -174,6 +174,10 @@ device cdce # Generic USB over Etherne device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet +# Wireless NIC cards +options IEEE80211_SUPPORT_MESH +options AH_SUPPORT_AR5416 + # FireWire support device firewire # FireWire bus code # sbp(4) works for some systems but causes boot failure on others From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:36:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73337106564A; Thu, 5 Jan 2012 21:36:12 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6084E8FC08; Thu, 5 Jan 2012 21:36:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05LaCXk056684; Thu, 5 Jan 2012 21:36:12 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05LaCE2056678; Thu, 5 Jan 2012 21:36:12 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052136.q05LaCE2056678@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229651 - in head: contrib/groff/tmac lib/libstdthreads share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:36:12 -0000 Author: uqs Date: Thu Jan 5 21:36:12 2012 New Revision: 229651 URL: http://svn.freebsd.org/changeset/base/229651 Log: Pull up vendor changes to mdoc(7) This switches us to using -isoC-2011 as the symbol name which is used by groff and mdocml. It follows the change to 4 digit years as done with IEEE Std 1003 post-1999. MFC after: 2 weeks (groff changes only) Modified: head/contrib/groff/tmac/doc-syms head/contrib/groff/tmac/groff_mdoc.man head/lib/libstdthreads/thrd_create.3 head/share/man/man3/ATOMIC_VAR_INIT.3 head/share/man/man3/tgmath.3 Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Thu Jan 5 21:18:34 2012 (r229650) +++ head/contrib/groff/tmac/doc-syms Thu Jan 5 21:36:12 2012 (r229651) @@ -605,6 +605,8 @@ .ds doc-str-St--isoC \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:1990 .as doc-str-St--isoC " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^90\*[doc-str-St]\*[Rq]) .als doc-str-St--isoC-90 doc-str-St--isoC +.ds doc-str-St--isoC-2011 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:2011 +.as doc-str-St--isoC-2011 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^11\*[doc-str-St]\*[Rq]) .ds doc-str-St--isoC-99 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:1999 .as doc-str-St--isoC-99 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^99\*[doc-str-St]\*[Rq]) .ds doc-str-St--isoC-amd1 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899/AMD1:1995 @@ -613,8 +615,6 @@ .as doc-str-St--isoC-tcor1 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^90\*[doc-str-St], Technical Corrigendum 1\*[Rq]) .ds doc-str-St--isoC-tcor2 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899/TCOR2:1995 .as doc-str-St--isoC-tcor2 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^90\*[doc-str-St], Technical Corrigendum 2\*[Rq]) -.ds doc-str-St--isoC-11 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:2011 -.as doc-str-St--isoC-11 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^11\*[doc-str-St]\*[Rq]) . .\" POSIX Part 1: System API .ds doc-str-St--p1003.1 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1 Modified: head/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- head/contrib/groff/tmac/groff_mdoc.man Thu Jan 5 21:18:34 2012 (r229650) +++ head/contrib/groff/tmac/groff_mdoc.man Thu Jan 5 21:36:12 2012 (r229651) @@ -2038,8 +2038,8 @@ are: .St -isoC-90 .It Li \-isoC\-99 .St -isoC-99 -.It Li \-isoC\-11 -.St -isoC-11 +.It Li \-isoC\-2011 +.St -isoC-2011 .El .Pp . Modified: head/lib/libstdthreads/thrd_create.3 ============================================================================== --- head/lib/libstdthreads/thrd_create.3 Thu Jan 5 21:18:34 2012 (r229650) +++ head/lib/libstdthreads/thrd_create.3 Thu Jan 5 21:36:12 2012 (r229651) @@ -110,7 +110,7 @@ .Fn tss_set "tss_t key" "void *val" .Sh DESCRIPTION As of -.St -isoC-11 , +.St -isoC-2011 , the C standard includes an API for writing multithreaded applications. Since POSIX.1 already includes a threading API that is used by virtually any multithreaded application, the interface provided by the C standard @@ -252,7 +252,7 @@ code .Xr pthread 3 .Sh STANDARDS These functions are expected to conform to -.St -isoC-11 . +.St -isoC-2011 . .Sh HISTORY These functions appeared in .Fx 10.0 . Modified: head/share/man/man3/ATOMIC_VAR_INIT.3 ============================================================================== --- head/share/man/man3/ATOMIC_VAR_INIT.3 Thu Jan 5 21:18:34 2012 (r229650) +++ head/share/man/man3/ATOMIC_VAR_INIT.3 Thu Jan 5 21:36:12 2012 (r229651) @@ -274,7 +274,7 @@ When using GCC, all atomic operations ar .Dv memory_order_seq_cst . .Pp Instead of using the atomic operations provided by this interface, -.St -isoC-11 +.St -isoC-2011 allows the atomic variables to be modified directly using built-in language operators. This behaviour cannot be emulated for older compilers. @@ -292,7 +292,7 @@ datatypes, if supported by the CPU. .Xr atomic 9 .Sh STANDARDS These macros attempt to conform to -.St -isoC-11 . +.St -isoC-2011 . .Sh HISTORY These macros appeared in .Fx 10.0 . Modified: head/share/man/man3/tgmath.3 ============================================================================== --- head/share/man/man3/tgmath.3 Thu Jan 5 21:18:34 2012 (r229650) +++ head/share/man/man3/tgmath.3 Thu Jan 5 21:36:12 2012 (r229651) @@ -141,13 +141,13 @@ first appeared in .Fx 5.3 . .Sh COMPILER SUPPORT Before -.St -isoC-11 , +.St -isoC-2011 , the header .In tgmath.h could not be implemented with strictly conforming C code and needed special compiler support. As of -.St -isoC-11 , +.St -isoC-2011 , this header file can be implemented using the .Fn _Generic language keyword. From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:36:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C697E106564A; Thu, 5 Jan 2012 21:36:20 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B50398FC12; Thu, 5 Jan 2012 21:36: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 q05LaKEq056726; Thu, 5 Jan 2012 21:36:20 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05LaK8C056724; Thu, 5 Jan 2012 21:36:20 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052136.q05LaK8C056724@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:36: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: r229652 - head/sbin/recoverdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:36:20 -0000 Author: uqs Date: Thu Jan 5 21:36:20 2012 New Revision: 229652 URL: http://svn.freebsd.org/changeset/base/229652 Log: Document the detrimental effect of kern.cam.XX.retry_count for recoverdisk(1) recoverdisk(1) wants to know about read errors when doing the 1MB/64k reads as fast as possible so it can continue and retry them later with smaller reads (down to sector size). Any retries by lower layers will only slow it down. Prodded by: arundel Modified: head/sbin/recoverdisk/recoverdisk.1 Modified: head/sbin/recoverdisk/recoverdisk.1 ============================================================================== --- head/sbin/recoverdisk/recoverdisk.1 Thu Jan 5 21:36:12 2012 (r229651) +++ head/sbin/recoverdisk/recoverdisk.1 Thu Jan 5 21:36:20 2012 (r229652) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2011 +.Dd Jan 5, 2012 .Dt RECOVERDISK 1 .Os .Sh NAME @@ -124,7 +124,11 @@ recoverdisk -b 0 /dev/ad3 /somewhere .Ed .Sh SEE ALSO -.Xr dd 1 +.Xr dd 1 , +.Xr ada 4, +.Xr cam 4, +.Xr cd 4, +.Xr da 4 .Sh HISTORY The .Nm @@ -149,6 +153,18 @@ flying by. This is harmless and can be avoided by setting .Fl b to no more than 128kB. +.Pp +.Nm +needs to know about read errors as fast as possible, i.e. retries by lower +layers will usually slow down the operation. +When using +.Xr cam 4 +attached drives, you may want to set kern.cam.XX.retry_count to zero, e.g.: +.Bd -literal +# sysctl kern.cam.ada.retry_count=0 +# sysctl kern.cam.cd.retry_count=0 +# sysctl kern.cam.da.retry_count=0 +.Ed .\".Pp .\"When reading from optical media, a bug in the GEOM framework will .\"prevent it from seeing that the media has been removed. From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:36:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB49D106576A; Thu, 5 Jan 2012 21:36:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B90F78FC19; Thu, 5 Jan 2012 21:36: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 q05LaS0f056768; Thu, 5 Jan 2012 21:36:28 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05LaSdc056765; Thu, 5 Jan 2012 21:36:28 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052136.q05LaSdc056765@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229653 - head/usr.sbin/bsnmpd/modules/snmp_wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:36:28 -0000 Author: uqs Date: Thu Jan 5 21:36:28 2012 New Revision: 229653 URL: http://svn.freebsd.org/changeset/base/229653 Log: Partial backout of r228990, restore original MIB object name. It's too late to change this in 9.0 -- so we have a release with the misspelling in the wild and should not break users that depend on it. Deprecating/replacing it because of a one-char typo seems excessive. Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt Thu Jan 5 21:36:20 2012 (r229652) +++ head/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt Thu Jan 5 21:36:28 2012 (r229653) @@ -82,8 +82,8 @@ WlanMgmtReasonCode ::= TEXTUAL-CONVENTIO associationLeave(8), associationNotAuthenticated(9), -- XXX: TODO - FIXME - disassocPwrcapBad(10), - disassocSuperchanBad(11), + dissassocPwrcapBad(10), + dissassocSuperchanBad(11), ieInvalid(13), micFailure(14), fourWayHandshakeTimeout(15), Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def Thu Jan 5 21:36:20 2012 (r229652) +++ head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def Thu Jan 5 21:36:28 2012 (r229653) @@ -75,8 +75,8 @@ typedef WlanMgmtReasonCode ENUM ( 7 notAssociated 8 associationLeave 9 associationNotAuthenticated - 10 disassocPwrcapBad - 11 disassocSuperchanBad + 10 dissassocPwrcapBad + 11 dissassocSuperchanBad 13 ieInvalid 14 micFailure 15 fourWayHandshakeTimeout From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:36:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E619106574E; Thu, 5 Jan 2012 21:36:36 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 728558FC1A; Thu, 5 Jan 2012 21:36: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 q05LaaPP056809; Thu, 5 Jan 2012 21:36:36 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05LaawO056807; Thu, 5 Jan 2012 21:36:36 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052136.q05LaawO056807@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:36: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: r229654 - head/usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:36:36 -0000 Author: uqs Date: Thu Jan 5 21:36:36 2012 New Revision: 229654 URL: http://svn.freebsd.org/changeset/base/229654 Log: Further fix a typo and spelling classic correctly in function names, too. Submitted by: Ben Kaduk Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Jan 5 21:36:28 2012 (r229653) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Jan 5 21:36:36 2012 (r229654) @@ -1600,7 +1600,7 @@ delete_oldest_timelog(const struct conf_ * Generate a log filename, when using classic filenames. */ static void -gen_clasiclog_fname(char *fname, size_t fname_sz, const char *archive_dir, +gen_classiclog_fname(char *fname, size_t fname_sz, const char *archive_dir, const char *namepart, int numlogs_c) { @@ -1612,15 +1612,15 @@ gen_clasiclog_fname(char *fname, size_t } /* - * Delete a rotated logfiles, when using classic filenames. + * Delete a rotated logfile, when using classic filenames. */ static void -delete_clasiclog(const char *archive_dir, const char *namepart, int numlog_c) +delete_classiclog(const char *archive_dir, const char *namepart, int numlog_c) { char file1[MAXPATHLEN], zfile1[MAXPATHLEN]; int c; - gen_clasiclog_fname(file1, sizeof(file1), archive_dir, namepart, + gen_classiclog_fname(file1, sizeof(file1), archive_dir, namepart, numlog_c); for (c = 0; c < COMPRESS_TYPES; c++) { @@ -1744,10 +1744,10 @@ do_rotate(const struct conf_entry *ent) * kept ent->numlogs + 1 files. This code can go away * at some point in the future. */ - delete_clasiclog(dirpart, namepart, ent->numlogs); + delete_classiclog(dirpart, namepart, ent->numlogs); if (ent->numlogs > 0) - delete_clasiclog(dirpart, namepart, ent->numlogs - 1); + delete_classiclog(dirpart, namepart, ent->numlogs - 1); } @@ -1768,7 +1768,7 @@ do_rotate(const struct conf_entry *ent) /* Don't run the code to move down logs */ numlogs_c = -1; } else { - gen_clasiclog_fname(file1, sizeof(file1), dirpart, namepart, + gen_classiclog_fname(file1, sizeof(file1), dirpart, namepart, ent->numlogs - 1); numlogs_c = ent->numlogs - 2; /* copy for countdown */ } @@ -1777,7 +1777,7 @@ do_rotate(const struct conf_entry *ent) for (; numlogs_c >= 0; numlogs_c--) { (void) strlcpy(file2, file1, sizeof(file2)); - gen_clasiclog_fname(file1, sizeof(file1), dirpart, namepart, + gen_classiclog_fname(file1, sizeof(file1), dirpart, namepart, numlogs_c); logfile_suffix = get_logfile_suffix(file1); From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:36:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75A3410657D9; Thu, 5 Jan 2012 21:36:45 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62B398FC18; Thu, 5 Jan 2012 21:36:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05LajpF056854; Thu, 5 Jan 2012 21:36:45 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05Laj0m056848; Thu, 5 Jan 2012 21:36:45 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052136.q05Laj0m056848@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229655 - in head: usr.bin/locate/locate usr.bin/mail usr.sbin/bluetooth/sdpd usr.sbin/pkg_install/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:36:45 -0000 Author: uqs Date: Thu Jan 5 21:36:45 2012 New Revision: 229655 URL: http://svn.freebsd.org/changeset/base/229655 Log: Touch up some more small typos missed in the previous round. Reported by: Ben Kaduk et al. Modified: head/usr.bin/locate/locate/util.c head/usr.bin/mail/main.c head/usr.bin/mail/util.c head/usr.sbin/bluetooth/sdpd/server.c head/usr.sbin/pkg_install/lib/plist.c Modified: head/usr.bin/locate/locate/util.c ============================================================================== --- head/usr.bin/locate/locate/util.c Thu Jan 5 21:36:36 2012 (r229654) +++ head/usr.bin/locate/locate/util.c Thu Jan 5 21:36:45 2012 (r229655) @@ -219,15 +219,15 @@ tolower_word(word) /* * Read integer from mmap pointer. - * Essential a simple ``return *(int *)p'' but avoid sigbus + * Essentially a simple ``return *(int *)p'' but avoids sigbus * for integer alignment (SunOS 4.x, 5.x). * * Convert network byte order to host byte order if necessary. - * So we can read on FreeBSD/i386 (little endian) a locate database + * So we can read a locate database on FreeBSD/i386 (little endian) * which was built on SunOS/sparc (big endian). */ -int +int getwm(p) caddr_t p; { Modified: head/usr.bin/mail/main.c ============================================================================== --- head/usr.bin/mail/main.c Thu Jan 5 21:36:36 2012 (r229654) +++ head/usr.bin/mail/main.c Thu Jan 5 21:36:45 2012 (r229655) @@ -259,7 +259,7 @@ Usage: %s [-dEiInv] [-s subject] [-c cc- if (ef == NULL) ef = "%"; if (setfile(ef) <= 0) - /* Either an error has occurted, or no mail */ + /* Either an error has occurred, or no mail */ exit(1); else exit(0); Modified: head/usr.bin/mail/util.c ============================================================================== --- head/usr.bin/mail/util.c Thu Jan 5 21:36:36 2012 (r229654) +++ head/usr.bin/mail/util.c Thu Jan 5 21:36:45 2012 (r229655) @@ -550,7 +550,7 @@ newname: } /* - * Count the occurrances of c in str + * Count the occurrences of c in str */ int charcount(char *str, int c) Modified: head/usr.sbin/bluetooth/sdpd/server.c ============================================================================== --- head/usr.sbin/bluetooth/sdpd/server.c Thu Jan 5 21:36:36 2012 (r229654) +++ head/usr.sbin/bluetooth/sdpd/server.c Thu Jan 5 21:36:45 2012 (r229655) @@ -334,7 +334,7 @@ server_accept_client(server_p srv, int32 * The minimum L2CAP MTU is 43 bytes. That means we need * 65536 / 43 = ~1524 chunks to transfer maximum packet * size with minimum MTU. The "rsp_cs" field in fd_idx_t - * is 11 bit wide that gives us up to 2048 chunks. + * is 11 bits wide, which gives us up to 2048 chunks. */ if (omtu < NG_L2CAP_MTU_MINIMUM) { Modified: head/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- head/usr.sbin/pkg_install/lib/plist.c Thu Jan 5 21:36:36 2012 (r229654) +++ head/usr.sbin/pkg_install/lib/plist.c Thu Jan 5 21:36:45 2012 (r229655) @@ -123,7 +123,7 @@ find_plist_option(Package *pkg, const ch /* * Delete plist item 'type' in the list (if 'name' is non-null, match it - * too.) If 'all' is set, delete all items, not just the first occurrance. + * too.) If 'all' is set, delete all items, not just the first occurrence. */ void delete_plist(Package *pkg, Boolean all, plist_t type, const char *name) From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:36:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86CA21065694; Thu, 5 Jan 2012 21:36:53 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3038FC20; Thu, 5 Jan 2012 21:36: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 q05Lar5T056900; Thu, 5 Jan 2012 21:36:53 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05Larqq056895; Thu, 5 Jan 2012 21:36:53 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052136.q05Larqq056895@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:36: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: r229656 - head/tools/regression/msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:36:53 -0000 Author: uqs Date: Thu Jan 5 21:36:53 2012 New Revision: 229656 URL: http://svn.freebsd.org/changeset/base/229656 Log: Convert files over to UTF-8. These files contained various combinations of Big5, eucJP and KOI8-U encoded strings. The byte representations of their respective encodings have been translated to $'...' escape sequences as understood by our sh(1). With help from: jilles Modified: head/tools/regression/msdosfs/msdosfstest-3.sh head/tools/regression/msdosfs/msdosfstest-4.sh head/tools/regression/msdosfs/msdosfstest-5.sh head/tools/regression/msdosfs/msdosfstest-6.sh Modified: head/tools/regression/msdosfs/msdosfstest-3.sh ============================================================================== --- head/tools/regression/msdosfs/msdosfstest-3.sh Thu Jan 5 21:36:45 2012 (r229655) +++ head/tools/regression/msdosfs/msdosfstest-3.sh Thu Jan 5 21:36:53 2012 (r229656) @@ -9,8 +9,10 @@ mdconfig -a -t swap -s 128m -u 10 bsdlabel -w md10 auto newfs_msdos -F 16 -b 8192 /dev/md10a mount_msdosfs -L zh_TW.Big5 -D CP950 /dev/md10a /tmp/msdosfstest/ -mkdir /tmp/msdosfstest/012345678_c -cd /tmp/msdosfstest/012345678_c +# The comment is UTF-8, the actual command uses the Big5 representation. +# mkdir /tmp/msdosfstest/012345678_邪惡之美 +mkdir /tmp/msdosfstest/012345678_$'\250\270\264\143\244\247\254\374' +cd /tmp/msdosfstest/012345678_$'\250\270\264\143\244\247\254\374' if [ $? -eq 0 ]; then echo "ok 3"; else Modified: head/tools/regression/msdosfs/msdosfstest-4.sh ============================================================================== --- head/tools/regression/msdosfs/msdosfstest-4.sh Thu Jan 5 21:36:45 2012 (r229655) +++ head/tools/regression/msdosfs/msdosfstest-4.sh Thu Jan 5 21:36:53 2012 (r229656) @@ -8,12 +8,12 @@ mdconfig -a -t swap -s 128m -u 10 bsdlabel -w md10 auto newfs_msdos -F 16 -b 8192 /dev/md10a mount_msdosfs -L uk_UA.KOI8-U -D CP866 -l /dev/md10a /tmp/msdosfstest -# mkdir /tmp/msdosfstest/U+0456 (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I) -mkdir /tmp/msdosfstest/ +# The comment is UTF-8, the actual command uses the KOI8-U representation. +# mkdir /tmp/msdosfstest/і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I) +mkdir /tmp/msdosfstest/$'\246' if [ $? -eq 0 ]; then echo "ok 4 (pass stage 1/3)" - # cd /tmp/msdosfstest/U+0456 (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I) - cd /tmp/msdosfstest/ + cd /tmp/msdosfstest/$'\246' if [ $? -eq 0 ]; then echo "ok 4 (pass stage 2/3)" cd /tmp Modified: head/tools/regression/msdosfs/msdosfstest-5.sh ============================================================================== --- head/tools/regression/msdosfs/msdosfstest-5.sh Thu Jan 5 21:36:45 2012 (r229655) +++ head/tools/regression/msdosfs/msdosfstest-5.sh Thu Jan 5 21:36:53 2012 (r229656) @@ -10,18 +10,20 @@ mdconfig -a -t swap -s 128m -u 10 bsdlabel -w md10 auto newfs_msdos -F 16 -b 8192 /dev/md10a mount_msdosfs -L ja_JP.eucJP -D CP932 -l /dev/md10a /tmp/msdosfstest -# touch /tmp/msdosfstest/U+FF71 (HALFWIDTH KATAKANA LETTER A) -touch /tmp/msdosfstest/ +# The comment is UTF-8, the actual command uses the eucJP representation. +# touch /tmp/msdosfstest/ア (HALFWIDTH KATAKANA LETTER A) +touch /tmp/msdosfstest/$'\216\261' if [ $? -eq 0 ]; then umount /tmp/msdosfstest mount_msdosfs -L ja_JP.eucJP -D CP932 -s /dev/md10a /tmp/msdosfstest - ls /tmp/msdosfstest/ + ls /tmp/msdosfstest/$'\216\261' if [ $? -eq 0 ]; then echo "ok 5 (pass stage 1/2)" umount /tmp/msdosfstest mount_msdosfs -L uk_UA.KOI8-U -D CP866 -l /dev/md10a /tmp/msdosfstest - # ls /tmp/msdosfstest/0xb1 (MEDIUM SHADE) - ls /tmp/msdosfstest/ + # The comment is UTF-8, the actual command uses the KOI8-U representation. + # ls /tmp/msdosfstest/▒ (MEDIUM SHADE) + ls /tmp/msdosfstest/$'\221' if [ $? -ne 0 ]; then # assume that U+FF71 was recorded with long name echo "ok 5 (pass stage 2/2)" Modified: head/tools/regression/msdosfs/msdosfstest-6.sh ============================================================================== --- head/tools/regression/msdosfs/msdosfstest-6.sh Thu Jan 5 21:36:45 2012 (r229655) +++ head/tools/regression/msdosfs/msdosfstest-6.sh Thu Jan 5 21:36:53 2012 (r229656) @@ -9,8 +9,13 @@ mdconfig -a -t swap -s 128m -u 10 bsdlabel -w md10 auto newfs_msdos -F 32 -b 8192 /dev/md10a mount_msdosfs -L zh_TW.Big5 -D CP950 /dev/md10a /tmp/msdosfstest/ -mkdir '/tmp/msdosfstest/O_ݹL{`\\y\bY\ĥ|' -cd '/tmp/msdosfstest/O_ݹL{`\\y\bY\ĥ|' +# The comment is UTF-8, the actual command uses the Big5 representation. +# mkdir /tmp/msdosfstest/是否看過坊間常見的許茹芸淚海慶功宴吃蓋飯第四集 +subdir=$'\254\117\247\137\254\335\271\114\247\173\266\241\261\140\250\243'\ +$'\252\272\263\134\257\370\252\345\262\134\256\374\274\171\245\134'\ +$'\256\142\246\131\273\134\266\272\262\304\245\174\266\260' +mkdir /tmp/msdosfstest/$subdir +cd /tmp/msdosfstest/$subdir if [ $? -eq 0 ]; then echo "ok 6"; else From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:43:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1F1A1065673; Thu, 5 Jan 2012 21:43:33 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5DCA8FC15; Thu, 5 Jan 2012 21:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05LhX9I057137; Thu, 5 Jan 2012 21:43:33 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05LhXA2057133; Thu, 5 Jan 2012 21:43:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201052143.q05LhXA2057133@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 5 Jan 2012 21:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229657 - in head/share/man: man4 man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:43:34 -0000 Author: uqs Date: Thu Jan 5 21:43:33 2012 New Revision: 229657 URL: http://svn.freebsd.org/changeset/base/229657 Log: Apply Typo-B-Gone 2000 [TM] Modified: head/share/man/man4/apic.4 head/share/man/man4/carp.4 head/share/man/man5/ar.5 Modified: head/share/man/man4/apic.4 ============================================================================== --- head/share/man/man4/apic.4 Thu Jan 5 21:36:53 2012 (r229656) +++ head/share/man/man4/apic.4 Thu Jan 5 21:43:33 2012 (r229657) @@ -61,7 +61,7 @@ In addition, they are able to accept and I/O APICs contain a redirection table, which is used to route the interrupts they receive from peripheral buses to one or more local APICs. .Pp -Each local APIC includes one 32-bit programable timer. +Each local APIC includes one 32-bit programmable timer. This driver uses them to supply kernel with one event timer named "LAPIC". Event timer provided by the driver supports both one-shot an periodic modes. Because of local APIC nature it is per-CPU. Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Thu Jan 5 21:36:53 2012 (r229656) +++ head/share/man/man4/carp.4 Thu Jan 5 21:43:33 2012 (r229657) @@ -193,7 +193,7 @@ This can be accomplished by using hooks. Master/slave events are signalled under system .Dv CARP . -Subsystem specifies vhid and name of interface, where event occured. +Subsystem specifies vhid and name of interface, where event occurred. Type of the message displays new state of vhid. Please see .Xr devd.conf 5 Modified: head/share/man/man5/ar.5 ============================================================================== --- head/share/man/man5/ar.5 Thu Jan 5 21:36:53 2012 (r229656) +++ head/share/man/man5/ar.5 Thu Jan 5 21:43:33 2012 (r229657) @@ -126,7 +126,7 @@ The BSD and SVR4/GNU variants use differ names for members. .Bl -tag -width "SVR4/GNU" .It "BSD" -File names that are upto 16 bytes long and which do not contain +File names that are up to 16 bytes long and which do not contain embedded spaces are stored directly in the .Ar ar_name field of the archive header. @@ -164,7 +164,7 @@ ASCII .Dq "A BC D" .Pc . .It "SVR4/GNU" -File names that are upto 15 characters long are stored directly in the +File names that are up to 15 characters long are stored directly in the .Ar ar_name field of the header, terminated by a .Dq Li / From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:49:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBC06106566C; Thu, 5 Jan 2012 21:49: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 9C5978FC15; Thu, 5 Jan 2012 21:49: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 q05LnhiJ057430; Thu, 5 Jan 2012 21:49:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05Lnh2v057428; Thu, 5 Jan 2012 21:49:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201052149.q05Lnh2v057428@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 21:49: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: r229658 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:49:44 -0000 Author: adrian Date: Thu Jan 5 21:49:43 2012 New Revision: 229658 URL: http://svn.freebsd.org/changeset/base/229658 Log: Allow crunchgen binary link generation to be disabled. If CRUNCH_GENERATE_LINKS is set to "no", then no links will be generated. This defaults to "yes" so things like release crunch building still works. Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu Jan 5 21:43:33 2012 (r229657) +++ head/share/mk/bsd.crunchgen.mk Thu Jan 5 21:49:43 2012 (r229658) @@ -22,6 +22,8 @@ # Specific links can be suppressed by setting # CRUNCH_SUPPRESS_LINK_$(NAME) to 1. # +# If CRUNCH_GENERATE_LINKS is set to no, no links will be generated. +# # $FreeBSD$ @@ -39,6 +41,7 @@ CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${. .else CANONICALOBJDIR:= /usr/obj${.CURDIR} .endif +CRUNCH_GENERATE_LINKS?= yes CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h @@ -51,6 +54,7 @@ $(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefi .else $(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile .endif +.if ${CRUNCH_GENERATE_LINKS} == "yes" .ifndef CRUNCH_SUPPRESS_LINK_${P} LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) .endif @@ -59,6 +63,7 @@ LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) .endif .endfor +.endif .endfor .endfor From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 21:50:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CAC3106566C; Thu, 5 Jan 2012 21:50:51 +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 4B53F8FC13; Thu, 5 Jan 2012 21:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05LopVw057537; Thu, 5 Jan 2012 21:50:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05LopWs057535; Thu, 5 Jan 2012 21:50:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201052150.q05LopWs057535@svn.freebsd.org> From: Adrian Chadd Date: Thu, 5 Jan 2012 21:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229659 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 21:50:51 -0000 Author: adrian Date: Thu Jan 5 21:50:50 2012 New Revision: 229659 URL: http://svn.freebsd.org/changeset/base/229659 Log: Allow extra directories to be added to the build-tools target. Things such as "sh" require local tools to be built before cross-compiling. This allows for extra software (that's built via LOCAL_DIRS) to also have a build-tools target where required. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 5 21:49:43 2012 (r229658) +++ head/Makefile.inc1 Thu Jan 5 21:50:50 2012 (r229659) @@ -15,6 +15,8 @@ # -DNO_WWWUPDATE do not update www in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list +# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools +# list # TARGET="machine" to crossbuild world for a different machine type # TARGET_ARCH= may be required when a TARGET supports multiple endians @@ -104,6 +106,8 @@ CLEANDIR= clean cleandepend CLEANDIR= cleandir .endif +LOCAL_TOOL_DIRS?= '' + CVS?= cvs CVSFLAGS?= -A -P -d -I! SVN?= svn @@ -1101,6 +1105,7 @@ build-tools: bin/csh \ bin/sh \ ${_rescue} \ + ${LOCAL_TOOL_DIRS} \ lib/ncurses/ncurses \ lib/ncurses/ncursesw \ ${_share} \ From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 22:06:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84928106566B; Thu, 5 Jan 2012 22:06:01 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731338FC18; Thu, 5 Jan 2012 22:06:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05M61J5058174; Thu, 5 Jan 2012 22:06:01 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05M61Hd058172; Thu, 5 Jan 2012 22:06:01 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201052206.q05M61Hd058172@svn.freebsd.org> From: Andreas Tobler Date: Thu, 5 Jan 2012 22:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229660 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 22:06:01 -0000 Author: andreast Date: Thu Jan 5 22:06:01 2012 New Revision: 229660 URL: http://svn.freebsd.org/changeset/base/229660 Log: Fix build on powerpc64 too. The same as r229640. Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Jan 5 21:50:50 2012 (r229659) +++ head/sys/powerpc/conf/GENERIC64 Thu Jan 5 22:06:01 2012 (r229660) @@ -170,6 +170,10 @@ device cdce # Generic USB over Etherne device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet +# Wireless NIC cards +options IEEE80211_SUPPORT_MESH +options AH_SUPPORT_AR5416 + # FireWire support device firewire # FireWire bus code device sbp # SCSI over FireWire (Requires scbus and da) From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 22:16:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF4D106564A; Thu, 5 Jan 2012 22:16:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC0A8FC16; Thu, 5 Jan 2012 22:16: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 q05MGffS058719; Thu, 5 Jan 2012 22:16:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05MGfLY058717; Thu, 5 Jan 2012 22:16:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201052216.q05MGfLY058717@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 5 Jan 2012 22:16: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: r229663 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 22:16:41 -0000 Author: pjd Date: Thu Jan 5 22:16:41 2012 New Revision: 229663 URL: http://svn.freebsd.org/changeset/base/229663 Log: - Allow to change vfs.zfs.arc_meta_limit at runtime. - Change vfs.zfs.arc_meta_used from CTLFLAG_RDTUN to CTLFLAG_RD, as it is not a tunable. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 5 22:14:49 2012 (r229662) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 5 22:16:41 2012 (r229663) @@ -464,10 +464,10 @@ static uint64_t arc_loaned_bytes; static uint64_t arc_meta_used; static uint64_t arc_meta_limit; static uint64_t arc_meta_max = 0; -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_meta_used, CTLFLAG_RDTUN, - &arc_meta_used, 0, "ARC metadata used"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_meta_limit, CTLFLAG_RDTUN, - &arc_meta_limit, 0, "ARC metadata limit"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_meta_used, CTLFLAG_RD, &arc_meta_used, 0, + "ARC metadata used"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_meta_limit, CTLFLAG_RW, &arc_meta_limit, 0, + "ARC metadata limit"); typedef struct l2arc_buf_hdr l2arc_buf_hdr_t; From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 22:29:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 413B4106566B; Thu, 5 Jan 2012 22:29:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 158B18FC08; Thu, 5 Jan 2012 22:29: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 q05MTBBf059187; Thu, 5 Jan 2012 22:29:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05MTBMf059184; Thu, 5 Jan 2012 22:29:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201052229.q05MTBMf059184@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jan 2012 22:29: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: r229665 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 22:29:12 -0000 Author: jhb Date: Thu Jan 5 22:29:11 2012 New Revision: 229665 URL: http://svn.freebsd.org/changeset/base/229665 Log: Remove the assertion from tcp_input() that rcv_nxt is always greater than or equal to rcv_adv and fix tcp_twstart() to handle this case by assuming the last window was zero rather than a negative value. The code in tcp_input() already safely handled this case. It can happen due to delayed ACKs along with a remote sender that sends data beyond the window we previously advertised. If we have room in our socket buffer for the extra data beyond the advertised window, we will accept it. However, if the ACK for that segment is delayed, then we will not effectively fixup rcv_adv to account for that extra data until the next segment arrives and forces out an ACK. When that next segment arrives, rcv_nxt will be beyond rcv_adv. Tested by: pjd MFC after: 1 week Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Jan 5 22:28:40 2012 (r229664) +++ head/sys/netinet/tcp_input.c Thu Jan 5 22:29:11 2012 (r229665) @@ -1795,9 +1795,6 @@ tcp_do_segment(struct mbuf *m, struct tc win = sbspace(&so->so_rcv); if (win < 0) win = 0; - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_nxt, tp->rcv_adv)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Thu Jan 5 22:28:40 2012 (r229664) +++ head/sys/netinet/tcp_timewait.c Thu Jan 5 22:29:11 2012 (r229665) @@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_nxt, tp->rcv_adv)); - tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + if (SEQ_GE(tp->rcv_adv, tp->rcv_nxt)) + tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + else + tw->last_win = 0; /* * Set t_recent if timestamps are used on the connection. From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 22:48:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B437C106566B; Thu, 5 Jan 2012 22:48:36 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A29C58FC18; Thu, 5 Jan 2012 22:48:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05MmaPD059873; Thu, 5 Jan 2012 22:48:36 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05MmaZk059871; Thu, 5 Jan 2012 22:48:36 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201052248.q05MmaZk059871@svn.freebsd.org> From: Guy Helmer Date: Thu, 5 Jan 2012 22:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 22:48:36 -0000 Author: ghelmer Date: Thu Jan 5 22:48:36 2012 New Revision: 229667 URL: http://svn.freebsd.org/changeset/base/229667 Log: Allow daemon(8) to run pidfile_open() before relenquishing privileges so pid files can be written in /var/run when started as root. I do not expect this to cause any security issues, but if anyone objects it could be easily reverted. PR: bin/159568 MFC after: 4 weeks Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Thu Jan 5 22:31:25 2012 (r229666) +++ head/usr.sbin/daemon/daemon.c Thu Jan 5 22:48:36 2012 (r229667) @@ -79,9 +79,6 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); - /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -97,6 +94,9 @@ main(int argc, char *argv[]) } } + if (user != NULL) + restrict_process(user); + if (daemon(nochdir, noclose) == -1) err(1, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 23:08:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E98A0106564A; Thu, 5 Jan 2012 23:08:11 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F308FC19; Thu, 5 Jan 2012 23:08: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 q05N8BGp060522; Thu, 5 Jan 2012 23:08:11 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05N8BUx060520; Thu, 5 Jan 2012 23:08:11 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201052308.q05N8BUx060520@svn.freebsd.org> From: Guy Helmer Date: Thu, 5 Jan 2012 23:08: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: r229668 - head/usr.bin/newgrp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 23:08:12 -0000 Author: ghelmer Date: Thu Jan 5 23:08:11 2012 New Revision: 229668 URL: http://svn.freebsd.org/changeset/base/229668 Log: Fix a memory leak in addgroup() by ensuring the allocated memory is freed if an error occurs. PR: bin/161510 MFC after: 4 weeks Modified: head/usr.bin/newgrp/newgrp.c Modified: head/usr.bin/newgrp/newgrp.c ============================================================================== --- head/usr.bin/newgrp/newgrp.c Thu Jan 5 22:48:36 2012 (r229667) +++ head/usr.bin/newgrp/newgrp.c Thu Jan 5 23:08:11 2012 (r229668) @@ -190,7 +190,7 @@ addgroup(const char *grpname) err(1, "malloc"); if ((ngrps = getgroups(ngrps_max, (gid_t *)grps)) < 0) { warn("getgroups"); - return; + goto end; } /* Remove requested gid from supp. list if it exists. */ @@ -204,7 +204,7 @@ addgroup(const char *grpname) if (setgroups(ngrps, (const gid_t *)grps) < 0) { PRIV_END; warn("setgroups"); - return; + goto end; } PRIV_END; } @@ -213,7 +213,7 @@ addgroup(const char *grpname) if (setgid(grp->gr_gid)) { PRIV_END; warn("setgid"); - return; + goto end; } PRIV_END; grps[0] = grp->gr_gid; @@ -228,12 +228,12 @@ addgroup(const char *grpname) if (setgroups(ngrps, (const gid_t *)grps)) { PRIV_END; warn("setgroups"); - return; + goto end; } PRIV_END; } } - +end: free(grps); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 5 23:11:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7AB106566C; Thu, 5 Jan 2012 23:11:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDF7E8FC12; Thu, 5 Jan 2012 23:11: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 q05NB5Dq060660; Thu, 5 Jan 2012 23:11:05 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05NB5gl060658; Thu, 5 Jan 2012 23:11:05 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201052311.q05NB5gl060658@svn.freebsd.org> From: Robert Watson Date: Thu, 5 Jan 2012 23:11: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: r229669 - head/contrib/pf/pfctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 23:11:06 -0000 Author: rwatson Date: Thu Jan 5 23:11:05 2012 New Revision: 229669 URL: http://svn.freebsd.org/changeset/base/229669 Log: Replace an OpenBSDism with a FreeBSDism in the pfctl(8) man page: we put configuration file man pages in section 5, and we prefer rc.conf to rc.conf.local. MFC after: 3 days Modified: head/contrib/pf/pfctl/pfctl.8 Modified: head/contrib/pf/pfctl/pfctl.8 ============================================================================== --- head/contrib/pf/pfctl/pfctl.8 Thu Jan 5 23:08:11 2012 (r229668) +++ head/contrib/pf/pfctl/pfctl.8 Thu Jan 5 23:11:05 2012 (r229669) @@ -88,7 +88,7 @@ When the variable is set to .Dv YES in -.Xr rc.conf.local 8 , +.Xr rc.conf 5 , the rule file specified with the variable .Va pf_rules is loaded automatically by the From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 00:19:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F969106566C; Fri, 6 Jan 2012 00:19:31 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C347E8FC17; Fri, 6 Jan 2012 00:19:30 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so1800796obb.13 for ; Thu, 05 Jan 2012 16:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=E1xE1Zi+syHw9mtJHpI0iMioaU9eIKWVLirksTtF8CU=; b=SU45Wa79BxH8ix1PtmpW3IIX4MDED3pEUdY3XWxXhxIn+Bg28BPdYss8SdaoKPwU56 13L3EVuxz2QL4d9N3URd7Mg0gUAsyloaezsx5r5ot1t3/CIv0TsvrRNhbGzVk0OAUjuB zmlwcYJ/ni/0IDhsBz2UIZ/DVIlP5KEPpArBU= MIME-Version: 1.0 Received: by 10.182.78.165 with SMTP id c5mr3187458obx.60.1325809170056; Thu, 05 Jan 2012 16:19:30 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Thu, 5 Jan 2012 16:19:29 -0800 (PST) In-Reply-To: <201201052229.q05MTBMf059184@svn.freebsd.org> References: <201201052229.q05MTBMf059184@svn.freebsd.org> Date: Fri, 6 Jan 2012 03:19:29 +0300 X-Google-Sender-Auth: 5D52Cw1Ijvgd_ZezHnhMeakpnQY Message-ID: From: Sergey Kandaurov To: John Baldwin 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: r229665 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 00:19:31 -0000 On 6 January 2012 02:29, John Baldwin wrote: > Author: jhb > Date: Thu Jan =A05 22:29:11 2012 > New Revision: 229665 > URL: http://svn.freebsd.org/changeset/base/229665 > > Log: > =A0Remove the assertion from tcp_input() that rcv_nxt is always greater > =A0than or equal to rcv_adv and fix tcp_twstart() to handle this case by > =A0assuming the last window was zero rather than a negative value. > > =A0The code in tcp_input() already safely handled this case. =A0It can ha= ppen > =A0due to delayed ACKs along with a remote sender that sends data beyond > =A0the window we previously advertised. =A0If we have room in our socket = buffer > =A0for the extra data beyond the advertised window, we will accept it. > =A0However, if the ACK for that segment is delayed, then we will not > =A0effectively fixup rcv_adv to account for that extra data until the > =A0next segment arrives and forces out an ACK. =A0When that next segment > =A0arrives, rcv_nxt will be beyond rcv_adv. > > =A0Tested by: =A0 =A0pjd > =A0MFC after: =A0 =A01 week > > Modified: > =A0head/sys/netinet/tcp_input.c > =A0head/sys/netinet/tcp_timewait.c > > Modified: head/sys/netinet/tcp_input.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/netinet/tcp_input.c =A0 =A0 =A0 =A0Thu Jan =A05 22:28:40 201= 2 =A0 =A0 =A0 =A0(r229664) > +++ head/sys/netinet/tcp_input.c =A0 =A0 =A0 =A0Thu Jan =A05 22:29:11 201= 2 =A0 =A0 =A0 =A0(r229665) > @@ -1795,9 +1795,6 @@ tcp_do_segment(struct mbuf *m, struct tc > =A0 =A0 =A0 =A0win =3D sbspace(&so->so_rcv); > =A0 =A0 =A0 =A0if (win < 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0win =3D 0; > - =A0 =A0 =A0 KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), > - =A0 =A0 =A0 =A0 =A0 ("tcp_input negative window: tp %p rcv_nxt %u rcv_a= dv %u", tp, > - =A0 =A0 =A0 =A0 =A0 tp->rcv_nxt, tp->rcv_adv)); > =A0 =A0 =A0 =A0tp->rcv_wnd =3D imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)= ); > > =A0 =A0 =A0 =A0/* Reset receive buffer auto scaling when not in bulk rece= ive mode. */ > > Modified: head/sys/netinet/tcp_timewait.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/netinet/tcp_timewait.c =A0 =A0 Thu Jan =A05 22:28:40 2012 = =A0 =A0 =A0 =A0(r229664) > +++ head/sys/netinet/tcp_timewait.c =A0 =A0 Thu Jan =A05 22:29:11 2012 = =A0 =A0 =A0 =A0(r229665) > @@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp) > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Recover last window size sent. > =A0 =A0 =A0 =A0 */ > - =A0 =A0 =A0 KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), > - =A0 =A0 =A0 =A0 =A0 ("tcp_twstart negative window: tp %p rcv_nxt %u rcv= _adv %u", tp, > - =A0 =A0 =A0 =A0 =A0 tp->rcv_nxt, tp->rcv_adv)); > - =A0 =A0 =A0 tw->last_win =3D (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_sca= le; > + =A0 =A0 =A0 if (SEQ_GE(tp->rcv_adv, tp->rcv_nxt)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tw->last_win =3D (tp->rcv_adv - tp->rcv_nxt= ) >> tp->rcv_scale; > + =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tw->last_win =3D 0; > > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Set t_recent if timestamps are used on the connection. Hi, Looks like a typo there: /usr/src/sys/netinet/tcp_timewait.c: In function 'tcp_twstart': /usr/src/sys/netinet/tcp_timewait.c:245: warning: implicit declaration of function 'SEQ_GE' /usr/src/sys/netinet/tcp_timewait.c:245: warning: nested extern declaration of 'SEQ_GE' [-Wnested-externs] --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 00:22:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87D0106566C; Fri, 6 Jan 2012 00:22:55 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1808FC0C; Fri, 6 Jan 2012 00:22: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 q060MtLT063133; Fri, 6 Jan 2012 00:22:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q060MtMw063129; Fri, 6 Jan 2012 00:22:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201201060022.q060MtMw063129@svn.freebsd.org> From: Jim Harris Date: Fri, 6 Jan 2012 00:22: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: r229671 - in head/sys/dev: ahci ata ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 00:22:55 -0000 Author: jimharris Date: Fri Jan 6 00:22:55 2012 New Revision: 229671 URL: http://svn.freebsd.org/changeset/base/229671 Log: Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode. Reviewed by: mav Approved by: scottl Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Jan 5 23:12:19 2012 (r229670) +++ head/sys/dev/ahci/ahci.c Fri Jan 6 00:22:55 2012 (r229671) @@ -171,6 +171,7 @@ static struct { {0x1d028086, 0x00, "Intel Patsburg", 0}, {0x1d048086, 0x00, "Intel Patsburg", 0}, {0x1d068086, 0x00, "Intel Patsburg", 0}, + {0x28268086, 0x00, "Intel Patsburg (RAID)", 0}, {0x1e028086, 0x00, "Intel Panther Point", 0}, {0x1e038086, 0x00, "Intel Panther Point", 0}, {0x1e048086, 0x00, "Intel Panther Point", 0}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Thu Jan 5 23:12:19 2012 (r229670) +++ head/sys/dev/ata/ata-pci.h Fri Jan 6 00:22:55 2012 (r229671) @@ -236,6 +236,7 @@ struct ata_pci_controller { #define ATA_PBG_AH1 0x1d028086 #define ATA_PBG_R1 0x1d048086 #define ATA_PBG_R2 0x1d068086 +#define ATA_PBG_R3 0x28268086 #define ATA_PBG_S2 0x1d088086 #define ATA_PPT_S1 0x1e008086 Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Thu Jan 5 23:12:19 2012 (r229670) +++ head/sys/dev/ata/chipsets/ata-intel.c Fri Jan 6 00:22:55 2012 (r229671) @@ -197,6 +197,7 @@ ata_intel_probe(device_t dev) { ATA_PBG_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, + { ATA_PBG_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Patsburg" }, { ATA_PPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 00:23:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93C771065708; Fri, 6 Jan 2012 00:23:17 +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 825128FC16; Fri, 6 Jan 2012 00:23:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q060NHS0063182; Fri, 6 Jan 2012 00:23:17 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q060NHAZ063180; Fri, 6 Jan 2012 00:23:17 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201060023.q060NHAZ063180@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 6 Jan 2012 00:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229672 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 00:23:17 -0000 Author: pluknet Date: Fri Jan 6 00:23:17 2012 New Revision: 229672 URL: http://svn.freebsd.org/changeset/base/229672 Log: Fix a typo. X-MFC-with: 229665 Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri Jan 6 00:22:55 2012 (r229671) +++ head/sys/netinet/tcp_timewait.c Fri Jan 6 00:23:17 2012 (r229672) @@ -242,7 +242,7 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - if (SEQ_GE(tp->rcv_adv, tp->rcv_nxt)) + if (SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt)) tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; else tw->last_win = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 00:34:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 963581065675; Fri, 6 Jan 2012 00:34:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 851348FC13; Fri, 6 Jan 2012 00:34: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 q060YRa3063577; Fri, 6 Jan 2012 00:34:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q060YR69063575; Fri, 6 Jan 2012 00:34:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201060034.q060YR69063575@svn.freebsd.org> From: Adrian Chadd Date: Fri, 6 Jan 2012 00:34: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: r229673 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 00:34:27 -0000 Author: adrian Date: Fri Jan 6 00:34:27 2012 New Revision: 229673 URL: http://svn.freebsd.org/changeset/base/229673 Log: Fix the broken non-cross compile build. Oops! Another pointy hat to: adrian, for stirring up more trouble. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 6 00:23:17 2012 (r229672) +++ head/Makefile.inc1 Fri Jan 6 00:34:27 2012 (r229673) @@ -106,7 +106,7 @@ CLEANDIR= clean cleandepend CLEANDIR= cleandir .endif -LOCAL_TOOL_DIRS?= '' +LOCAL_TOOL_DIRS?= CVS?= cvs CVSFLAGS?= -A -P -d -I! From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 00:56:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D471C106564A; Fri, 6 Jan 2012 00:56:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1CE78FC14; Fri, 6 Jan 2012 00:56: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 q060uVsZ064451; Fri, 6 Jan 2012 00:56:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q060uVJh064441; Fri, 6 Jan 2012 00:56:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201060056.q060uVJh064441@svn.freebsd.org> From: Adrian Chadd Date: Fri, 6 Jan 2012 00:56: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: r229675 - head/tools/bsdbox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 00:56:31 -0000 Author: adrian Date: Fri Jan 6 00:56:31 2012 New Revision: 229675 URL: http://svn.freebsd.org/changeset/base/229675 Log: Import the first cut of "bsdbox". This uses the existing crunchgen infrastructure to build a series of tools designed to replace the base and networking tools on an embedded system. It reuses 'bsd.crunchgen.mk' to drive the actual file creation. The rescue build system also uses this. Unlike busybox, it doesn't include its own source - instead, it just builds from the sources in /usr/src/ and leverages the existing BSD framework. Thie is still quite messy and could do with a whole lot of cleaning up. However it is proving to be very useful with my current build framework, allowing me to build binary root images that are about 30% less than simply cherrypicking files and libraries from an installworld. Added: head/tools/bsdbox/ head/tools/bsdbox/Makefile (contents, props changed) head/tools/bsdbox/Makefile.base (contents, props changed) head/tools/bsdbox/Makefile.fs (contents, props changed) head/tools/bsdbox/Makefile.hostapd (contents, props changed) head/tools/bsdbox/Makefile.kld (contents, props changed) head/tools/bsdbox/Makefile.login (contents, props changed) head/tools/bsdbox/Makefile.net (contents, props changed) head/tools/bsdbox/Makefile.telnetd (contents, props changed) head/tools/bsdbox/Makefile.textproc (contents, props changed) head/tools/bsdbox/README (contents, props changed) Added: head/tools/bsdbox/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,115 @@ +#$FreeBSD$ +# @(#)Makefile 8.1 (Berkeley) 6/2/93 + +NO_MAN= + +.include +MK_SSP= no + +PROG= bsdbox +BINDIR?=/sbin + +################################################################# +# +# General notes: +# +# A number of Make variables are used to generate the crunchgen config file. +# +# CRUNCH_SRCDIRS: lists directories to search for included programs +# CRUNCH_PROGS: lists programs to be included +# CRUNCH_LIBS: libraries to statically link with +# CRUNCH_SHLIBS: libraries to dynamically link with +# CRUNCH_BUILDOPTS: generic build options to be added to every program +# CRUNCH_BUILDTOOLS: lists programs that need build tools built in the +# local architecture. +# +# Special options can be specified for individual programs +# CRUNCH_SRCDIR_$(P): base source directory for program $(P) +# CRUNCH_BUILDOPTS_$(P): additional build options for $(P) +# CRUNCH_ALIAS_$(P): additional names to be used for $(P) +# +# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} +# will be used to generate a hard link to the resulting binary. +# Specific links can be suppressed by setting +# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. +# + +# Define Makefile variable RESCUE +CRUNCH_BUILDOPTS+= -DRESCUE + +# Don't do symlinks as part of the install +CRUNCH_GENERATE_LINKS= no + +# Which sources have local-arch build tools? +# Define as blank; othrs need to override +CRUNCH_BUILDTOOLS= + +################################################################### +# Programs from stock /bin +# +# WARNING: Changing this list may require adjusting +# /usr/include/paths.h as well! You were warned! +# +CRUNCH_SRCDIRS+= bin +# These are required to be shared so login and su can run as +# setuid binaries - they use these libraries. PAM needs to be +# built dynamically or it tries to build _all_ of the modules +# statically - and that ends very badly. +CRUNCH_SHLIBS+= -lc -lutil +CRUNCH_LIBS+= -lkvm -lmemstat -lnetgraph +CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcap + +################################################################### +# Programs from standard /sbin +# +# WARNING: Changing this list may require adjusting +# /usr/include/paths.h as well! You were warned! +# +# Note that mdmfs have their own private 'pathnames.h' +# headers in addition to the standard 'paths.h' header. +# +CRUNCH_SRCDIRS+= sbin + +CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec +# Don't forget this - ifconfig, etc -adrian +.if ${MK_IPX} != "no" +CRUNCH_LIBS+= -lipx +.endif +CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs + +################################################################## +# Programs from stock /usr/bin +# +CRUNCH_SRCDIRS+= usr.bin +# grep +CRUNCH_LIBS+= -lbz2 + +################################################################## +# Programs from stock /usr/sbin +# +CRUNCH_SRCDIRS+= usr.sbin + +################################################################## + +CRUNCH_SRCDIRS+= libexec + +CRUNCH_LIBS+= -lm + +.include "Makefile.base" +.include "Makefile.net" +.include "Makefile.hostapd" +.include "Makefile.textproc" +.include "Makefile.login" +.include "Makefile.kld" +# telnet/telnetd are too broken to include as a crunchgen'ed binary, +# thanks to some of the horrible layering violations going on. +# .include "Makefile.telnetd" +.include "Makefile.fs" + +CRUNCH_LIBS+= -lcrypto -lssl -lz + +# the crunchgen build environment +.include + +# and since it creates a program.. +.include Added: head/tools/bsdbox/Makefile.base ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.base Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,55 @@ +# +# This builds a variety of "base" tools, useful for an embedded +# system. +# +# $FreeBSD$ +# +CRUNCH_PROGS_sbin+= dmesg sysctl init reboot +CRUNCH_PROGS_bin+= ls cat dd df cp hostname kill mkdir sleep ps ln rm hostname +CRUNCH_PROGS_usr.bin+= true false hexdump tail nc w head uname tset +CRUNCH_PROGS_usr.sbin+= gpioctl +CRUNCH_ALIAS_w= uptime +CRUNCH_ALIAS_tset= reset + +CRUNCH_PROGS_usr.bin+= vmstat systat +CRUNCH_LIBS+= -ldevstat -lncursesw -lncurses -lmemstat -lkvm + +CRUNCH_PROGS_usr.bin+= tar cpio +# XXX SSL ? +CRUNCH_LIBS+= -larchive -lbz2 -lz -llzma -lbsdxml -lssl -lcrypto + +# Clear requires tput, and it's a shell script so it won't be crunched +CRUNCH_PROGS_usr.bin+= tput + +# sh +CRUNCH_PROGS_bin+= sh +CRUNCH_ALIAS_sh= -sh +CRUNCH_SUPPRESS_LINK_-sh= 1 +CRUNCH_BUILDTOOLS+= bin/sh + +# chown +CRUNCH_PROGS_usr.sbin+= chown +CRUNCH_ALIAS_chown= chgrp + +# Basic filesystem stuff +CRUNCH_PROGS_sbin+= mount umount + +# grep +# grep doesn't yet work -adrian +CRUNCH_PROGS_usr.bin+= grep + +# less/more +CRUNCH_PROGS_usr.bin+= less +CRUNCH_ALIAS_less= more + +# passwd +CRUNCH_PROGS_usr.bin+= passwd +# These need to be shared, or PAM wants to include _all_ of the libraries +# at runtime. +CRUNCH_SHLIBS+= -lpam -lbsm + +# gzip/gunzip +CRUNCH_PROGS_usr.bin+= gzip +CRUNCH_ALIAS_gunzip= gzip +CRUNCH_ALIAS_gzcat= gzip +CRUNCH_LIBS+= -lz -llzma -lbz2 Added: head/tools/bsdbox/Makefile.fs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.fs Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,17 @@ +# +# Filesystem related tools +# +# $FreeBSD$ + +# mfs +CRUNCH_PROGS_sbin+= mdmfs mdconfig newfs +CRUNCH_ALIAS_mdmfs= mount_mfs + +# UFS +CRUNCH_PROGS_sbin+= fsck_ffs +CRUNCH_LIBS+= -lgeom +CRUNCH_LIBS+= -lufs + +# msdos +# CRUNCH_PROGS_sbin+= mount_msdosfs +# CRUNCH_LIBS+= -lkiconv Added: head/tools/bsdbox/Makefile.hostapd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.hostapd Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,15 @@ +# +# Build hostap/wpa_supplicant and supporting utilities. +# +# $FreeBSD$ +# +CRUNCH_PROGS_usr.sbin+= hostapd hostapd_cli +CRUNCH_SRCDIR_hostapd= $(.CURDIR)/../../usr.sbin/wpa/hostapd +CRUNCH_SRCDIR_hostapd_cli= $(.CURDIR)/../../usr.sbin/wpa/hostapd_cli + +CRUNCH_PROGS_usr.sbin+= wpa_supplicant wpa_cli +CRUNCH_SRCDIR_wpa_supplicant= $(.CURDIR)/../../usr.sbin/wpa/wpa_supplicant +CRUNCH_SRCDIR_wpa_cli= $(.CURDIR)/../../usr.sbin/wpa/wpa_cli + +CRUNCH_LIBS+= -lpcap + Added: head/tools/bsdbox/Makefile.kld ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.kld Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,6 @@ +# +# This builds the kld related programs. +# +# $FreeBSD$ +# +CRUNCH_PROGS_sbin+= kldload kldunload kldstat Added: head/tools/bsdbox/Makefile.login ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.login Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,9 @@ +# +# This builds login and friends. +# +# $FreeBSD$ +# + +CRUNCH_PROGS_libexec+= getty +CRUNCH_PROGS_usr.bin+= cap_mkdb +CRUNCH_PROGS_usr.sbin+= pwd_mkdb Added: head/tools/bsdbox/Makefile.net ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.net Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,32 @@ +# +# This builds network tools. +# +# $FreeBSD$ +# + +CRUNCH_PROGS_sbin+= route ping +CRUNCH_PROGS_usr.sbin+= arp + +# inetd +CRUNCH_PROGS_usr.sbin+= inetd +CRUNCH_LIBS+= -lwrap + +#.if ${MK_INET6_SUPPORT} != "no" +#CRUNCH_PROGS_sbin+= ping6 +#.endif + +# netstat +CRUNCH_PROGS_usr.bin+= netstat +CRUNCH_LIBS+= -lmemstat -lnetgraph +CRUNCH_BUILDOPTS_netstat=-DMK_IPX_SUPPORT=no + +# ifconfig +CRUNCH_PROGS_sbin+= ifconfig +CRUNCH_BUILDOPTS_ifconfig=-DMK_IPX_SUPPORT=no + +# wlan stuff +CRUNCH_PROGS_usr.sbin+= wlandebug + +# tcpdump +CRUNCH_PROGS_usr.sbin+= tcpdump +# CRUNCH_LIBS+= -lpcap -lcrypto Added: head/tools/bsdbox/Makefile.telnetd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.telnetd Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,14 @@ +# Build telnetd +# Question - why is telnetds objects ending up in the srcdir? -adrian + +# This won't work yet - because telnetd relies on libtelnet.a which includes +# kerberos support by default; building telnetd without kerberos support +# requires the cross-build world to be built the same. +# -adrian + +# $FreeBSD$ + +CRUNCH_PROGS_libexec+= telnetd +CRUNCH_PROGS_usr.bin+= telnet +CRUNCH_LIBS+= -lkrb5 -lhx509 -lasn1 -lcom_err -lroken -ltelnetd +# CRUNCH_BUILDOPTS_telnetd= WITHOUT_KERBEROS_SUPPORT=yes Added: head/tools/bsdbox/Makefile.textproc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.textproc Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,20 @@ +# +# This builds a variety of text processing tools that +# may be useful on an embedded device. +# +# $FreeBSD$ +# + +# Sed +CRUNCH_PROGS_usr.bin+= sed + +# Awk +# Disable - it's big! -adrian +#CRUNCH_PROGS_usr.bin+= awk +#CRUNCH_BUILDTOOLS+= usr.bin/awk + +# vi +# Disable - it's big! -adrian +#CRUNCH_PROGS_usr.bin+= vi + +CRUNCH_PROGS_usr.bin+= ee Added: head/tools/bsdbox/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/README Fri Jan 6 00:56:31 2012 (r229675) @@ -0,0 +1,12 @@ +$FreeBSD$ + +This is a very cut down implementation of a "busybox" style binary +for FreeBSD. + +It's based on the rescue build system, which uses the crunchgen functionality +to build binaries. + +It's a work in progress. + + -- adrian + From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 01:23:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C3B0106566C; Fri, 6 Jan 2012 01:23:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 890DE8FC0A; Fri, 6 Jan 2012 01:23: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 q061NQiS065382; Fri, 6 Jan 2012 01:23:26 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q061NQoM065373; Fri, 6 Jan 2012 01:23:26 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201060123.q061NQoM065373@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 6 Jan 2012 01:23: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: r229677 - in head/sys/mips: cavium cavium/cryptocteon include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 01:23:26 -0000 Author: gonzo Date: Fri Jan 6 01:23:26 2012 New Revision: 229677 URL: http://svn.freebsd.org/changeset/base/229677 Log: - Add better COP2 (crypto coprocessor) context handler for Octeon. Keep COP2 disabled and lazily allocate COP2 context structure in exception handler. Keep kernel and userland contexts separated. Added: head/sys/mips/cavium/octeon_cop2.S (contents, props changed) head/sys/mips/cavium/octeon_cop2.h (contents, props changed) head/sys/mips/include/octeon_cop2.h (contents, props changed) head/sys/mips/mips/octeon_cop2.c (contents, props changed) head/sys/mips/mips/octeon_cop2_swtch.S (contents, props changed) Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/files.octeon1 head/sys/mips/include/cpuregs.h head/sys/mips/include/frame.h head/sys/mips/include/proc.h head/sys/mips/mips/exception.S head/sys/mips/mips/genassym.c head/sys/mips/mips/locore.S head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/swtch.S head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cavium_crypto.c Fri Jan 6 01:20:48 2012 (r229676) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Fri Jan 6 01:23:26 2012 (r229677) @@ -87,22 +87,6 @@ __FBSDID("$FreeBSD$"); } \ } while (0) -static inline unsigned long octeon_crypto_enable(void) -{ - register_t s; - - s = intr_disable(); - mips_wr_status(mips_rd_status() | MIPS_SR_COP_2_BIT); - - return (s); -} - -static inline void octeon_crypto_disable(register_t s) -{ - mips_wr_status(mips_rd_status() & ~MIPS_SR_COP_2_BIT); - intr_restore(s); -} - #define ESP_HEADER_LENGTH 8 #define DES_CBC_IV_LENGTH 8 #define AES_CBC_IV_LENGTH 16 @@ -252,14 +236,12 @@ octo_calc_hash(uint8_t auth, unsigned ch uint64_t *key1; register uint64_t xor1 = 0x3636363636363636ULL; register uint64_t xor2 = 0x5c5c5c5c5c5c5c5cULL; - register_t s; dprintf("%s()\n", __func__); memset(hash_key, 0, sizeof(hash_key)); memcpy(hash_key, (uint8_t *) key, (auth ? 20 : 16)); key1 = (uint64_t *) hash_key; - s = octeon_crypto_enable(); if (auth) { CVMX_MT_HSH_IV(0x67452301EFCDAB89ULL, 0); CVMX_MT_HSH_IV(0x98BADCFE10325476ULL, 1); @@ -332,7 +314,6 @@ octo_calc_hash(uint8_t auth, unsigned ch outer[2] = 0; CVMX_MF_HSH_IV(outer[2], 2); } - octeon_crypto_disable(s); return; } @@ -349,7 +330,6 @@ octo_des_cbc_encrypt( { uint64_t *data; int data_i, data_l; - register_t s; dprintf("%s()\n", __func__); @@ -367,7 +347,6 @@ octo_des_cbc_encrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); /* load 3DES Key */ CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); @@ -378,7 +357,6 @@ octo_des_cbc_encrypt( CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -397,7 +375,6 @@ octo_des_cbc_encrypt( crypt_len -= 8; } - octeon_crypto_disable(s); return 0; } @@ -412,7 +389,6 @@ octo_des_cbc_decrypt( { uint64_t *data; int data_i, data_l; - register_t s; dprintf("%s()\n", __func__); @@ -430,8 +406,6 @@ octo_des_cbc_decrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load 3DES Key */ CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); if (od->octo_encklen == 24) { @@ -441,7 +415,6 @@ octo_des_cbc_decrypt( CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -460,7 +433,6 @@ octo_des_cbc_decrypt( crypt_len -= 8; } - octeon_crypto_disable(s); return 0; } @@ -477,7 +449,6 @@ octo_aes_cbc_encrypt( { uint64_t *data, *pdata; int data_i, data_l; - register_t s; dprintf("%s()\n", __func__); @@ -495,8 +466,6 @@ octo_aes_cbc_encrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load AES Key */ CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); @@ -511,7 +480,6 @@ octo_aes_cbc_encrypt( CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -536,7 +504,6 @@ octo_aes_cbc_encrypt( crypt_len -= 16; } - octeon_crypto_disable(s); return 0; } @@ -551,7 +518,6 @@ octo_aes_cbc_decrypt( { uint64_t *data, *pdata; int data_i, data_l; - register_t s; dprintf("%s()\n", __func__); @@ -569,8 +535,6 @@ octo_aes_cbc_decrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load AES Key */ CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); @@ -585,7 +549,6 @@ octo_aes_cbc_decrypt( CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -610,7 +573,6 @@ octo_aes_cbc_decrypt( crypt_len -= 16; } - octeon_crypto_disable(s); return 0; } @@ -629,7 +591,6 @@ octo_null_md5_encrypt( uint64_t *data; uint64_t tmp1, tmp2; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -644,8 +605,6 @@ octo_null_md5_encrypt( IOV_INIT(iov, data, data_i, data_l); - s = octeon_crypto_enable(); - /* Load MD5 IV */ CVMX_MT_HSH_IV(od->octo_hminner[0], 0); CVMX_MT_HSH_IV(od->octo_hminner[1], 1); @@ -716,7 +675,6 @@ octo_null_md5_encrypt( CVMX_MF_HSH_IV(tmp1, 1); *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -735,7 +693,6 @@ octo_null_sha1_encrypt( uint64_t *data; uint64_t tmp1, tmp2, tmp3; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -750,8 +707,6 @@ octo_null_sha1_encrypt( IOV_INIT(iov, data, data_i, data_l); - s = octeon_crypto_enable(); - /* Load SHA1 IV */ CVMX_MT_HSH_IV(od->octo_hminner[0], 0); CVMX_MT_HSH_IV(od->octo_hminner[1], 1); @@ -825,7 +780,6 @@ octo_null_sha1_encrypt( CVMX_MF_HSH_IV(tmp1, 1); *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -849,7 +803,6 @@ octo_des_cbc_md5_encrypt( uint32_t *data32; uint64_t tmp1, tmp2; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -870,8 +823,6 @@ octo_des_cbc_md5_encrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load 3DES Key */ CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); if (od->octo_encklen == 24) { @@ -881,7 +832,6 @@ octo_des_cbc_md5_encrypt( CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -981,7 +931,6 @@ octo_des_cbc_md5_encrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -1002,7 +951,6 @@ octo_des_cbc_md5_decrypt( uint32_t *data32; uint64_t tmp1, tmp2; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -1023,8 +971,6 @@ octo_des_cbc_md5_decrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load 3DES Key */ CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); if (od->octo_encklen == 24) { @@ -1034,7 +980,6 @@ octo_des_cbc_md5_decrypt( CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -1134,7 +1079,6 @@ octo_des_cbc_md5_decrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -1158,7 +1102,6 @@ octo_des_cbc_sha1_encrypt( uint32_t *data32; uint64_t tmp1, tmp2, tmp3; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -1179,8 +1122,6 @@ octo_des_cbc_sha1_encrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load 3DES Key */ CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); if (od->octo_encklen == 24) { @@ -1190,7 +1131,6 @@ octo_des_cbc_sha1_encrypt( CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -1293,7 +1233,6 @@ octo_des_cbc_sha1_encrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -1314,7 +1253,6 @@ octo_des_cbc_sha1_decrypt( uint32_t *data32; uint64_t tmp1, tmp2, tmp3; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -1335,8 +1273,6 @@ octo_des_cbc_sha1_decrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load 3DES Key */ CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); if (od->octo_encklen == 24) { @@ -1346,7 +1282,6 @@ octo_des_cbc_sha1_decrypt( CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -1448,7 +1383,6 @@ octo_des_cbc_sha1_decrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -1473,7 +1407,6 @@ octo_aes_cbc_md5_encrypt( uint32_t *data32; uint64_t tmp1, tmp2; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -1494,8 +1427,6 @@ octo_aes_cbc_md5_encrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load AES Key */ CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); @@ -1510,7 +1441,6 @@ octo_aes_cbc_md5_encrypt( CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -1633,7 +1563,6 @@ octo_aes_cbc_md5_encrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -1655,7 +1584,6 @@ octo_aes_cbc_md5_decrypt( uint32_t *data32; uint64_t tmp1, tmp2; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -1676,8 +1604,6 @@ octo_aes_cbc_md5_decrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load AES Key */ CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); @@ -1692,7 +1618,6 @@ octo_aes_cbc_md5_decrypt( CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -1811,7 +1736,6 @@ octo_aes_cbc_md5_decrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -1836,7 +1760,6 @@ octo_aes_cbc_sha1_encrypt( uint32_t *data32; uint64_t tmp1, tmp2, tmp3; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -1857,8 +1780,6 @@ octo_aes_cbc_sha1_encrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load AES Key */ CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); @@ -1873,7 +1794,6 @@ octo_aes_cbc_sha1_encrypt( CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -2015,7 +1935,6 @@ octo_aes_cbc_sha1_encrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } @@ -2037,7 +1956,6 @@ octo_aes_cbc_sha1_decrypt( uint32_t *data32; uint64_t tmp1, tmp2, tmp3; int data_i, data_l, alen = auth_len; - register_t s; dprintf("%s()\n", __func__); @@ -2058,8 +1976,6 @@ octo_aes_cbc_sha1_decrypt( CVMX_PREFETCH0(ivp); CVMX_PREFETCH0(od->octo_enckey); - s = octeon_crypto_enable(); - /* load AES Key */ CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); @@ -2074,7 +1990,6 @@ octo_aes_cbc_sha1_decrypt( CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); } else { - octeon_crypto_disable(s); dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); return -EINVAL; } @@ -2215,7 +2130,6 @@ octo_aes_cbc_sha1_decrypt( CVMX_MF_HSH_IV(tmp1, 1); *data32 = (uint32_t) (tmp1 >> 32); - octeon_crypto_disable(s); return 0; } Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Fri Jan 6 01:20:48 2012 (r229676) +++ head/sys/mips/cavium/files.octeon1 Fri Jan 6 01:23:26 2012 (r229677) @@ -21,6 +21,8 @@ mips/cavium/octeon_nmi.S optional octe mips/cavium/cryptocteon/cavium_crypto.c optional cryptocteon mips/cavium/cryptocteon/cryptocteon.c optional cryptocteon +mips/mips/octeon_cop2_swtch.S standard +mips/mips/octeon_cop2.c standard mips/cavium/octe/ethernet.c optional octe mips/cavium/octe/ethernet-mv88e61xx.c optional octe octeon_vendor_lanner Added: head/sys/mips/cavium/octeon_cop2.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_cop2.S Fri Jan 6 01:23:26 2012 (r229677) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2011 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include "assym.s" + +.set noreorder + +#define SAVE_COP2_REGISTER(reg) \ + dmfc2 t1, reg; sd t1, reg##_OFFSET(a0) + + +#define RESTORE_COP2_REGISTER(reg) \ + ld t1, reg##_OFFSET(a0); dmtc2 t1, reg##_SET + +LEAF(octeon_cop2_save) + /* Get CvmCtl register */ + dmfc0 t0, $9, 7 + + /* CRC state */ + SAVE_COP2_REGISTER(COP2_CRC_IV) + SAVE_COP2_REGISTER(COP2_CRC_LENGTH) + SAVE_COP2_REGISTER(COP2_CRC_POLY) + + /* if CvmCtl[NODFA_CP2] -> save_nodfa */ + bbit1 t0, 28, save_nodfa + nop + + /* LLM state */ + SAVE_COP2_REGISTER(COP2_LLM_DAT0) + SAVE_COP2_REGISTER(COP2_LLM_DAT1) + +save_nodfa: + /* crypto stuff is irrelevant if CvmCtl[NOCRYPTO] */ + bbit1 t0, 26, save_done + nop + + SAVE_COP2_REGISTER(COP2_3DES_IV) + SAVE_COP2_REGISTER(COP2_3DES_KEY0) + SAVE_COP2_REGISTER(COP2_3DES_KEY1) + SAVE_COP2_REGISTER(COP2_3DES_KEY2) + SAVE_COP2_REGISTER(COP2_3DES_RESULT) + + SAVE_COP2_REGISTER(COP2_AES_INP0) + SAVE_COP2_REGISTER(COP2_AES_IV0) + SAVE_COP2_REGISTER(COP2_AES_IV1) + SAVE_COP2_REGISTER(COP2_AES_KEY0) + SAVE_COP2_REGISTER(COP2_AES_KEY1) + SAVE_COP2_REGISTER(COP2_AES_KEY2) + SAVE_COP2_REGISTER(COP2_AES_KEY3) + SAVE_COP2_REGISTER(COP2_AES_KEYLEN) + SAVE_COP2_REGISTER(COP2_AES_RESULT0) + SAVE_COP2_REGISTER(COP2_AES_RESULT1) + + dmfc0 t0, $15 + li t1, 0x000d0000 /* Octeon Pass1 */ + beq t0, t1, save_pass1 + nop + + SAVE_COP2_REGISTER(COP2_HSH_DATW0) + SAVE_COP2_REGISTER(COP2_HSH_DATW1) + SAVE_COP2_REGISTER(COP2_HSH_DATW2) + SAVE_COP2_REGISTER(COP2_HSH_DATW3) + SAVE_COP2_REGISTER(COP2_HSH_DATW4) + SAVE_COP2_REGISTER(COP2_HSH_DATW5) + SAVE_COP2_REGISTER(COP2_HSH_DATW6) + SAVE_COP2_REGISTER(COP2_HSH_DATW7) + SAVE_COP2_REGISTER(COP2_HSH_DATW8) + SAVE_COP2_REGISTER(COP2_HSH_DATW9) + SAVE_COP2_REGISTER(COP2_HSH_DATW10) + SAVE_COP2_REGISTER(COP2_HSH_DATW11) + SAVE_COP2_REGISTER(COP2_HSH_DATW12) + SAVE_COP2_REGISTER(COP2_HSH_DATW13) + SAVE_COP2_REGISTER(COP2_HSH_DATW14) + SAVE_COP2_REGISTER(COP2_HSH_IVW0) + SAVE_COP2_REGISTER(COP2_HSH_IVW1) + SAVE_COP2_REGISTER(COP2_HSH_IVW2) + SAVE_COP2_REGISTER(COP2_HSH_IVW3) + SAVE_COP2_REGISTER(COP2_HSH_IVW4) + SAVE_COP2_REGISTER(COP2_HSH_IVW5) + SAVE_COP2_REGISTER(COP2_HSH_IVW6) + SAVE_COP2_REGISTER(COP2_HSH_IVW7) + SAVE_COP2_REGISTER(COP2_GFM_MULT0) + SAVE_COP2_REGISTER(COP2_GFM_MULT1) + SAVE_COP2_REGISTER(COP2_GFM_POLY) + SAVE_COP2_REGISTER(COP2_GFM_RESULT0) + SAVE_COP2_REGISTER(COP2_GFM_RESULT1) + jr ra + nop + +save_pass1: + SAVE_COP2_REGISTER(COP2_HSH_DATW0_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_DATW1_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_DATW2_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_DATW3_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_DATW4_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_DATW5_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_DATW6_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_IVW0_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_IVW1_PASS1) + SAVE_COP2_REGISTER(COP2_HSH_IVW2_PASS1) + +save_done: + jr ra + nop +END(octeon_cop2_save) + +LEAF(octeon_cop2_restore) + /* Get CvmCtl register */ + dmfc0 t0, $9, 7 + + /* CRC state */ + RESTORE_COP2_REGISTER(COP2_CRC_IV) + RESTORE_COP2_REGISTER(COP2_CRC_LENGTH) + RESTORE_COP2_REGISTER(COP2_CRC_POLY) + + /* if CvmCtl[NODFA_CP2] -> save_nodfa */ + bbit1 t0, 28, restore_nodfa + nop + + /* LLM state */ + RESTORE_COP2_REGISTER(COP2_LLM_DAT0) + RESTORE_COP2_REGISTER(COP2_LLM_DAT1) + +restore_nodfa: + /* crypto stuff is irrelevant if CvmCtl[NOCRYPTO] */ + bbit1 t0, 26, restore_done + nop + + RESTORE_COP2_REGISTER(COP2_3DES_IV) + RESTORE_COP2_REGISTER(COP2_3DES_KEY0) + RESTORE_COP2_REGISTER(COP2_3DES_KEY1) + RESTORE_COP2_REGISTER(COP2_3DES_KEY2) + RESTORE_COP2_REGISTER(COP2_3DES_RESULT) + + RESTORE_COP2_REGISTER(COP2_AES_INP0) + RESTORE_COP2_REGISTER(COP2_AES_IV0) + RESTORE_COP2_REGISTER(COP2_AES_IV1) + RESTORE_COP2_REGISTER(COP2_AES_KEY0) + RESTORE_COP2_REGISTER(COP2_AES_KEY1) + RESTORE_COP2_REGISTER(COP2_AES_KEY2) + RESTORE_COP2_REGISTER(COP2_AES_KEY3) + RESTORE_COP2_REGISTER(COP2_AES_KEYLEN) + RESTORE_COP2_REGISTER(COP2_AES_RESULT0) + RESTORE_COP2_REGISTER(COP2_AES_RESULT1) + + dmfc0 t0, $15 + li t1, 0x000d0000 /* Octeon Pass1 */ + beq t0, t1, restore_pass1 + nop + + RESTORE_COP2_REGISTER(COP2_HSH_DATW0) + RESTORE_COP2_REGISTER(COP2_HSH_DATW1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW2) + RESTORE_COP2_REGISTER(COP2_HSH_DATW3) + RESTORE_COP2_REGISTER(COP2_HSH_DATW4) + RESTORE_COP2_REGISTER(COP2_HSH_DATW5) + RESTORE_COP2_REGISTER(COP2_HSH_DATW6) + RESTORE_COP2_REGISTER(COP2_HSH_DATW7) + RESTORE_COP2_REGISTER(COP2_HSH_DATW8) + RESTORE_COP2_REGISTER(COP2_HSH_DATW9) + RESTORE_COP2_REGISTER(COP2_HSH_DATW10) + RESTORE_COP2_REGISTER(COP2_HSH_DATW11) + RESTORE_COP2_REGISTER(COP2_HSH_DATW12) + RESTORE_COP2_REGISTER(COP2_HSH_DATW13) + RESTORE_COP2_REGISTER(COP2_HSH_DATW14) + RESTORE_COP2_REGISTER(COP2_HSH_IVW0) + RESTORE_COP2_REGISTER(COP2_HSH_IVW1) + RESTORE_COP2_REGISTER(COP2_HSH_IVW2) + RESTORE_COP2_REGISTER(COP2_HSH_IVW3) + RESTORE_COP2_REGISTER(COP2_HSH_IVW4) + RESTORE_COP2_REGISTER(COP2_HSH_IVW5) + RESTORE_COP2_REGISTER(COP2_HSH_IVW6) + RESTORE_COP2_REGISTER(COP2_HSH_IVW7) + RESTORE_COP2_REGISTER(COP2_GFM_MULT0) + RESTORE_COP2_REGISTER(COP2_GFM_MULT1) + RESTORE_COP2_REGISTER(COP2_GFM_POLY) + RESTORE_COP2_REGISTER(COP2_GFM_RESULT0) + RESTORE_COP2_REGISTER(COP2_GFM_RESULT1) + jr ra + nop + +restore_pass1: + RESTORE_COP2_REGISTER(COP2_HSH_DATW0_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW1_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW2_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW3_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW4_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW5_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_DATW6_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_IVW0_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_IVW1_PASS1) + RESTORE_COP2_REGISTER(COP2_HSH_IVW2_PASS1) + +restore_done: + jr ra + nop +END(octeon_cop2_restore) Added: head/sys/mips/cavium/octeon_cop2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_cop2.h Fri Jan 6 01:23:26 2012 (r229677) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2011, Oleksandr Tymoshenko + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef __OCTEON_COP2_H__ +#define __OCTEON_COP2_H__ + +/* + * COP2 registers of interest + */ +#define COP2_CRC_IV 0x201 +#define COP2_CRC_IV_SET COP2_CRC_IV +#define COP2_CRC_LENGTH 0x202 +#define COP2_CRC_LENGTH_SET 0x1202 +#define COP2_CRC_POLY 0x200 +#define COP2_CRC_POLY_SET 0x4200 +#define COP2_LLM_DAT0 0x402 +#define COP2_LLM_DAT0_SET COP2_LLM_DAT0 +#define COP2_LLM_DAT1 0x40A +#define COP2_LLM_DAT1_SET COP2_LLM_DAT1 +#define COP2_3DES_IV 0x084 +#define COP2_3DES_IV_SET COP2_3DES_IV +#define COP2_3DES_KEY0 0x080 +#define COP2_3DES_KEY0_SET COP2_3DES_KEY0 +#define COP2_3DES_KEY1 0x081 +#define COP2_3DES_KEY1_SET COP2_3DES_KEY1 +#define COP2_3DES_KEY2 0x082 +#define COP2_3DES_KEY2_SET COP2_3DES_KEY2 +#define COP2_3DES_RESULT 0x088 +#define COP2_3DES_RESULT_SET 0x098 +#define COP2_AES_INP0 0x111 +#define COP2_AES_INP0_SET COP2_AES_INP0 +#define COP2_AES_IV0 0x102 +#define COP2_AES_IV0_SET COP2_AES_IV0 +#define COP2_AES_IV1 0x103 +#define COP2_AES_IV1_SET COP2_AES_IV1 +#define COP2_AES_KEY0 0x104 +#define COP2_AES_KEY0_SET COP2_AES_KEY0 +#define COP2_AES_KEY1 0x105 +#define COP2_AES_KEY1_SET COP2_AES_KEY1 +#define COP2_AES_KEY2 0x106 +#define COP2_AES_KEY2_SET COP2_AES_KEY2 +#define COP2_AES_KEY3 0x107 +#define COP2_AES_KEY3_SET COP2_AES_KEY3 +#define COP2_AES_KEYLEN 0x110 +#define COP2_AES_KEYLEN_SET COP2_AES_KEYLEN +#define COP2_AES_RESULT0 0x100 +#define COP2_AES_RESULT0_SET COP2_AES_RESULT0 +#define COP2_AES_RESULT1 0x101 +#define COP2_AES_RESULT1_SET COP2_AES_RESULT1 +#define COP2_HSH_DATW0 0x240 +#define COP2_HSH_DATW0_SET COP2_HSH_DATW0 +#define COP2_HSH_DATW1 0x241 +#define COP2_HSH_DATW1_SET COP2_HSH_DATW1 +#define COP2_HSH_DATW2 0x242 +#define COP2_HSH_DATW2_SET COP2_HSH_DATW2 +#define COP2_HSH_DATW3 0x243 +#define COP2_HSH_DATW3_SET COP2_HSH_DATW3 +#define COP2_HSH_DATW4 0x244 +#define COP2_HSH_DATW4_SET COP2_HSH_DATW4 +#define COP2_HSH_DATW5 0x245 +#define COP2_HSH_DATW5_SET COP2_HSH_DATW5 +#define COP2_HSH_DATW6 0x246 +#define COP2_HSH_DATW6_SET COP2_HSH_DATW6 +#define COP2_HSH_DATW7 0x247 +#define COP2_HSH_DATW7_SET COP2_HSH_DATW7 +#define COP2_HSH_DATW8 0x248 +#define COP2_HSH_DATW8_SET COP2_HSH_DATW8 +#define COP2_HSH_DATW9 0x249 +#define COP2_HSH_DATW9_SET COP2_HSH_DATW9 +#define COP2_HSH_DATW10 0x24A +#define COP2_HSH_DATW10_SET COP2_HSH_DATW10 +#define COP2_HSH_DATW11 0x24B +#define COP2_HSH_DATW11_SET COP2_HSH_DATW11 +#define COP2_HSH_DATW12 0x24C +#define COP2_HSH_DATW12_SET COP2_HSH_DATW12 +#define COP2_HSH_DATW13 0x24D +#define COP2_HSH_DATW13_SET COP2_HSH_DATW13 +#define COP2_HSH_DATW14 0x24E +#define COP2_HSH_DATW14_SET COP2_HSH_DATW14 +#define COP2_HSH_IVW0 0x250 +#define COP2_HSH_IVW0_SET COP2_HSH_IVW0 +#define COP2_HSH_IVW1 0x251 +#define COP2_HSH_IVW1_SET COP2_HSH_IVW1 +#define COP2_HSH_IVW2 0x252 +#define COP2_HSH_IVW2_SET COP2_HSH_IVW2 +#define COP2_HSH_IVW3 0x253 +#define COP2_HSH_IVW3_SET COP2_HSH_IVW3 +#define COP2_HSH_IVW4 0x254 +#define COP2_HSH_IVW4_SET COP2_HSH_IVW4 +#define COP2_HSH_IVW5 0x255 +#define COP2_HSH_IVW5_SET COP2_HSH_IVW5 +#define COP2_HSH_IVW6 0x256 +#define COP2_HSH_IVW6_SET COP2_HSH_IVW6 +#define COP2_HSH_IVW7 0x257 +#define COP2_HSH_IVW7_SET COP2_HSH_IVW7 +#define COP2_GFM_MULT0 0x258 +#define COP2_GFM_MULT0_SET COP2_GFM_MULT0 +#define COP2_GFM_MULT1 0x259 +#define COP2_GFM_MULT1_SET COP2_GFM_MULT1 +#define COP2_GFM_POLY 0x25E +#define COP2_GFM_POLY_SET COP2_GFM_POLY +#define COP2_GFM_RESULT0 0x25A +#define COP2_GFM_RESULT0_SET COP2_GFM_RESULT0 +#define COP2_GFM_RESULT1 0x25B +#define COP2_GFM_RESULT1_SET COP2_GFM_RESULT1 +#define COP2_HSH_DATW0_PASS1 0x040 +#define COP2_HSH_DATW0_PASS1_SET COP2_HSH_DATW0_PASS1 +#define COP2_HSH_DATW1_PASS1 0x041 +#define COP2_HSH_DATW1_PASS1_SET COP2_HSH_DATW1_PASS1 +#define COP2_HSH_DATW2_PASS1 0x042 +#define COP2_HSH_DATW2_PASS1_SET COP2_HSH_DATW2_PASS1 +#define COP2_HSH_DATW3_PASS1 0x043 +#define COP2_HSH_DATW3_PASS1_SET COP2_HSH_DATW3_PASS1 +#define COP2_HSH_DATW4_PASS1 0x044 +#define COP2_HSH_DATW4_PASS1_SET COP2_HSH_DATW4_PASS1 +#define COP2_HSH_DATW5_PASS1 0x045 +#define COP2_HSH_DATW5_PASS1_SET COP2_HSH_DATW5_PASS1 +#define COP2_HSH_DATW6_PASS1 0x046 +#define COP2_HSH_DATW6_PASS1_SET COP2_HSH_DATW6_PASS1 +#define COP2_HSH_IVW0_PASS1 0x048 +#define COP2_HSH_IVW0_PASS1_SET COP2_HSH_IVW0_PASS1 +#define COP2_HSH_IVW1_PASS1 0x049 +#define COP2_HSH_IVW1_PASS1_SET COP2_HSH_IVW1_PASS1 +#define COP2_HSH_IVW2_PASS1 0x04A +#define COP2_HSH_IVW2_PASS1_SET COP2_HSH_IVW2_PASS1 + +#ifndef LOCORE + +struct octeon_cop2_state { + /* 3DES */ + /* 0x0084 */ + unsigned long _3des_iv; + /* 0x0080..0x0082 */ + unsigned long _3des_key[3]; + /* 0x0088, set: 0x0098 */ + unsigned long _3des_result; + + /* AES */ + /* 0x0111 */ + unsigned long aes_inp0; + /* 0x0102..0x0103 */ + unsigned long aes_iv[2]; + /* 0x0104..0x0107 */ + unsigned long aes_key[4]; + /* 0x0110 */ + unsigned long aes_keylen; + /* 0x0100..0x0101 */ + unsigned long aes_result[2]; + + /* CRC */ + /* 0x0201 */ + unsigned long crc_iv; + /* 0x0202, set: 0x1202 */ + unsigned long crc_length; + /* 0x0200, set: 0x4200 */ + unsigned long crc_poly; + + /* Low-latency memory stuff */ + /* 0x0402, 0x040A */ + unsigned long llm_dat[2]; + + /* SHA & MD5 */ + /* 0x0240..0x024E */ + unsigned long hsh_datw[15]; + /* 0x0250..0x0257 */ + unsigned long hsh_ivw[8]; + + /* GFM */ + /* 0x0258..0x0259 */ + unsigned long gfm_mult[2]; + /* 0x025E */ + unsigned long gfm_poly; + /* 0x025A..0x025B */ + unsigned long gfm_result[2]; +}; + +/* Prototypes */ + +void octeon_cop2_save(struct octeon_cop2_state *); +void octeon_cop2_restore(struct octeon_cop2_state *); + +#endif /* LOCORE */ +#endif /* __OCTEON_COP2_H__ */ Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Fri Jan 6 01:20:48 2012 (r229676) +++ head/sys/mips/include/cpuregs.h Fri Jan 6 01:23:26 2012 (r229677) @@ -233,6 +233,7 @@ #define MIPS3_CR_EXC_CODE 0x0000007C /* five bits */ #define MIPS_CR_IP 0x0000FF00 #define MIPS_CR_EXC_CODE_SHIFT 2 +#define MIPS_CR_COP_ERR_SHIFT 28 /* * The bits in the status register. All bits are active when set to 1. Modified: head/sys/mips/include/frame.h ============================================================================== --- head/sys/mips/include/frame.h Fri Jan 6 01:20:48 2012 (r229676) +++ head/sys/mips/include/frame.h Fri Jan 6 01:23:26 2012 (r229677) @@ -122,11 +122,6 @@ struct trapframe { f_register_t f31; register_t fsr; register_t fdummy; - /* - * COP2 registers may need to be saved here based on the CPU, and those - * might need to be per process, or even for the kernel, so we need - * some thought here. - */ }; /* REVISIT */ Added: head/sys/mips/include/octeon_cop2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/octeon_cop2.h Fri Jan 6 01:23:26 2012 (r229677) @@ -0,0 +1,215 @@ +/*- + * Copyright (c) 2011, Oleksandr Tymoshenko + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 02:58:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 0FBC11065670; Fri, 6 Jan 2012 02:58:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 070EB14FCA4; Fri, 6 Jan 2012 02:58:09 +0000 (UTC) Message-ID: <4F066340.9010507@FreeBSD.org> Date: Thu, 05 Jan 2012 18:58:08 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Guy Helmer References: <201201052248.q05MmaZk059871@svn.freebsd.org> In-Reply-To: <201201052248.q05MmaZk059871@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 02:58:12 -0000 On 01/05/2012 14:48, Guy Helmer wrote: > Allow daemon(8) to run pidfile_open() before relenquishing privileges > so pid files can be written in /var/run when started as root. I'm not sure how useful this is since when daemon is exiting it won't be able to remove the pid file (unless I'm missing something). Isn't it better to pre-create the pid file with the proper permissions for the unprivileged user? Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 06:00:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6EA4106566B; Fri, 6 Jan 2012 06:00:18 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 568318FC08; Fri, 6 Jan 2012 06:00:18 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so2063384obb.13 for ; Thu, 05 Jan 2012 22:00:17 -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=h7wODd/sxH4swpexBUz9AzNsvASbu9s806UGEYbW9Ik=; b=cpPnGW+OtLegW01zvys27N31tHCYALSPmVcjEDqVIT/nJT92BYJkM+LkUoSIsSo10I kwGop6uRCaS2iM76g6A61N0lGyWCMzODBJ/3bZB9IEOkmVAiHM2sVP9bhDASTwry8sfI e0pw6QIad93fYlbV4VKp0wTb6dLpJQNQ4WxX4= MIME-Version: 1.0 Received: by 10.182.164.106 with SMTP id yp10mr3773920obb.71.1325829617802; Thu, 05 Jan 2012 22:00:17 -0800 (PST) Received: by 10.182.152.6 with HTTP; Thu, 5 Jan 2012 22:00:17 -0800 (PST) In-Reply-To: <4F066340.9010507@FreeBSD.org> References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> Date: Thu, 5 Jan 2012 22:00:17 -0800 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Guy Helmer Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 06:00:18 -0000 On Thu, Jan 5, 2012 at 6:58 PM, Doug Barton wrote: > On 01/05/2012 14:48, Guy Helmer wrote: >> =A0 Allow daemon(8) to run pidfile_open() before relenquishing privilege= s >> =A0 so pid files can be written in /var/run when started as root. > > I'm not sure how useful this is since when daemon is exiting it won't be > able to remove the pid file (unless I'm missing something). > > Isn't it better to pre-create the pid file with the proper permissions > for the unprivileged user? As another aside, the file descriptor never has fcntl(, FD_CLOEXEC) run on it, so it leaks the file descriptors across execs.. that's not good... Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 08:51:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78CBC106564A; Fri, 6 Jan 2012 08:51:21 +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 6508B8FC1A; Fri, 6 Jan 2012 08:51: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 q068pL2d080021; Fri, 6 Jan 2012 08:51:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q068pLeF080019; Fri, 6 Jan 2012 08:51:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201060851.q068pLeF080019@svn.freebsd.org> From: Adrian Chadd Date: Fri, 6 Jan 2012 08:51: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: r229691 - head/sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 08:51:21 -0000 Author: adrian Date: Fri Jan 6 08:51:20 2012 New Revision: 229691 URL: http://svn.freebsd.org/changeset/base/229691 Log: Flip these options on so the modules build correctly for now. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Fri Jan 6 08:46:26 2012 (r229690) +++ head/sys/pc98/conf/GENERIC Fri Jan 6 08:51:20 2012 (r229691) @@ -214,7 +214,7 @@ device xe # Xircom pccard Ethernet #device wlan # 802.11 support #options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's -#options IEEE80211_SUPPORT_MESH # enable 802.11s draft support +options IEEE80211_SUPPORT_MESH # enable 802.11s draft support #device wlan_wep # 802.11 WEP support #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support @@ -223,7 +223,7 @@ device xe # Xircom pccard Ethernet #device ath # Atheros NIC's #device ath_pci # Atheros pci/cardbus glue #device ath_hal # pci/cardbus chip support -#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #device ath_rate_sample # SampleRate tx rate control for ath #device ral # Ralink Technology RT2500 wireless NICs. #device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 09:17:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3BFD106564A; Fri, 6 Jan 2012 09:17:34 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED7F8FC12; Fri, 6 Jan 2012 09:17: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 q069HY2o080896; Fri, 6 Jan 2012 09:17:34 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q069HYO1080894; Fri, 6 Jan 2012 09:17:34 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201060917.q069HYO1080894@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 6 Jan 2012 09:17: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: r229692 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 09:17:34 -0000 Author: jh Date: Fri Jan 6 09:17:34 2012 New Revision: 229692 URL: http://svn.freebsd.org/changeset/base/229692 Log: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Approved by: des MFC after: 2 weeks Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 08:51:20 2012 (r229691) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 09:17:34 2012 (r229692) @@ -891,7 +891,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error); From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 09:21:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C7D1065672; Fri, 6 Jan 2012 09:21:41 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 680FF8FC0A; Fri, 6 Jan 2012 09:21: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 q069LfGW081054; Fri, 6 Jan 2012 09:21:41 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q069Lfi8081051; Fri, 6 Jan 2012 09:21:41 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201060921.q069Lfi8081051@svn.freebsd.org> From: Andreas Tobler Date: Fri, 6 Jan 2012 09:21: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: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 09:21:41 -0000 Author: andreast Date: Fri Jan 6 09:21:40 2012 New Revision: 229693 URL: http://svn.freebsd.org/changeset/base/229693 Log: Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. Modified: head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc64/SYS.h Modified: head/lib/libc/powerpc/SYS.h ============================================================================== --- head/lib/libc/powerpc/SYS.h Fri Jan 6 09:17:34 2012 (r229692) +++ head/lib/libc/powerpc/SYS.h Fri Jan 6 09:21:40 2012 (r229693) @@ -44,10 +44,8 @@ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x); \ bso 2b @@ -55,8 +53,7 @@ ENTRY(__CONCAT(__sys_,x)); \ .text; \ .align 2; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) @@ -66,10 +63,8 @@ ENTRY(__CONCAT(__sys_,x)); \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ _SYSCALL(x); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Modified: head/lib/libc/powerpc64/SYS.h ============================================================================== --- head/lib/libc/powerpc64/SYS.h Fri Jan 6 09:17:34 2012 (r229692) +++ head/lib/libc/powerpc64/SYS.h Fri Jan 6 09:21:40 2012 (r229693) @@ -52,10 +52,8 @@ mtlr %r0; \ blr; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x); \ bso 2b @@ -63,8 +61,7 @@ ENTRY(__CONCAT(__sys_,x)); \ .text; \ .align 2; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x); \ bnslr; \ mflr %r0; \ @@ -81,10 +78,8 @@ ENTRY(__CONCAT(__sys_,x)); \ .text; \ .align 2; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ _SYSCALL(x); \ bnslr; \ \ From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 10:13:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C1A106566B; Fri, 6 Jan 2012 10:13:00 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26ABD8FC08; Fri, 6 Jan 2012 10:13: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 q06AD0EK082684; Fri, 6 Jan 2012 10:13:00 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06ACxxw082682; Fri, 6 Jan 2012 10:12:59 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201061012.q06ACxxw082682@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 6 Jan 2012 10:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229694 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 10:13:00 -0000 Author: jh Date: Fri Jan 6 10:12:59 2012 New Revision: 229694 URL: http://svn.freebsd.org/changeset/base/229694 Log: r222004 changed sbuf_finish() to not clear the buffer error status. As a consequence sbuf_len() will return -1 for buffers which had the error status set prior to sbuf_finish() call. This causes a problem in pfs_read() which purposely uses a fixed size sbuf to discard bytes which are not needed to fulfill the read request. Work around the problem by using the full buffer length when sbuf_finish() indicates an overflow. An overflowed sbuf with fixed size is always full. PR: kern/163076 Approved by: des MFC after: 2 weeks Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 09:21:40 2012 (r229693) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 10:12:59 2012 (r229694) @@ -630,14 +630,14 @@ pfs_read(struct vop_read_args *va) if (uio->uio_offset < 0 || uio->uio_resid < 0 || (offset = uio->uio_offset) != uio->uio_offset || (resid = uio->uio_resid) != uio->uio_resid || - (buflen = offset + resid + 1) < offset || buflen > INT_MAX) { + (buflen = offset + resid) < offset || buflen >= INT_MAX) { error = EINVAL; goto ret; } - if (buflen > MAXPHYS + 1) - buflen = MAXPHYS + 1; + if (buflen > MAXPHYS) + buflen = MAXPHYS; - sb = sbuf_new(sb, NULL, buflen, 0); + sb = sbuf_new(sb, NULL, buflen + 1, 0); if (sb == NULL) { error = EIO; goto ret; @@ -650,8 +650,14 @@ pfs_read(struct vop_read_args *va) goto ret; } - sbuf_finish(sb); - error = uiomove_frombuf(sbuf_data(sb), sbuf_len(sb), uio); + /* + * XXX: If the buffer overflowed, sbuf_len() will not return + * the data length. Then just use the full length because an + * overflowed sbuf must be full. + */ + if (sbuf_finish(sb) == 0) + buflen = sbuf_len(sb); + error = uiomove_frombuf(sbuf_data(sb), buflen, uio); sbuf_delete(sb); ret: vn_lock(vn, locked | LK_RETRY); From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 11:42:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCB2F106564A; Fri, 6 Jan 2012 11:42:03 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0DF8FC08; Fri, 6 Jan 2012 11:42: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 q06Bg32I087972; Fri, 6 Jan 2012 11:42:03 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06Bg37O087970; Fri, 6 Jan 2012 11:42:03 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201061142.q06Bg37O087970@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 6 Jan 2012 11:42: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: r229697 - head/sbin/recoverdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 11:42:03 -0000 Author: uqs Date: Fri Jan 6 11:42:03 2012 New Revision: 229697 URL: http://svn.freebsd.org/changeset/base/229697 Log: Fix mdoc date from previous commit. Modified: head/sbin/recoverdisk/recoverdisk.1 Modified: head/sbin/recoverdisk/recoverdisk.1 ============================================================================== --- head/sbin/recoverdisk/recoverdisk.1 Fri Jan 6 11:06:48 2012 (r229696) +++ head/sbin/recoverdisk/recoverdisk.1 Fri Jan 6 11:42:03 2012 (r229697) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 5, 2012 +.Dd January 5, 2012 .Dt RECOVERDISK 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 12:05:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CEBA1065675; Fri, 6 Jan 2012 12:05:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1858A8FC0A; Fri, 6 Jan 2012 12:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06C5hUK088770; Fri, 6 Jan 2012 12:05:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06C5hWn088768; Fri, 6 Jan 2012 12:05:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201061205.q06C5hWn088768@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 6 Jan 2012 12:05: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: r229698 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 12:05:44 -0000 Author: glebius Date: Fri Jan 6 12:05:43 2012 New Revision: 229698 URL: http://svn.freebsd.org/changeset/base/229698 Log: Since r228571 CARP is no longer an interface. Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Fri Jan 6 11:42:03 2012 (r229697) +++ head/sys/net/if_media.h Fri Jan 6 12:05:43 2012 (r229698) @@ -247,11 +247,6 @@ uint64_t ifmedia_baudrate(int); #define IFM_ATM_UNASSIGNED 0x00000400 /* unassigned cells */ /* - * CARP Common Address Redundancy Protocol - */ -#define IFM_CARP 0x000000c0 - -/* * Shared media sub-types */ #define IFM_AUTO 0 /* Autoselect best media */ @@ -337,7 +332,6 @@ struct ifmedia_description { { IFM_FDDI, "FDDI" }, \ { IFM_IEEE80211, "IEEE 802.11 Wireless Ethernet" }, \ { IFM_ATM, "ATM" }, \ - { IFM_CARP, "Common Address Redundancy Protocol" }, \ { 0, NULL }, \ } @@ -718,8 +712,6 @@ struct ifmedia_status_description { { "no network", "active" } }, \ { IFM_ATM, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ - { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ - { "backup", "master" } }, \ { 0, 0, 0, \ { NULL, NULL } } \ } From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 12:27:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 830DF106566C; Fri, 6 Jan 2012 12:27:18 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DFAB8FC15; Fri, 6 Jan 2012 12:27: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 q06CRIOO089550; Fri, 6 Jan 2012 12:27:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06CRICP089547; Fri, 6 Jan 2012 12:27:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201061227.q06CRICP089547@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 6 Jan 2012 12:27: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: r229699 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 12:27:18 -0000 Author: pjd Date: Fri Jan 6 12:27:17 2012 New Revision: 229699 URL: http://svn.freebsd.org/changeset/base/229699 Log: Constify argument. MFC after: 3 days Modified: head/sbin/hastd/subr.c head/sbin/hastd/subr.h Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Fri Jan 6 12:05:43 2012 (r229698) +++ head/sbin/hastd/subr.c Fri Jan 6 12:27:17 2012 (r229699) @@ -149,7 +149,7 @@ role2str(int role) } int -drop_privs(struct hast_resource *res) +drop_privs(const struct hast_resource *res) { char jailhost[sizeof(res->hr_name) * 2]; struct jail jailst; Modified: head/sbin/hastd/subr.h ============================================================================== --- head/sbin/hastd/subr.h Fri Jan 6 12:05:43 2012 (r229698) +++ head/sbin/hastd/subr.h Fri Jan 6 12:27:17 2012 (r229699) @@ -51,6 +51,6 @@ int snprlcat(char *str, size_t size, con int provinfo(struct hast_resource *res, bool dowrite); const char *role2str(int role); -int drop_privs(struct hast_resource *res); +int drop_privs(const struct hast_resource *res); #endif /* !_SUBR_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 12:49:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD9691065670; Fri, 6 Jan 2012 12:49:01 +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 A890C8FC18; Fri, 6 Jan 2012 12:49:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06Cn1UI090245; Fri, 6 Jan 2012 12:49:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06Cn1Uh090243; Fri, 6 Jan 2012 12:49:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201061249.q06Cn1Uh090243@svn.freebsd.org> From: John Baldwin Date: Fri, 6 Jan 2012 12:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229700 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 12:49:01 -0000 Author: jhb Date: Fri Jan 6 12:49:01 2012 New Revision: 229700 URL: http://svn.freebsd.org/changeset/base/229700 Log: Tweak the last fix to match what was actually tested. Pointy hat to: jhb Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri Jan 6 12:27:17 2012 (r229699) +++ head/sys/netinet/tcp_timewait.c Fri Jan 6 12:49:01 2012 (r229700) @@ -242,7 +242,7 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - if (SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt)) + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; else tw->last_win = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 12:49:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8387B106564A; Fri, 6 Jan 2012 12:49:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5122C8FC0C; Fri, 6 Jan 2012 12:49:41 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E4CA846B0A; Fri, 6 Jan 2012 07:49:40 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 76244B960; Fri, 6 Jan 2012 07:49:40 -0500 (EST) From: John Baldwin To: Sergey Kandaurov Date: Fri, 6 Jan 2012 07:49:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201201052229.q05MTBMf059184@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Message-Id: <201201060749.39680.jhb@freebsd.org> Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 06 Jan 2012 07:49:40 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229665 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 12:49:41 -0000 On Thursday, January 05, 2012 7:19:29 pm Sergey Kandaurov wrote: > Hi, Looks like a typo there: > /usr/src/sys/netinet/tcp_timewait.c: In function 'tcp_twstart': > /usr/src/sys/netinet/tcp_timewait.c:245: warning: implicit declaration > of function 'SEQ_GE' > /usr/src/sys/netinet/tcp_timewait.c:245: warning: nested extern > declaration of 'SEQ_GE' [-Wnested-externs] Yeah, it was supposed to be SEQ_GT (which is what it was in the testing patch I had sent out that was derived from the patch I committed). Thanks for fixing my breakage. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 13:12:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB70106566C; Fri, 6 Jan 2012 13:12:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 01F838FC0C; Fri, 6 Jan 2012 13:12:09 +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 mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q06DC6ZH029458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 7 Jan 2012 00:12:07 +1100 Date: Sat, 7 Jan 2012 00:12:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <201201060921.q069Lfi8081051@svn.freebsd.org> Message-ID: <20120106225728.G9027@besplex.bde.org> References: <201201060921.q069Lfi8081051@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 13:12:10 -0000 On Fri, 6 Jan 2012, Andreas Tobler wrote: > Log: > Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. This API should be fixed before using it extensively. It has the args reversed relative to the C API __weak_reference(). Also, its name is different, and the spelling of "=" in its implementation is different. Perhaps the arg order makes sense for both, since for WEAK_ALIAS() the alias is the first arg, while for __weak_reference() the symbol being referred to to create the alias is the first arg. But this is still confusing. The easiest way to fix this is to remove WEAK_ALIAS() and add an asm API WEAK_REFERENCE(). Unfortunately, ALIAS is a better name than REFERENCE. __weak_reference() is not so easy to change since it is used extensively Similarly for STRONG_ALIAS() and __strong_reference(), except STRONG_REFERENCE() doesn't exist for most arches and __strong_reference() didn't exist until this week, so neither is used extensively. More details on current existence and use of these: In the kernel, WEAK_ALIAS is not defined for amd64 or sparc64, and is never used. In libc, WEAK_ALIAS was only used for arm, ia64 and mips. Now it is used for some i386 string functions. In the kernel, STRONG_ALIAS was only defined for mips, and was never used. Now it is also defined for i386, and is never used. In libc, STRONG_ALIAS was not used. It was used for a few days in some i386 string functions. This was a bug. Now WEAK_ALIAS is used instead, and STRONG_ALIAS is not used again. It is another bug that these "optimized" i386 string functions (strchr/index and strrchr/rindex) even exist. amd64 doesn't have them. The MI versions are not very optimal, but neither are the i386 ones. > Modified: head/lib/libc/powerpc/SYS.h > ============================================================================== > --- head/lib/libc/powerpc/SYS.h Fri Jan 6 09:17:34 2012 (r229692) > +++ head/lib/libc/powerpc/SYS.h Fri Jan 6 09:21:40 2012 (r229693) > @@ -44,10 +44,8 @@ > .align 2; \ > 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ > ENTRY(__CONCAT(__sys_,x)); \ > - .weak CNAME(x); \ > - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ > - .weak CNAME(__CONCAT(_,x)); \ > - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ > + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ > + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ > _SYSCALL(x); \ > bso 2b > The style bugs in this should be fixed someday. This is still messed up to support K&R. With ancient cpp's, you had to write __CONCAT(x,y) instead of __CONCAT(x, y) to avoid getting a space between x and y. This was fixed in Standard C 22 years ago, but all SYS.h files in libc except ia64's one still use the ugly __CONCAT(x,y) in most places. ia64 hard-codes __CONCAT(x, y) as x ## y instead. The missing space after the comma for the WEAK_ALIAS() parameters is even less necessary. For ancient cpp's, it allowed WEAK_ALIAS to format the asm directives without a space. With STDC cpp's, the formatting is controlled by the macro, but it is still hard to produce nice formatting because cpp may change whitespace. __weak_reference() also difference from WEAK_ALIAS() in the spelling of "=". It uses ".equ". ".set" in the all the SYS.h's except ia64 and mips (*) seems to be yet another spelling. (*) ia64 avoids the hard coded directive using WEAK_ALIAS(). mips hard-codes "=" instead of ".set". Some other gratuitous differences in the SYS.h's: - arm and mips use _C_LABEL() instead of CNAME() - ia64 doesn't use either _C_LABEL() or CNAME() - arm, ia64 and mips don't use HIDENAME() for cerror: - arm uses CERROR and hard-codes this as _C_LABEL(cerror) - ia64 hard-codes it as .cerror - mips hard-codes it as __cerror. - sparc64 doesn't use ENTRY() or END() and has to repeat things like .type and .size found in those when it defines _SYSENTRY() and _SYSEND(). It doesn't use CNAME() in these definitions. Underscores in these names are bogus, since these names are even less public than ENTRY() and END() which don't have them. Some of these differences may be due to FreeBSD's cleaning up or down of the decomposition of SYS.h and only for older arches. Both of these files are MD so you can hard-code things in either, but I think it is best put as much of the details as possible in the lowest level, which is . Using WEAK_ALIAS() from there is a step in this direction. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 14:00:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 869711065673; Fri, 6 Jan 2012 14:00:32 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71BAE8FC19; Fri, 6 Jan 2012 14:00: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 q06E0W6N092467; Fri, 6 Jan 2012 14:00:32 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06E0W0g092465; Fri, 6 Jan 2012 14:00:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201061400.q06E0W0g092465@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 6 Jan 2012 14:00: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: r229701 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 14:00:32 -0000 Author: pjd Date: Fri Jan 6 14:00:31 2012 New Revision: 229701 URL: http://svn.freebsd.org/changeset/base/229701 Log: Add 'nojail' keyword as auditd(8) can't really do anything useful when inside a jail. Discussed with: rwatson MFC after: 1 week Modified: head/etc/rc.d/auditd Modified: head/etc/rc.d/auditd ============================================================================== --- head/etc/rc.d/auditd Fri Jan 6 12:49:01 2012 (r229700) +++ head/etc/rc.d/auditd Fri Jan 6 14:00:31 2012 (r229701) @@ -8,7 +8,7 @@ # PROVIDE: auditd # REQUIRE: syslogd # BEFORE: DAEMON -# KEYWORD: shutdown +# KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 15:01:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8931E106574C; Fri, 6 Jan 2012 15:01:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 599ED8FC0A; Fri, 6 Jan 2012 15:01:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06F16Hr094601; Fri, 6 Jan 2012 15:01:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06F16UK094599; Fri, 6 Jan 2012 15:01:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201061501.q06F16UK094599@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 6 Jan 2012 15:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229702 - head/sbin/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 15:01:06 -0000 Author: glebius Date: Fri Jan 6 15:01:05 2012 New Revision: 229702 URL: http://svn.freebsd.org/changeset/base/229702 Log: Fix build. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Fri Jan 6 14:00:31 2012 (r229701) +++ head/sbin/devd/devd.cc Fri Jan 6 15:01:05 2012 (r229702) @@ -298,7 +298,6 @@ media::media(config &, const char *var, { IFM_FDDI, "FDDI" }, { IFM_IEEE80211, "802.11" }, { IFM_ATM, "ATM" }, - { IFM_CARP, "CARP" }, { -1, "unknown" }, { 0, NULL }, }; From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 16:20:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42CC5106564A; Fri, 6 Jan 2012 16:20:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD2518FC08; Fri, 6 Jan 2012 16:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06GKHZA097123; Fri, 6 Jan 2012 16:20:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06GKHx3097121; Fri, 6 Jan 2012 16:20:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201061620.q06GKHx3097121@svn.freebsd.org> From: Ed Schouten Date: Fri, 6 Jan 2012 16:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229704 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 16:20:18 -0000 Author: ed Date: Fri Jan 6 16:20:17 2012 New Revision: 229704 URL: http://svn.freebsd.org/changeset/base/229704 Log: Add an even faster implementation of for the future. Instead of using an exponential number of cases with respect to the number of arguments, this version only uses a linear number. Unfortunately, it works with Clang, GCC 4.6 and GCC 4.7, but not GCC 4.2. Therefore, leave it commented out. Modified: head/include/tgmath.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Fri Jan 6 15:07:28 2012 (r229703) +++ head/include/tgmath.h Fri Jan 6 16:20:17 2012 (r229704) @@ -59,6 +59,25 @@ #error " not implemented for this compiler" #endif +#if 0 /* XXX: Much shorter and faster to compile, but broken with GCC 4.2. */ +#define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ + __generic(x, long double _Complex, cfnl, \ + __generic(x, double _Complex, cfn, \ + __generic(x, float _Complex, cfnf, \ + __generic(x, long double, fnl, \ + __generic(x, float, fnf, fn))))) +#define __tg_type(x) \ + __tg_generic(x, (long double _Complex)0, (double _Complex)0, \ + (float _Complex)0, (long double)0, (double)0, (float)0) +#define __tg_impl_simple(x, y, z, fnl, fn, fnf, ...) \ + __tg_generic( \ + __tg_type(x) + __tg_type(y) + __tg_type(z), \ + fnl, fn, fnf, fnl, fn, fnf)(__VA_ARGS__) +#define __tg_impl_full(x, y, cfnl, cfn, cfnf, fnl, fn, fnf, ...) \ + __tg_generic( \ + __tg_type(x) + __tg_type(y), \ + cfnl, cfn, cfnf, fnl, fn, fnf)(__VA_ARGS__) +#else #define __tg_generic_simple(x, fnl, fn, fnf) \ __generic(x, long double _Complex, fnl, \ __generic(x, double _Complex, fn, \ @@ -94,6 +113,7 @@ __tg_generic_full(y, cfnl, cfn , cfn , fnl , fn , fn ), \ __tg_generic_full(y, cfnl, cfn , cfnf, fnl , fn , fnf )) \ (__VA_ARGS__) +#endif /* Macros to save lots of repetition below */ #define __tg_simple(x, fn) \ From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 16:49:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 115D9106566C; Fri, 6 Jan 2012 16:49:43 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id B24E48FC0A; Fri, 6 Jan 2012 16:49:42 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q06GIZ6Q082629; Fri, 6 Jan 2012 10:18:35 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q06GISoB025557 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 6 Jan 2012 10:18:29 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q06GISoB025557 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1325866709; bh=z80dQqAsFwu1h1Oef0Tdj448kXHNT7n3RD3NFoWx+tg=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=jaT3RBvb69BYSuoZo0y8c/Udd9CRc3nYbWSc7IjXgjFuwEr/EH8k6PWtCVMqKNM0o 8ak0mKngNweTS0RvGJfmGBnH15IDuph+Me/MJf/gBeBqA6Xa1eQiyFUDTafJJKhGHj gcDnyJOgqh9CdfUcK3O8Xpio97lAGSjc0cXQjtPk= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Guy Helmer In-Reply-To: <4F066340.9010507@FreeBSD.org> Date: Fri, 6 Jan 2012 10:18:29 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Fri, 06 Jan 2012 10:18:29 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q06GISoB025557 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 16:49:43 -0000 On Jan 5, 2012, at 8:58 PM, Doug Barton wrote: > On 01/05/2012 14:48, Guy Helmer wrote: >> Allow daemon(8) to run pidfile_open() before relenquishing = privileges >> so pid files can be written in /var/run when started as root. >=20 > I'm not sure how useful this is since when daemon is exiting it won't = be > able to remove the pid file (unless I'm missing something). >=20 > Isn't it better to pre-create the pid file with the proper permissions > for the unprivileged user? >=20 Would it be OK for daemon to hang around and wait for the child process = to exit, then remove the pid file? The only other alternative I see would be to create a subdirectory that = is writable by the user so the child can create and delete the pid file. Guy= -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 18:29:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63CD61065735; Fri, 6 Jan 2012 18:29:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB3F8FC17; Fri, 6 Jan 2012 18:29: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 q06ITfFY001843; Fri, 6 Jan 2012 18:29:41 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06ITfP0001841; Fri, 6 Jan 2012 18:29:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201201061829.q06ITfP0001841@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 6 Jan 2012 18:29: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: r229714 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 18:29:41 -0000 Author: np Date: Fri Jan 6 18:29:40 2012 New Revision: 229714 URL: http://svn.freebsd.org/changeset/base/229714 Log: Always release the inp lock before returning from tcp_detach. MFC after: 5 days Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:18:25 2012 (r229713) +++ head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:29:40 2012 (r229714) @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp tcp_discardcb(tp); in_pcbdetach(inp); in_pcbfree(inp); - } else + } else { in_pcbdetach(inp); + INP_WUNLOCK(inp); + } } } From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 18:37:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46516106566B; Fri, 6 Jan 2012 18:37:50 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30B258FC14; Fri, 6 Jan 2012 18:37:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06Ibonw002140; Fri, 6 Jan 2012 18:37:50 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06IbnKk002138; Fri, 6 Jan 2012 18:37:49 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201061837.q06IbnKk002138@svn.freebsd.org> From: Andreas Tobler Date: Fri, 6 Jan 2012 18:37: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: r229715 - head/contrib/gcc/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 18:37:50 -0000 Author: andreast Date: Fri Jan 6 18:37:49 2012 New Revision: 229715 URL: http://svn.freebsd.org/changeset/base/229715 Log: Silence a warning about redefinition of TARGET_ELF on powerpc. Modified: head/contrib/gcc/config/freebsd.h Modified: head/contrib/gcc/config/freebsd.h ============================================================================== --- head/contrib/gcc/config/freebsd.h Fri Jan 6 18:29:40 2012 (r229714) +++ head/contrib/gcc/config/freebsd.h Fri Jan 6 18:37:49 2012 (r229715) @@ -63,6 +63,7 @@ Boston, MA 02110-1301, USA. */ /* All FreeBSD Architectures support the ELF object file format. */ #undef OBJECT_FORMAT_ELF #define OBJECT_FORMAT_ELF 1 +#undef TARGET_ELF #define TARGET_ELF 1 /* Don't assume anything about the header files. */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 19:04:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAC531065675; Fri, 6 Jan 2012 19:04:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6DA8FC0C; Fri, 6 Jan 2012 19:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06J4xGY003068; Fri, 6 Jan 2012 19:04:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06J4xCE003066; Fri, 6 Jan 2012 19:04:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201061904.q06J4xCE003066@svn.freebsd.org> From: Ed Schouten Date: Fri, 6 Jan 2012 19:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229716 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 19:04:59 -0000 Author: ed Date: Fri Jan 6 19:04:59 2012 New Revision: 229716 URL: http://svn.freebsd.org/changeset/base/229716 Log: Last attempt at : do enable the new code for C11 compilers. I was thinking by myself, if the new code doesn't work with GCC 4.2, why not simply turn it into an efficient version for C11 compilers? By changing the code to use _Generic() directly in that case, I can build the tgmath regression test in a matter of milliseconds with Clang, instead of the 8 seconds it used to take. So by the time C11 becomes the default, it will pick up the new code automatically. And now I will refrain from making more changes to . Modified: head/include/tgmath.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Fri Jan 6 18:37:49 2012 (r229715) +++ head/include/tgmath.h Fri Jan 6 19:04:59 2012 (r229716) @@ -53,19 +53,23 @@ * Note that these macros cannot be implemented with C's ?: operator, * because the return type of the whole expression would incorrectly be long * double complex regardless of the argument types. + * + * The structure of the C11 implementation of these macros can in + * principle be reused for non-C11 compilers, but due to an integer + * promotion bug for complex types in GCC 4.2, simply let non-C11 + * compilers use an inefficient yet reliable version. */ -#ifndef __generic -#error " not implemented for this compiler" -#endif - -#if 0 /* XXX: Much shorter and faster to compile, but broken with GCC 4.2. */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ - __generic(x, long double _Complex, cfnl, \ - __generic(x, double _Complex, cfn, \ - __generic(x, float _Complex, cfnf, \ - __generic(x, long double, fnl, \ - __generic(x, float, fnf, fn))))) + _Generic(x, \ + long double _Complex: cfnl, \ + double _Complex: cfn, \ + float _Complex: cfnf, \ + long double: fnl, \ + default: fn, \ + float: fnf \ + ) #define __tg_type(x) \ __tg_generic(x, (long double _Complex)0, (double _Complex)0, \ (float _Complex)0, (long double)0, (double)0, (float)0) @@ -77,7 +81,7 @@ __tg_generic( \ __tg_type(x) + __tg_type(y), \ cfnl, cfn, cfnf, fnl, fn, fnf)(__VA_ARGS__) -#else +#elif defined(__generic) #define __tg_generic_simple(x, fnl, fn, fnf) \ __generic(x, long double _Complex, fnl, \ __generic(x, double _Complex, fn, \ @@ -113,6 +117,8 @@ __tg_generic_full(y, cfnl, cfn , cfn , fnl , fn , fn ), \ __tg_generic_full(y, cfnl, cfn , cfnf, fnl , fn , fnf )) \ (__VA_ARGS__) +#else +#error " not implemented for this compiler" #endif /* Macros to save lots of repetition below */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 19:05:16 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E44651065670; Fri, 6 Jan 2012 19:05:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 63C9F8FC1A; Fri, 6 Jan 2012 19:05:16 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q06J5FAN064919; Fri, 6 Jan 2012 23:05:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q06J5FAc064918; Fri, 6 Jan 2012 23:05:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 6 Jan 2012 23:05:15 +0400 From: Gleb Smirnoff To: Navdeep Parhar Message-ID: <20120106190515.GU34721@FreeBSD.org> References: <201201061829.q06ITfP0001841@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201201061829.q06ITfP0001841@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: r229714 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 19:05:17 -0000 Navdeep, On Fri, Jan 06, 2012 at 06:29:41PM +0000, Navdeep Parhar wrote: N> Author: np N> Date: Fri Jan 6 18:29:40 2012 N> New Revision: 229714 N> URL: http://svn.freebsd.org/changeset/base/229714 N> N> Log: N> Always release the inp lock before returning from tcp_detach. ^ after ? N> Modified: N> head/sys/netinet/tcp_usrreq.c N> N> Modified: head/sys/netinet/tcp_usrreq.c N> ============================================================================== N> --- head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:18:25 2012 (r229713) N> +++ head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:29:40 2012 (r229714) N> @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp N> tcp_discardcb(tp); N> in_pcbdetach(inp); N> in_pcbfree(inp); N> - } else N> + } else { N> in_pcbdetach(inp); N> + INP_WUNLOCK(inp); N> + } N> } N> } N> -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 19:19:57 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1205) id 99D1F106567B; Fri, 6 Jan 2012 19:19:57 +0000 (UTC) Date: Fri, 6 Jan 2012 19:19:57 +0000 From: Navdeep Parhar To: Gleb Smirnoff Message-ID: <20120106191957.GA58317@hub.freebsd.org> Mail-Followup-To: Gleb Smirnoff , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201201061829.q06ITfP0001841@svn.freebsd.org> <20120106190515.GU34721@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120106190515.GU34721@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: r229714 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 19:19:57 -0000 On Fri, Jan 06, 2012 at 11:05:15PM +0400, Gleb Smirnoff wrote: > Navdeep, > > On Fri, Jan 06, 2012 at 06:29:41PM +0000, Navdeep Parhar wrote: > N> Author: np > N> Date: Fri Jan 6 18:29:40 2012 > N> New Revision: 229714 > N> URL: http://svn.freebsd.org/changeset/base/229714 > N> > N> Log: > N> Always release the inp lock before returning from tcp_detach. > ^ after ? I don't see anything wrong in the message. The lock is released within tcp_detach (before it returns), and not after. Navdeep > > N> Modified: > N> head/sys/netinet/tcp_usrreq.c > N> > N> Modified: head/sys/netinet/tcp_usrreq.c > N> ============================================================================== > N> --- head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:18:25 2012 (r229713) > N> +++ head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:29:40 2012 (r229714) > N> @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp > N> tcp_discardcb(tp); > N> in_pcbdetach(inp); > N> in_pcbfree(inp); > N> - } else > N> + } else { > N> in_pcbdetach(inp); > N> + INP_WUNLOCK(inp); > N> + } > N> } > N> } > N> > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 19:42:50 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AF9E106568A; Fri, 6 Jan 2012 19:42:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id C6D318FC1B; Fri, 6 Jan 2012 19:42:49 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q06Jgmei065154; Fri, 6 Jan 2012 23:42:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q06Jgmaa065153; Fri, 6 Jan 2012 23:42:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 6 Jan 2012 23:42:48 +0400 From: Gleb Smirnoff To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20120106194248.GV34721@FreeBSD.org> References: <201201061829.q06ITfP0001841@svn.freebsd.org> <20120106190515.GU34721@FreeBSD.org> <20120106191957.GA58317@hub.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120106191957.GA58317@hub.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r229714 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 19:42:50 -0000 On Fri, Jan 06, 2012 at 07:19:57PM +0000, Navdeep Parhar wrote: N> On Fri, Jan 06, 2012 at 11:05:15PM +0400, Gleb Smirnoff wrote: N> > Navdeep, N> > N> > On Fri, Jan 06, 2012 at 06:29:41PM +0000, Navdeep Parhar wrote: N> > N> Author: np N> > N> Date: Fri Jan 6 18:29:40 2012 N> > N> New Revision: 229714 N> > N> URL: http://svn.freebsd.org/changeset/base/229714 N> > N> N> > N> Log: N> > N> Always release the inp lock before returning from tcp_detach. N> > ^ after ? N> N> I don't see anything wrong in the message. The lock is released within N> tcp_detach (before it returns), and not after. Ah, sorry. My braino :( -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 19:59:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCC9106564A; Fri, 6 Jan 2012 19:59:28 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 02DA98FC08; Fri, 6 Jan 2012 19:59:27 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q06Jt8KJ028608; Fri, 6 Jan 2012 20:55:10 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F07529B.2060608@FreeBSD.org> Date: Fri, 06 Jan 2012 20:59:23 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Bruce Evans References: <201201060921.q069Lfi8081051@svn.freebsd.org> <20120106225728.G9027@besplex.bde.org> In-Reply-To: <20120106225728.G9027@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 19:59:28 -0000 Hi Bruce, thank you for the feedback. I wasn't aware about the fine details. I try to understand and implement what you suggest. It may take several iterations until I match everything. On 06.01.12 14:12, Bruce Evans wrote: > On Fri, 6 Jan 2012, Andreas Tobler wrote: > >> Log: >> Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. > > This API should be fixed before using it extensively. It has the args > reversed relative to the C API __weak_reference(). Also, its name is > different, and the spelling of "=" in its implementation is different. > Perhaps the arg order makes sense for both, since for WEAK_ALIAS() the > alias is the first arg, while for __weak_reference() the symbol being > referred to to create the alias is the first arg. But this is still > confusing. > > The easiest way to fix this is to remove WEAK_ALIAS() and add an asm > API WEAK_REFERENCE(). Unfortunately, ALIAS is a better name than > REFERENCE. __weak_reference() is not so easy to change since it is > used extensively So, I started with a WEAK_REFERENCE macro in sys/powerpc/asm.h It is like the WEAK_ALIAS but with reversed arguments: +#define WEAK_REFERENCE(sym, alias) \ + .weak alias; \ + alias = sym + Here I do not have a preference for the "=" implementation, is it "=" or is it .set ..... If we find a final version I'll be able to delete the WEAK_ALIAS. > Similarly for STRONG_ALIAS() and __strong_reference(), except > STRONG_REFERENCE() doesn't exist for most arches and __strong_reference() > didn't exist until this week, so neither is used extensively. > > More details on current existence and use of these: > > In the kernel, WEAK_ALIAS is not defined for amd64 or sparc64, and is > never used. > > In libc, WEAK_ALIAS was only used for arm, ia64 and mips. Now it is used > for some i386 string functions. > > In the kernel, STRONG_ALIAS was only defined for mips, and was never used. > Now it is also defined for i386, and is never used. > > In libc, STRONG_ALIAS was not used. It was used for a few days in some > i386 string functions. This was a bug. Now WEAK_ALIAS is used instead, > and STRONG_ALIAS is not used again. It is another bug that these > "optimized" i386 string functions (strchr/index and strrchr/rindex) even > exist. amd64 doesn't have them. The MI versions are not very optimal, > but neither are the i386 ones. > >> Modified: head/lib/libc/powerpc/SYS.h >> ============================================================================== >> --- head/lib/libc/powerpc/SYS.h Fri Jan 6 09:17:34 2012 (r229692) >> +++ head/lib/libc/powerpc/SYS.h Fri Jan 6 09:21:40 2012 (r229693) >> @@ -44,10 +44,8 @@ >> .align 2; \ >> 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ >> ENTRY(__CONCAT(__sys_,x)); \ >> - .weak CNAME(x); \ >> - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ >> - .weak CNAME(__CONCAT(_,x)); \ >> - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ >> + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ >> + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ >> _SYSCALL(x); \ >> bso 2b >> > > The style bugs in this should be fixed someday. This is still messed up > to support K&R. With ancient cpp's, you had to write __CONCAT(x,y) instead > of __CONCAT(x, y) to avoid getting a space between x and y. This was fixed > in Standard C 22 years ago, but all SYS.h files in libc except ia64's one > still use the ugly __CONCAT(x,y) in most places. ia64 hard-codes > __CONCAT(x, y) as x ## y instead. > > The missing space after the comma for the WEAK_ALIAS() parameters is even > less necessary. For ancient cpp's, it allowed WEAK_ALIAS to format the > asm directives without a space. With STDC cpp's, the formatting is > controlled by the macro, but it is still hard to produce nice formatting > because cpp may change whitespace. If I get the above right, the snippet from above should look like this, right? @@ -51,20 +51,17 @@ ld %r0,16(%r1); \ mtlr %r0; \ blr; \ -ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ +ENTRY(__CONCAT(__sys_, x)); \ + WEAK_REFERENCE(__CONCAT(__sys_, x), x); \ + WEAK_REFERENCE(__CONCAT(__sys_, x), __CONCAT(_, x)); \ _SYSCALL(x); \ bso 2b > > __weak_reference() also difference from WEAK_ALIAS() in the spelling > of "=". It uses ".equ". ".set" in the all the SYS.h's except ia64 and > mips (*) seems to be yet another spelling. > > (*) ia64 avoids the hard coded directive using WEAK_ALIAS(). mips > hard-codes "=" instead of ".set". > > Some other gratuitous differences in the SYS.h's: > - arm and mips use _C_LABEL() instead of CNAME() > - ia64 doesn't use either _C_LABEL() or CNAME() > - arm, ia64 and mips don't use HIDENAME() for cerror: > - arm uses CERROR and hard-codes this as _C_LABEL(cerror) > - ia64 hard-codes it as .cerror > - mips hard-codes it as __cerror. > - sparc64 doesn't use ENTRY() or END() and has to repeat things like .type > and .size found in those when it defines _SYSENTRY() and _SYSEND(). > It doesn't use CNAME() in these definitions. Underscores in these > names are bogus, since these names are even less public than ENTRY() > and END() which don't have them. > > Some of these differences may be due to FreeBSD's cleaning up or down > of the decomposition of SYS.h and only for older arches. > Both of these files are MD so you can hard-code things in either, but > I think it is best put as much of the details as possible in the lowest > level, which is. Using WEAK_ALIAS() from there is a > step in this direction. If we want to stay with WEAK_ALIAS I can at least fix the style bugs. Thanks, Andreas From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 20:05:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C62D21065678; Fri, 6 Jan 2012 20:05: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 B52A08FC0C; Fri, 6 Jan 2012 20:05: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 q06K5mNY005774; Fri, 6 Jan 2012 20:05:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06K5mTI005772; Fri, 6 Jan 2012 20:05:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201062005.q06K5mTI005772@svn.freebsd.org> From: John Baldwin Date: Fri, 6 Jan 2012 20:05: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: r229727 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 20:05:48 -0000 Author: jhb Date: Fri Jan 6 20:05:48 2012 New Revision: 229727 URL: http://svn.freebsd.org/changeset/base/229727 Log: Use proper argument structure types for the extattr post-VOP hooks. The wrong structure happened to work since the only argument used was the vnode which is in the same place in both VOP_SETATTR() and the two extattr VOPs. MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jan 6 19:33:27 2012 (r229726) +++ head/sys/kern/vfs_subr.c Fri Jan 6 20:05:48 2012 (r229727) @@ -4035,7 +4035,7 @@ vop_create_post(void *ap, int rc) void vop_deleteextattr_post(void *ap, int rc) { - struct vop_setattr_args *a = ap; + struct vop_deleteextattr_args *a = ap; if (!rc) VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); @@ -4125,7 +4125,7 @@ vop_setattr_post(void *ap, int rc) void vop_setextattr_post(void *ap, int rc) { - struct vop_setattr_args *a = ap; + struct vop_setextattr_args *a = ap; if (!rc) VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 20:06:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AC4106564A; Fri, 6 Jan 2012 20:06:45 +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 4FDD38FC13; Fri, 6 Jan 2012 20:06:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06K6j3E005838; Fri, 6 Jan 2012 20:06:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06K6j7W005836; Fri, 6 Jan 2012 20:06:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201062006.q06K6j7W005836@svn.freebsd.org> From: John Baldwin Date: Fri, 6 Jan 2012 20:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229728 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 20:06:45 -0000 Author: jhb Date: Fri Jan 6 20:06:45 2012 New Revision: 229728 URL: http://svn.freebsd.org/changeset/base/229728 Log: Add 5 spare VOPs as placeholders to avoid breaking the KBI in the future when new VOPs are MFC'd to a branch. Reviewed by: kib, bz MFC after: 3 days Modified: head/sys/kern/vnode_if.src Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Jan 6 20:05:48 2012 (r229727) +++ head/sys/kern/vnode_if.src Fri Jan 6 20:06:45 2012 (r229728) @@ -50,7 +50,7 @@ # X: locked if not nil. # # The paramater named "vpp" is assumed to be always used with double -# indirection (**vpp) and that name is hard-codeed in vnode_if.awk ! +# indirection (**vpp) and that name is hard-coded in vnode_if.awk ! # # Lines starting with %! specify a pre or post-condition function # to call before/after the vop call. @@ -639,3 +639,28 @@ vop_advise { IN off_t end; IN int advice; }; + +# The VOPs below are spares at the end of the table to allow new VOPs to be +# added in stable branches without breaking the KBI. New VOPs in HEAD should +# be added above these spares. When merging a new VOP to a stable branch, +# the new VOP should replace one of the spares. + +vop_spare1 { + IN struct vnode *vp; +}; + +vop_spare2 { + IN struct vnode *vp; +}; + +vop_spare3 { + IN struct vnode *vp; +}; + +vop_spare4 { + IN struct vnode *vp; +}; + +vop_spare5 { + IN struct vnode *vp; +}; From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 20:21:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29261106566B; Fri, 6 Jan 2012 20:20:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D24468FC14; Fri, 6 Jan 2012 20:20: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 q06KKxsX006358; Fri, 6 Jan 2012 20:20:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06KKxjx006356; Fri, 6 Jan 2012 20:20:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201062020.q06KKxjx006356@svn.freebsd.org> From: Michael Tuexen Date: Fri, 6 Jan 2012 20:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229729 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 20:21:00 -0000 Author: tuexen Date: Fri Jan 6 20:20:59 2012 New Revision: 229729 URL: http://svn.freebsd.org/changeset/base/229729 Log: Use NULL instead of 0. MFC after: 1 month. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Jan 6 20:06:45 2012 (r229728) +++ head/sys/netinet/sctputil.c Fri Jan 6 20:20:59 2012 (r229729) @@ -1460,7 +1460,7 @@ sctp_timeout_handler(void *t) type = tmr->type; if (inp) { SCTP_INP_INCR_REF(inp); - if ((inp->sctp_socket == 0) && + if ((inp->sctp_socket == NULL) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && (tmr->type != SCTP_TIMER_TYPE_INIT) && (tmr->type != SCTP_TIMER_TYPE_SEND) && From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 21:28:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76101106567D; Fri, 6 Jan 2012 21:28:30 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFD808FC12; Fri, 6 Jan 2012 21:28: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 q06LSTLx008887; Fri, 6 Jan 2012 21:28:29 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06LSTON008885; Fri, 6 Jan 2012 21:28:29 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201062128.q06LSTON008885@svn.freebsd.org> From: Guy Helmer Date: Fri, 6 Jan 2012 21:28: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: r229735 - head/lib/libdevstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 21:28:30 -0000 Author: ghelmer Date: Fri Jan 6 21:28:29 2012 New Revision: 229735 URL: http://svn.freebsd.org/changeset/base/229735 Log: Handle memory allocation failures in devstat_getdevs(), devstat_selectdevs(), and devstat_buildmatch(). PR: bin/83359 Reviewed by: ken Modified: head/lib/libdevstat/devstat.c Modified: head/lib/libdevstat/devstat.c ============================================================================== --- head/lib/libdevstat/devstat.c Fri Jan 6 21:23:00 2012 (r229734) +++ head/lib/libdevstat/devstat.c Fri Jan 6 21:28:29 2012 (r229735) @@ -365,6 +365,12 @@ devstat_getdevs(kvm_t *kd, struct statin dssize = (dinfo->numdevs * sizeof(struct devstat)) + sizeof(long); dinfo->mem_ptr = (u_int8_t *)malloc(dssize); + if (dinfo->mem_ptr == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), + "%s: Cannot allocate memory for mem_ptr element", + __func__); + return(-1); + } } else dssize = (dinfo->numdevs * sizeof(struct devstat)) + sizeof(long); @@ -567,7 +573,7 @@ devstat_selectdevs(struct device_selecti * either enlarge or reduce the size of the device selection list. */ } else if (*num_selections != numdevs) { - *dev_select = (struct device_selection *)realloc(*dev_select, + *dev_select = (struct device_selection *)reallocf(*dev_select, numdevs * sizeof(struct device_selection)); *select_generation = current_generation; init_selections = 1; @@ -581,6 +587,13 @@ devstat_selectdevs(struct device_selecti init_selections = 1; } + if (*dev_select == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), + "%s: Cannot (re)allocate memory for dev_select argument", + __func__); + return(-1); + } + /* * If we're in "only" mode, we want to clear out the selected * variable since we're going to select exactly what the user wants @@ -608,6 +621,12 @@ devstat_selectdevs(struct device_selecti || (perf_select != 0)) && (changed == 0)){ old_dev_select = (struct device_selection *)malloc( *num_selections * sizeof(struct device_selection)); + if (old_dev_select == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), + "%s: Cannot allocate memory for selection list backup", + __func__); + return(-1); + } old_num_selections = *num_selections; bcopy(*dev_select, old_dev_select, sizeof(struct device_selection) * *num_selections); @@ -1028,16 +1047,17 @@ devstat_buildmatch(char *match_str, stru return(-1); } - /* - * Since you can't realloc a pointer that hasn't been malloced - * first, we malloc first and then realloc. - */ if (*num_matches == 0) - *matches = (struct devstat_match *)malloc( - sizeof(struct devstat_match)); - else - *matches = (struct devstat_match *)realloc(*matches, - sizeof(struct devstat_match) * (*num_matches + 1)); + *matches = NULL; + + *matches = (struct devstat_match *)reallocf(*matches, + sizeof(struct devstat_match) * (*num_matches + 1)); + + if (*matches == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), + "%s: Cannot allocate memory for matches list", __func__); + return(-1); + } /* Make sure the current entry is clear */ bzero(&matches[0][*num_matches], sizeof(struct devstat_match)); From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 23:20:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB5A71065672; Fri, 6 Jan 2012 23:20:33 +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 D9EE88FC08; Fri, 6 Jan 2012 23:20:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q06NKXbb013021; Fri, 6 Jan 2012 23:20:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06NKXcL013019; Fri, 6 Jan 2012 23:20:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201062320.q06NKXcL013019@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 6 Jan 2012 23:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229742 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 23:20:34 -0000 Author: jilles Date: Fri Jan 6 23:20:33 2012 New Revision: 229742 URL: http://svn.freebsd.org/changeset/base/229742 Log: sh: Avoid possible echo options in a testcase. Modified: head/tools/regression/bin/sh/builtins/getopts1.0 Modified: head/tools/regression/bin/sh/builtins/getopts1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/getopts1.0 Fri Jan 6 22:54:03 2012 (r229741) +++ head/tools/regression/bin/sh/builtins/getopts1.0 Fri Jan 6 23:20:33 2012 (r229742) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo '-1-' +printf -- '-1-\n' set -- -abc getopts "ab:" OPTION echo ${OPTION} @@ -11,7 +11,7 @@ echo ${OPTION} # ksh93 20090505; pdksh 5.2.14p2; mksh R39c; bash 4.1 PL7; and zsh 4.3.10. # all recognize that "b" is missing its argument on the *first* iteration # of 'getopts' and do not produce the "a" in $OPTION. -echo '-2-' +printf -- '-2-\n' set -- -ab getopts "ab:" OPTION echo ${OPTION} @@ -19,7 +19,7 @@ getopts "ab:" OPTION echo ${OPTION} # The 'shift' is aimed at causing an error. -echo '-3-' +printf -- '-3-\n' shift 1 getopts "ab:" OPTION echo ${OPTION} From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 23:44:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F40D6106576C; Fri, 6 Jan 2012 23:44:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2DB78FC0C; Fri, 6 Jan 2012 23:44: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 q06NiQCO013803; Fri, 6 Jan 2012 23:44:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q06NiQi4013800; Fri, 6 Jan 2012 23:44:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201062344.q06NiQi4013800@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 6 Jan 2012 23:44: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: r229744 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 23:44:27 -0000 Author: pjd Date: Fri Jan 6 23:44:26 2012 New Revision: 229744 URL: http://svn.freebsd.org/changeset/base/229744 Log: fork(2) returns -1 on failure, not some random negative number. MFC after: 3 days Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Jan 6 23:33:33 2012 (r229743) +++ head/sbin/hastd/primary.c Fri Jan 6 23:44:26 2012 (r229744) @@ -886,7 +886,7 @@ hastd_primary(struct hast_resource *res) } pid = fork(); - if (pid < 0) { + if (pid == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_TEMPFAIL, "Unable to fork"); Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Jan 6 23:33:33 2012 (r229743) +++ head/sbin/hastd/secondary.c Fri Jan 6 23:44:26 2012 (r229744) @@ -401,7 +401,7 @@ hastd_secondary(struct hast_resource *re } pid = fork(); - if (pid < 0) { + if (pid == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to fork"); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 00:11:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3A8C106567C; Sat, 7 Jan 2012 00:11:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2D728FC13; Sat, 7 Jan 2012 00:11: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 q070BaAw014994; Sat, 7 Jan 2012 00:11:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q070Banb014992; Sat, 7 Jan 2012 00:11:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201070011.q070Banb014992@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jan 2012 00:11: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: r229749 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 00:11:36 -0000 Author: eadler (ports committer) Date: Sat Jan 7 00:11:36 2012 New Revision: 229749 URL: http://svn.freebsd.org/changeset/base/229749 Log: - Fix sysctl description PR: 163623 Submitted by: Eugene Grosbein Approved by: bz Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Sat Jan 7 00:07:23 2012 (r229748) +++ head/sys/netinet/ip_icmp.c Sat Jan 7 00:11:36 2012 (r229749) @@ -89,7 +89,7 @@ static VNET_DEFINE(int, icmplim_output) #define V_icmplim_output VNET(icmplim_output) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, - "Enable rate limiting of ICMP responses"); + "Enable logging of ICMP response rate limiting"); #ifdef INET VNET_DEFINE(struct icmpstat, icmpstat); From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 00:16:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 7DD61106564A; Sat, 7 Jan 2012 00:16:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 7B9B217A18A; Sat, 7 Jan 2012 00:16:05 +0000 (UTC) Message-ID: <4F078EC4.2090802@FreeBSD.org> Date: Fri, 06 Jan 2012 16:16:04 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Guy Helmer References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 00:16:15 -0000 On 01/06/2012 08:18, Guy Helmer wrote: > On Jan 5, 2012, at 8:58 PM, Doug Barton wrote: > >> On 01/05/2012 14:48, Guy Helmer wrote: >>> Allow daemon(8) to run pidfile_open() before relenquishing >>> privileges so pid files can be written in /var/run when started >>> as root. >> >> I'm not sure how useful this is since when daemon is exiting it >> won't be able to remove the pid file (unless I'm missing >> something). >> >> Isn't it better to pre-create the pid file with the proper >> permissions for the unprivileged user? >> > > Would it be OK for daemon to hang around and wait for the child > process to exit, then remove the pid file? Without having given it any kind of careful thought, that sounds Ok ... but I don't understand how daemon could remove a pid file written as root after it's already dropped privileges. (IOW that's the same problem I was bringing up.) > The only other alternative I see would be to create a subdirectory > that is writable by the user so the child can create and delete the > pid file. That's functionally equivalent to pre-creating the pid file with the right permissions, so it would be Ok. Various ports use each of these approaches. I'm generally in favor of using the pid file only solution since rc.d/cleanvar will clean all that stuff up at boot, and it's preferable to not leave stale directories around for stuff that is no longer running and/or installed. Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 00:47:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B25F2106564A; Sat, 7 Jan 2012 00:47:27 +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 A18828FC18; Sat, 7 Jan 2012 00:47: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 q070lR5H016398; Sat, 7 Jan 2012 00:47:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q070lRMO016396; Sat, 7 Jan 2012 00:47:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201070047.q070lRMO016396@svn.freebsd.org> From: Dimitry Andric Date: Sat, 7 Jan 2012 00:47: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: r229753 - head/sys/contrib/rdma X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 00:47:27 -0000 Author: dim Date: Sat Jan 7 00:47:27 2012 New Revision: 229753 URL: http://svn.freebsd.org/changeset/base/229753 Log: In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same value used in sys/ofed/include/linux/netdevice.h), so there will be no buffer overruns in the rest of the inline functions in this file. Reviewed by: kmacy MFC after: 1 week Modified: head/sys/contrib/rdma/ib_addr.h Modified: head/sys/contrib/rdma/ib_addr.h ============================================================================== --- head/sys/contrib/rdma/ib_addr.h Sat Jan 7 00:36:17 2012 (r229752) +++ head/sys/contrib/rdma/ib_addr.h Sat Jan 7 00:47:27 2012 (r229753) @@ -42,7 +42,7 @@ #include -#define MAX_ADDR_LEN ETHER_ADDR_LEN /* XXX doesn't support IB! */ +#define MAX_ADDR_LEN 20 struct rdma_addr_client { int refcount; From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 04:13:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BA5F106564A; Sat, 7 Jan 2012 04:13:25 +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 6AA528FC0A; Sat, 7 Jan 2012 04:13: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 q074DPqt024075; Sat, 7 Jan 2012 04:13:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q074DPNR024073; Sat, 7 Jan 2012 04:13:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201070413.q074DPNR024073@svn.freebsd.org> From: Adrian Chadd Date: Sat, 7 Jan 2012 04:13: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: r229765 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 04:13:25 -0000 Author: adrian Date: Sat Jan 7 04:13:25 2012 New Revision: 229765 URL: http://svn.freebsd.org/changeset/base/229765 Log: Fix the ar724x shift calculation when writing to the PCI config space. This was preventing the ath driver from being loaded at runtime. It worked fine when compiled statically into the kernel but not when kldload'ed after the system booted. The root cause was that PCIR_INTLINE (register 60) was being overwritten by zeros when register 62 was being written to. A subsequent read of this register would return 0, and thus the rest of the PCI glue assumed an IRQ resource had already been allocated. This caused the device to fail to attach at runtime as the device itself didn't contain any IRQ resources. TODO: go back over the ar71xx and ar724x PCI config read/write code and ensure it's correct. Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sat Jan 7 03:32:47 2012 (r229764) +++ head/sys/mips/atheros/ar724x_pci.c Sat Jan 7 04:13:25 2012 (r229765) @@ -93,7 +93,7 @@ ar724x_pci_write(uint32_t reg, uint32_t uint32_t val, mask, shift; /* Register access is 32-bit aligned */ - shift = 8 * (offset & (bytes % 4)); + shift = (offset & 3) * 8; if (bytes % 4) mask = (1 << (bytes * 8)) - 1; else From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 09:01:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 097E11065673; Sat, 7 Jan 2012 09:01:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1EB58FC14; Sat, 7 Jan 2012 09:01: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 q0791JBj032868; Sat, 7 Jan 2012 09:01:19 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0791JRm032864; Sat, 7 Jan 2012 09:01:19 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201201070901.q0791JRm032864@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 7 Jan 2012 09:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229766 - in head: lib/libc/net sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 09:01:20 -0000 Author: ume Date: Sat Jan 7 09:01:19 2012 New Revision: 229766 URL: http://svn.freebsd.org/changeset/base/229766 Log: Handle the internal scope address representation of the KAME IPv6 stack for the node-local multicast address. Spotted by: Rainer Bredehorn MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c head/sbin/route/route.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sat Jan 7 04:13:25 2012 (r229765) +++ head/lib/libc/net/getaddrinfo.c Sat Jan 7 09:01:19 2012 (r229766) @@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock if (*scope == '\0') return -1; - if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) { + if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) || + IN6_IS_ADDR_MC_NODELOCAL(a6)) { /* * We currently assume a one-to-one mapping between links * and interfaces, so we simply use interface indices for Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sat Jan 7 04:13:25 2012 (r229765) +++ head/sbin/route/route.c Sat Jan 7 09:01:19 2012 (r229766) @@ -375,7 +375,8 @@ routename(struct sockaddr *sa) #ifdef __KAME__ if (sa->sa_len == sizeof(struct sockaddr_in6) && (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) && sin6.sin6_scope_id == 0) { sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); @@ -500,7 +501,8 @@ netname(struct sockaddr *sa) #ifdef __KAME__ if (sa->sa_len == sizeof(struct sockaddr_in6) && (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) && sin6.sin6_scope_id == 0) { sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); @@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6)); #ifdef __KAME__ if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) && su->sin6.sin6_scope_id) { *(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] = htons(su->sin6.sin6_scope_id); From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 09:17:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id BB053106566B; Sat, 7 Jan 2012 09:17:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 89443151F95; Sat, 7 Jan 2012 09:17:31 +0000 (UTC) Message-ID: <4F080DAA.9030109@FreeBSD.org> Date: Sat, 07 Jan 2012 01:17:30 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <201112191535.pBJFZ6hY063597@svn.freebsd.org> In-Reply-To: <201112191535.pBJFZ6hY063597@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228711 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 09:17:32 -0000 Is this the change that is causing all the new usb-related messages when shutting down? If so, can it be hidden behind verbose? Doug On 12/19/2011 07:35, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Dec 19 15:35:05 2011 > New Revision: 228711 > URL: http://svn.freebsd.org/changeset/base/228711 > > Log: > Add code to wait for USB shutdown to be executed at system shutdown. > Add sysctl which can be used to skip this waiting. > > MFC after: 3 days > > Modified: > head/sys/dev/usb/controller/usb_controller.c > > Modified: head/sys/dev/usb/controller/usb_controller.c > ============================================================================== > --- head/sys/dev/usb/controller/usb_controller.c Mon Dec 19 14:55:14 2011 (r228710) > +++ head/sys/dev/usb/controller/usb_controller.c Mon Dec 19 15:35:05 2011 (r228711) > @@ -87,7 +87,12 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug > static int usb_no_boot_wait = 0; > TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); > SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, > - "No device enumerate waiting at boot."); > + "No USB device enumerate waiting at boot."); > + > +static int usb_no_shutdown_wait = 0; > +TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); > +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RDTUN, &usb_no_shutdown_wait, 0, > + "No USB device waiting at system shutdown."); > > static devclass_t usb_devclass; > > @@ -277,11 +282,20 @@ usb_shutdown(device_t dev) > return (0); > } > > + device_printf(bus->bdev, "Controller shutdown\n"); > + > USB_BUS_LOCK(bus); > usb_proc_msignal(&bus->explore_proc, > &bus->shutdown_msg[0], &bus->shutdown_msg[1]); > + if (usb_no_shutdown_wait == 0) { > + /* wait for shutdown callback to be executed */ > + usb_proc_mwait(&bus->explore_proc, > + &bus->shutdown_msg[0], &bus->shutdown_msg[1]); > + } > USB_BUS_UNLOCK(bus); > > + device_printf(bus->bdev, "Controller shutdown complete\n"); > + > return (0); > } > > -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 09:39:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67102106566B; Sat, 7 Jan 2012 09:39:45 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id DCF618FC13; Sat, 7 Jan 2012 09:39:44 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 8C9D0215C; Sat, 7 Jan 2012 10:22:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Doug_Barton?= Date: Sat, 7 Jan 2012 10:22:42 +0100 Mime-Version: 1.0 In-Reply-To: <4F080DAA.9030109@FreeBSD.org> References: <4F080DAA.9030109@FreeBSD.org> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" Subject: RE: svn commit: r228711 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 09:39:45 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AYes, that is correct.=0D=0A=0D=0A=A0=0D=0A=0D= =0AI was thinking to add something like if (bootverbose), please feel fre= e to do so. I'm very busy this weekend.=0D=0A=0D=0A=A0=0D=0A=0D=0ASome me= ssages are produced by new bus, and I'm not sure how easy those are to hi= de.=0D=0A=0D=0A=A0=0D=0A=0D=0AThe idea behind the messages, is that if an= ything hangs at shutdown, that it will easily be traced down.=0D=0A=0D=0A= =A0=0D=0A=0D=0A--HPS=0D=0A=A0=0D=0A-----Original message-----=0D=0ATo:Han= s Petter Selasky ;=20=0D=0ACC:src-committers@freebs= d.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org;=20=0D=0AFrom:Do= ug Barton =0D=0ASent:Sat 07-01-2012 10:18=0D=0ASubject= :Re: svn commit: r228711 - head/sys/dev/usb/controller=0D=0AIs this the c= hange that is causing all the new usb-related messages when=0D=0Ashutting= down=3F If so, can it be hidden behind verbose=3F=0D=0A=0D=0A=0D=0ADoug=0D= =0A From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 09:41:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32476106564A; Sat, 7 Jan 2012 09:41:59 +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 1D5948FC12; Sat, 7 Jan 2012 09:41: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 q079fxn5034106; Sat, 7 Jan 2012 09:41:59 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q079fwK0034069; Sat, 7 Jan 2012 09:41:58 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201070941.q079fwK0034069@svn.freebsd.org> From: Kevin Lo Date: Sat, 7 Jan 2012 09:41: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: r229767 - in head/sys/dev: an bfe bm bxe e1000 ep ex firewire ie if_ndis ixgb ixgbe lge msk my nfe nve qlxgb rt sis sk sn snc stge tl tsec usb/net vx vxge wb xen/netback xen/netfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 09:41:59 -0000 Author: kevlo Date: Sat Jan 7 09:41:57 2012 New Revision: 229767 URL: http://svn.freebsd.org/changeset/base/229767 Log: ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again Reviewed by: yongari Modified: head/sys/dev/an/if_an.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bm/if_bm.c head/sys/dev/bxe/if_bxe.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ep/if_ep.c head/sys/dev/ex/if_ex.c head/sys/dev/firewire/if_fwe.c head/sys/dev/ie/if_ie.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c head/sys/dev/lge/if_lge.c head/sys/dev/msk/if_msk.c head/sys/dev/my/if_my.c head/sys/dev/nfe/if_nfe.c head/sys/dev/nve/if_nve.c head/sys/dev/qlxgb/qla_os.c head/sys/dev/rt/if_rt.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/sn/if_sn.c head/sys/dev/snc/dp83932.c head/sys/dev/stge/if_stge.c head/sys/dev/tl/if_tl.c head/sys/dev/tsec/if_tsec.c head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/vx/if_vx.c head/sys/dev/vxge/vxge.c head/sys/dev/wb/if_wb.c head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/an/if_an.c Sat Jan 7 09:41:57 2012 (r229767) @@ -761,7 +761,6 @@ an_attach(struct an_softc *sc, int flags ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->an_dev), device_get_unit(sc->an_dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = an_ioctl; ifp->if_start = an_start; Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/bfe/if_bfe.c Sat Jan 7 09:41:57 2012 (r229767) @@ -489,7 +489,6 @@ bfe_attach(device_t dev) ifp->if_ioctl = bfe_ioctl; ifp->if_start = bfe_start; ifp->if_init = bfe_init; - ifp->if_mtu = ETHERMTU; IFQ_SET_MAXLEN(&ifp->if_snd, BFE_TX_QLEN); ifp->if_snd.ifq_drv_maxlen = BFE_TX_QLEN; IFQ_SET_READY(&ifp->if_snd); Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/bm/if_bm.c Sat Jan 7 09:41:57 2012 (r229767) @@ -468,7 +468,6 @@ bm_attach(device_t dev) if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = bm_start; ifp->if_ioctl = bm_ioctl; Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/bxe/if_bxe.c Sat Jan 7 09:41:57 2012 (r229767) @@ -2136,7 +2136,6 @@ bxe_attach(device_t dev) #endif ifp->if_init = bxe_init; - ifp->if_mtu = ETHERMTU; ifp->if_hwassist = BXE_IF_HWASSIST; ifp->if_capabilities = BXE_IF_CAPABILITIES; /* TPA not enabled by default. */ Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/e1000/if_em.c Sat Jan 7 09:41:57 2012 (r229767) @@ -2898,7 +2898,6 @@ em_setup_interface(device_t dev, struct return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_init = em_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/e1000/if_igb.c Sat Jan 7 09:41:57 2012 (r229767) @@ -2899,7 +2899,6 @@ igb_setup_interface(device_t dev, struct return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_init = igb_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/e1000/if_lem.c Sat Jan 7 09:41:57 2012 (r229767) @@ -2354,7 +2354,6 @@ lem_setup_interface(device_t dev, struct return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_init = lem_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/ep/if_ep.c Sat Jan 7 09:41:57 2012 (r229767) @@ -301,7 +301,6 @@ ep_attach(struct ep_softc *sc) ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = epstart; ifp->if_ioctl = epioctl; Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/ex/if_ex.c Sat Jan 7 09:41:57 2012 (r229767) @@ -232,7 +232,6 @@ ex_attach(device_t dev) */ ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = ex_start; ifp->if_ioctl = ex_ioctl; Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/firewire/if_fwe.c Sat Jan 7 09:41:57 2012 (r229767) @@ -214,7 +214,6 @@ fwe_attach(device_t dev) #endif ifp->if_start = fwe_start; ifp->if_ioctl = fwe_ioctl; - ifp->if_mtu = ETHERMTU; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); ifp->if_snd.ifq_maxlen = TX_MAX_QUEUE; Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/ie/if_ie.c Sat Jan 7 09:41:57 2012 (r229767) @@ -313,7 +313,6 @@ ie_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = iestart; ifp->if_ioctl = ieioctl; Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/if_ndis/if_ndis.c Sat Jan 7 09:41:57 2012 (r229767) @@ -714,7 +714,6 @@ ndis_attach(dev) ndis_probe_offload(sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ndis_ioctl; ifp->if_start = ndis_start; Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/ixgb/if_ixgb.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1354,7 +1354,6 @@ ixgb_setup_interface(device_t dev, struc ifp->if_unit = device_get_unit(dev); ifp->if_name = "ixgb"; #endif - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = 1000000000; ifp->if_init = ixgb_init; ifp->if_softc = adapter; Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/ixgbe/ixgbe.c Sat Jan 7 09:41:57 2012 (r229767) @@ -2431,7 +2431,6 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = 1000000000; ifp->if_init = ixgbe_init; ifp->if_softc = adapter; Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/ixgbe/ixv.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1829,7 +1829,6 @@ ixv_setup_interface(device_t dev, struct if (ifp == NULL) panic("%s: can not if_alloc()\n", device_get_nameunit(dev)); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = 1000000000; ifp->if_init = ixv_init; ifp->if_softc = adapter; Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/lge/if_lge.c Sat Jan 7 09:41:57 2012 (r229767) @@ -536,7 +536,6 @@ lge_attach(dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = lge_ioctl; ifp->if_start = lge_start; Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/msk/if_msk.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1636,7 +1636,6 @@ msk_attach(device_t dev) } ifp->if_softc = sc_if; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4; /* Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/my/if_my.c Sat Jan 7 09:41:57 2012 (r229767) @@ -895,7 +895,6 @@ my_attach(device_t dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = my_ioctl; ifp->if_start = my_start; Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/nfe/if_nfe.c Sat Jan 7 09:41:57 2012 (r229767) @@ -565,7 +565,6 @@ nfe_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = nfe_ioctl; ifp->if_start = nfe_start; Modified: head/sys/dev/nve/if_nve.c ============================================================================== --- head/sys/dev/nve/if_nve.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/nve/if_nve.c Sat Jan 7 09:41:57 2012 (r229767) @@ -529,7 +529,6 @@ nve_attach(device_t dev) ifp->if_ioctl = nve_ioctl; ifp->if_start = nve_ifstart; ifp->if_init = nve_init; - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = IF_Mbps(100); IFQ_SET_MAXLEN(&ifp->if_snd, TX_RING_SIZE - 1); ifp->if_snd.ifq_drv_maxlen = TX_RING_SIZE - 1; Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/qlxgb/qla_os.c Sat Jan 7 09:41:57 2012 (r229767) @@ -660,7 +660,6 @@ qla_init_ifnet(device_t dev, qla_host_t if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = (1 * 1000 * 1000 *1000); ifp->if_init = qla_init; ifp->if_softc = ha; Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/rt/if_rt.c Sat Jan 7 09:41:57 2012 (r229767) @@ -383,7 +383,6 @@ rt_attach(device_t dev) ifp->if_init = rt_init; ifp->if_ioctl = rt_ioctl; ifp->if_start = rt_start; - ifp->if_mtu = ETHERMTU; #define RT_TX_QLEN 256 IFQ_SET_MAXLEN(&ifp->if_snd, RT_TX_QLEN); Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/sis/if_sis.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1054,7 +1054,6 @@ sis_attach(device_t dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = sis_ioctl; ifp->if_start = sis_start; Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/sk/if_sk.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1350,7 +1350,6 @@ sk_attach(dev) } ifp->if_softc = sc_if; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; /* * SK_GENESIS has a bug in checksum offload - From linux. Modified: head/sys/dev/sn/if_sn.c ============================================================================== --- head/sys/dev/sn/if_sn.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/sn/if_sn.c Sat Jan 7 09:41:57 2012 (r229767) @@ -201,7 +201,6 @@ sn_attach(device_t dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = snstart; ifp->if_ioctl = snioctl; Modified: head/sys/dev/snc/dp83932.c ============================================================================== --- head/sys/dev/snc/dp83932.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/snc/dp83932.c Sat Jan 7 09:41:57 2012 (r229767) @@ -176,7 +176,6 @@ sncconfig(sc, media, nmedia, defmedia, m ifp->if_start = sncstart; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = sncinit; - ifp->if_mtu = ETHERMTU; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); /* Initialize media goo. */ Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/stge/if_stge.c Sat Jan 7 09:41:57 2012 (r229767) @@ -573,7 +573,6 @@ stge_attach(device_t dev) ifp->if_ioctl = stge_ioctl; ifp->if_start = stge_start; ifp->if_init = stge_init; - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_drv_maxlen = STGE_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/tl/if_tl.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1175,7 +1175,6 @@ tl_attach(dev) ifp->if_ioctl = tl_ioctl; ifp->if_start = tl_start; ifp->if_init = tl_init; - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = TL_TX_LIST_CNT - 1; ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_MTU; Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/tsec/if_tsec.c Sat Jan 7 09:41:57 2012 (r229767) @@ -247,7 +247,6 @@ tsec_attach(struct tsec_softc *sc) ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; ifp->if_init = tsec_init; ifp->if_start = tsec_start; Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/usb/net/usb_ethernet.c Sat Jan 7 09:41:57 2012 (r229767) @@ -219,7 +219,6 @@ ue_attach_post_task(struct usb_proc_msg ue->ue_ifp = ifp; error = ue->ue_methods->ue_attach_post_sub(ue); } else { - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; if (ue->ue_methods->ue_ioctl != NULL) ifp->if_ioctl = ue->ue_methods->ue_ioctl; Modified: head/sys/dev/vx/if_vx.c ============================================================================== --- head/sys/dev/vx/if_vx.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/vx/if_vx.c Sat Jan 7 09:41:57 2012 (r229767) @@ -188,7 +188,6 @@ vx_attach(device_t dev) eaddr[(i << 1) + 1] = x; } - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = vx_start; Modified: head/sys/dev/vxge/vxge.c ============================================================================== --- head/sys/dev/vxge/vxge.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/vxge/vxge.c Sat Jan 7 09:41:57 2012 (r229767) @@ -1378,7 +1378,6 @@ vxge_ifp_setup(device_t ndev) /* Initialize interface ifnet structure */ if_initname(ifp, device_get_name(ndev), device_get_unit(ndev)); - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = VXGE_BAUDRATE; ifp->if_init = vxge_init; ifp->if_softc = vdev; Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/wb/if_wb.c Sat Jan 7 09:41:57 2012 (r229767) @@ -660,7 +660,6 @@ wb_attach(dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = wb_ioctl; ifp->if_start = wb_start; Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/xen/netback/netback.c Sat Jan 7 09:41:57 2012 (r229767) @@ -375,7 +375,6 @@ netif_create(int handle, struct xenbus_d ifp->if_output = ether_output; ifp->if_start = netback_start; ifp->if_ioctl = netback_ioctl; - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = NET_TX_RING_SIZE - 1; DPRINTF("Created %s for domid=%d handle=%d\n", IFNAME(netif), netif->domid, netif->handle); Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Sat Jan 7 09:01:19 2012 (r229766) +++ head/sys/dev/xen/netfront/netfront.c Sat Jan 7 09:41:57 2012 (r229767) @@ -2145,7 +2145,6 @@ create_netdev(device_t dev) ifp->if_watchdog = xn_watchdog; #endif ifp->if_init = xn_ifinit; - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = NET_TX_RING_SIZE - 1; ifp->if_hwassist = XN_CSUM_FEATURES; From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 10:33:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E891106564A; Sat, 7 Jan 2012 10:33:02 +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 6B6AA8FC0C; Sat, 7 Jan 2012 10:33: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 q07AX2tm035786; Sat, 7 Jan 2012 10:33:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07AX21h035775; Sat, 7 Jan 2012 10:33:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201071033.q07AX21h035775@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 7 Jan 2012 10:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229768 - in head: include lib/libc/gen libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 10:33:02 -0000 Author: kib Date: Sat Jan 7 10:33:01 2012 New Revision: 229768 URL: http://svn.freebsd.org/changeset/base/229768 Log: Implement fdlopen(3), an rtld interface to load shared object by file descriptor. Requested and tested by: des (previous version) Reviewed by: des, kan (previous version) MFC after: 2 weeks Modified: head/include/dlfcn.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/dlfcn.c head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/Symbol.map head/libexec/rtld-elf/rtld.c Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Sat Jan 7 09:41:57 2012 (r229767) +++ head/include/dlfcn.h Sat Jan 7 10:33:01 2012 (r229768) @@ -118,6 +118,7 @@ void *dlopen(const char *, int); void *dlsym(void * __restrict, const char * __restrict); #if __BSD_VISIBLE +void *fdlopen(int, int); int dladdr(const void * __restrict, Dl_info * __restrict); dlfunc_t dlfunc(void * __restrict, const char * __restrict); int dlinfo(void * __restrict, int, void * __restrict); Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sat Jan 7 09:41:57 2012 (r229767) +++ head/lib/libc/gen/Makefile.inc Sat Jan 7 10:33:01 2012 (r229768) @@ -95,8 +95,8 @@ MLINKS+=directory.3 closedir.3 directory directory.3 fdopendir.3 \ directory.3 readdir.3 directory.3 readdir_r.3 directory.3 rewinddir.3 \ directory.3 seekdir.3 directory.3 telldir.3 -MLINKS+=dlopen.3 dlclose.3 dlopen.3 dlerror.3 dlopen.3 dlfunc.3 \ - dlopen.3 dlsym.3 +MLINKS+=dlopen.3 fdlopen.3 dlopen.3 dlclose.3 dlopen.3 dlerror.3 \ + dlopen.3 dlfunc.3 dlopen.3 dlsym.3 MLINKS+=err.3 err_set_exit.3 err.3 err_set_file.3 err.3 errc.3 err.3 errx.3 \ err.3 verr.3 err.3 verrc.3 err.3 verrx.3 err.3 vwarn.3 err.3 vwarnc.3 \ err.3 vwarnx.3 err.3 warnc.3 err.3 warn.3 err.3 warnx.3 Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Jan 7 09:41:57 2012 (r229767) +++ head/lib/libc/gen/Symbol.map Sat Jan 7 10:33:01 2012 (r229768) @@ -382,6 +382,7 @@ FBSD_1.2 { }; FBSD_1.3 { + fdlopen; __FreeBSD_libc_enter_restricted_mode; }; Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Sat Jan 7 09:41:57 2012 (r229767) +++ head/lib/libc/gen/dlfcn.c Sat Jan 7 10:33:01 2012 (r229768) @@ -147,6 +147,15 @@ dl_iterate_phdr(int (*callback)(struct d return 0; } +#pragma weak fdlopen +void * +fdlopen(int fd, int mode) +{ + + _rtld_error(sorry); + return NULL; +} + #pragma weak _rtld_atfork_pre void _rtld_atfork_pre(int *locks) Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Sat Jan 7 09:41:57 2012 (r229767) +++ head/lib/libc/gen/dlopen.3 Sat Jan 7 10:33:01 2012 (r229768) @@ -32,11 +32,12 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd July 7, 2009 +.Dd December 21, 2011 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , +.Nm fdlopen , .Nm dlsym , .Nm dlfunc , .Nm dlerror , @@ -49,6 +50,8 @@ .Ft void * .Fn dlopen "const char *path" "int mode" .Ft void * +.Fn fdlopen "int fd" "int mode" +.Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" @@ -164,6 +167,36 @@ be interrogated with .Fn dlerror . .Pp The +.Fn fdlopen +function is similar to +.Fn dlopen , +but it takes the file descriptor argument +.Fa fd , +which is used for the file operations needed to load an object +into the address space. +The file descriptor +.Fa fd +is not closed by the function regardless a result of execution, +but a duplicate of the file descriptor is. +This may be important if a +.Xr lockf 3 +lock is held on the passed descriptor. +The +.Fa fd +argument -1 is interpreted as a reference to the main +executable of the process, similar to +.Va NULL +value for the +.Fa name +argument to +.Fn dlopen . +The +.Fn fdlopen +function can be used by the code that needs to perform +additional checks on the loaded objects, to prevent races with +symlinking or renames. +.Pp +The .Fn dlsym function returns the address binding of the symbol described in the null-terminated @@ -354,6 +387,7 @@ option to the C language compiler. .Sh ERRORS The .Fn dlopen , +.Fn fdlopen , .Fn dlsym , and .Fn dlfunc Modified: head/libexec/rtld-elf/Symbol.map ============================================================================== --- head/libexec/rtld-elf/Symbol.map Sat Jan 7 09:41:57 2012 (r229767) +++ head/libexec/rtld-elf/Symbol.map Sat Jan 7 10:33:01 2012 (r229768) @@ -18,6 +18,10 @@ FBSD_1.0 { __tls_get_addr; }; +FBSD_1.3 { + fdlopen; +}; + FBSDprivate_1.0 { _rtld_thread_init; _rtld_allocate_tls; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jan 7 09:41:57 2012 (r229767) +++ head/libexec/rtld-elf/rtld.c Sat Jan 7 10:33:01 2012 (r229768) @@ -83,7 +83,7 @@ static void digest_dynamic2(Obj_Entry *, static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); -static Obj_Entry *dlopen_object(const char *name, Obj_Entry *refobj, +static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, int mode); static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); @@ -103,7 +103,7 @@ static void load_filtees(Obj_Entry *, in static void unload_filtees(Obj_Entry *); static int load_needed_objects(Obj_Entry *, int); static int load_preload_objects(void); -static Obj_Entry *load_object(const char *, const Obj_Entry *, int); +static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static Obj_Entry *obj_from_addr(const void *); static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *); @@ -120,6 +120,7 @@ static int resolve_objects_ifunc(Obj_Ent RtldLockState *lockstate); static int rtld_dirname(const char *, char *); static int rtld_dirname_abs(const char *, char *); +static void *rtld_dlopen(const char *name, int fd, int mode); static void rtld_exit(void); static char *search_library_path(const char *, const char *); static const void **get_program_var_addr(const char *, RtldLockState *); @@ -1544,7 +1545,7 @@ load_filtee1(Obj_Entry *obj, Needed_Entr { for (; needed != NULL; needed = needed->next) { - needed->obj = dlopen_object(obj->strtab + needed->name, obj, + needed->obj = dlopen_object(obj->strtab + needed->name, -1, obj, flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | RTLD_LOCAL); } @@ -1568,7 +1569,7 @@ process_needed(Obj_Entry *obj, Needed_En Obj_Entry *obj1; for (; needed != NULL; needed = needed->next) { - obj1 = needed->obj = load_object(obj->strtab + needed->name, obj, + obj1 = needed->obj = load_object(obj->strtab + needed->name, -1, obj, flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing && (flags & RTLD_LO_FILTEES) == 0) return (-1); @@ -1615,7 +1616,7 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - if (load_object(p, NULL, 0) == NULL) + if (load_object(p, -1, NULL, 0) == NULL) return -1; /* XXX - cleanup */ p[len] = savech; p += len; @@ -1625,43 +1626,68 @@ load_preload_objects(void) return 0; } +static const char * +printable_path(const char *path) +{ + + return (path == NULL ? "" : path); +} + /* - * Load a shared object into memory, if it is not already loaded. + * Load a shared object into memory, if it is not already loaded. The + * object may be specified by name or by user-supplied file descriptor + * fd_u. In the later case, the fd_u descriptor is not closed, but its + * duplicate is. * * Returns a pointer to the Obj_Entry for the object. Returns NULL * on failure. */ static Obj_Entry * -load_object(const char *name, const Obj_Entry *refobj, int flags) +load_object(const char *name, int fd_u, const Obj_Entry *refobj, int flags) { Obj_Entry *obj; - int fd = -1; + int fd; struct stat sb; char *path; - for (obj = obj_list->next; obj != NULL; obj = obj->next) - if (object_match_name(obj, name)) - return obj; + if (name != NULL) { + for (obj = obj_list->next; obj != NULL; obj = obj->next) { + if (object_match_name(obj, name)) + return (obj); + } - path = find_library(name, refobj); - if (path == NULL) - return NULL; + path = find_library(name, refobj); + if (path == NULL) + return (NULL); + } else + path = NULL; /* - * If we didn't find a match by pathname, open the file and check - * again by device and inode. This avoids false mismatches caused - * by multiple links or ".." in pathnames. + * If we didn't find a match by pathname, or the name is not + * supplied, open the file and check again by device and inode. + * This avoids false mismatches caused by multiple links or ".." + * in pathnames. * * To avoid a race, we open the file and use fstat() rather than * using stat(). */ - if ((fd = open(path, O_RDONLY)) == -1) { - _rtld_error("Cannot open \"%s\"", path); - free(path); - return NULL; + fd = -1; + if (fd_u == -1) { + if ((fd = open(path, O_RDONLY)) == -1) { + _rtld_error("Cannot open \"%s\"", path); + free(path); + return (NULL); + } + } else { + fd = dup(fd_u); + if (fd == -1) { + _rtld_error("Cannot dup fd"); + free(path); + return (NULL); + } } if (fstat(fd, &sb) == -1) { - _rtld_error("Cannot fstat \"%s\"", path); + _rtld_error("Cannot fstat \"%s\"", printable_path(path)); close(fd); free(path); return NULL; @@ -1669,7 +1695,7 @@ load_object(const char *name, const Obj_ for (obj = obj_list->next; obj != NULL; obj = obj->next) if (obj->ino == sb.st_ino && obj->dev == sb.st_dev) break; - if (obj != NULL) { + if (obj != NULL && name != NULL) { object_add_name(obj, name); free(path); close(fd); @@ -1703,20 +1729,25 @@ do_load_object(int fd, const char *name, */ if (dangerous_ld_env) { if (fstatfs(fd, &fs) != 0) { - _rtld_error("Cannot fstatfs \"%s\"", path); - return NULL; + _rtld_error("Cannot fstatfs \"%s\"", printable_path(path)); + return NULL; } if (fs.f_flags & MNT_NOEXEC) { _rtld_error("Cannot execute objects on %s\n", fs.f_mntonname); return NULL; } } - dbg("loading \"%s\"", path); - obj = map_object(fd, path, sbp); + dbg("loading \"%s\"", printable_path(path)); + obj = map_object(fd, printable_path(path), sbp); if (obj == NULL) return NULL; - object_add_name(obj, name); + /* + * If DT_SONAME is present in the object, digest_dynamic2 already + * added it to the object names. + */ + if (name != NULL) + object_add_name(obj, name); obj->path = path; digest_dynamic(obj, 0); if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == @@ -2212,6 +2243,20 @@ dllockinit(void *context, void * dlopen(const char *name, int mode) { + + return (rtld_dlopen(name, -1, mode)); +} + +void * +fdlopen(int fd, int mode) +{ + + return (rtld_dlopen(NULL, fd, mode)); +} + +static void * +rtld_dlopen(const char *name, int fd, int mode) +{ RtldLockState lockstate; int lo_flags; @@ -2232,7 +2277,7 @@ dlopen(const char *name, int mode) if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE; - return (dlopen_object(name, obj_main, lo_flags, + return (dlopen_object(name, fd, obj_main, lo_flags, mode & (RTLD_MODEMASK | RTLD_GLOBAL))); } @@ -2247,7 +2292,8 @@ dlopen_cleanup(Obj_Entry *obj) } static Obj_Entry * -dlopen_object(const char *name, Obj_Entry *refobj, int lo_flags, int mode) +dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, + int mode) { Obj_Entry **old_obj_tail; Obj_Entry *obj; @@ -2262,11 +2308,11 @@ dlopen_object(const char *name, Obj_Entr old_obj_tail = obj_tail; obj = NULL; - if (name == NULL) { + if (name == NULL && fd == -1) { obj = obj_main; obj->refcount++; } else { - obj = load_object(name, refobj, lo_flags); + obj = load_object(name, fd, refobj, lo_flags); } if (obj) { From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 11:16:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7ECD1065670; Sat, 7 Jan 2012 11:16:23 +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 8C5378FC0A; Sat, 7 Jan 2012 11:16: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 q07BGN89037347; Sat, 7 Jan 2012 11:16:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07BGN2D037345; Sat, 7 Jan 2012 11:16:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201071116.q07BGN2D037345@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 7 Jan 2012 11:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229771 - head/sys/boot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 11:16:23 -0000 Author: kib Date: Sat Jan 7 11:16:23 2012 New Revision: 229771 URL: http://svn.freebsd.org/changeset/base/229771 Log: Document comconsole_port and comconsole_pcidev loader variables. MFC after: 2 weeks Modified: head/sys/boot/common/loader.8 Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Sat Jan 7 11:01:35 2012 (r229770) +++ head/sys/boot/common/loader.8 Sat Jan 7 11:16:23 2012 (r229771) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2011 +.Dd January 7, 2012 .Dt LOADER 8 .Os .Sh NAME @@ -419,6 +419,43 @@ was compiled. Changes to the .Va comconsole_speed variable take effect immediately. +.It Va comconsole_port +Defines the base i/o port used to access console UART +(i386 and amd64 only). +If the variable is not set, its assumed value is 0x3F8, which +corresponds to PC port COM1, unless overriden by +.Va BOOT_COMCONSOLE_PORT +variable during the compilation of +.Nm . +Setting the +.Va comconsole_port +variable automatically set +.Va hw.uart.console +environment variable to provide a hint to kernel for location of the console. +Loader console is changed immediately after variable +.Va comconsole_port +is set. +.It Va comconsole_pcidev +Defines the location of a PCI device of the 'simple communication' +class to be used as the serial console UART (i386 and amd64 only). +The syntax of the variable is +.Li 'bus:device:function[:bar]' , +where all members must be numeric, with possible +.Li 0x +prefix to indicate a hexadecimal value. +The +.Va bar +member is optional and assumed to be 0x10 if omitted. +The bar must decode i/o space. +Setting the variable +.Va comconsole_pcidev +automatically sets the variable +.Va comconsole_port +to the base of the selected bar, and hint +.Va hw.uart.console . +Loader console is changed immediately after variable +.Va comconsole_pcidev +is set. .It Va console Defines the current console or consoles. Multiple consoles may be specified. From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 12:40:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29755106566B; Sat, 7 Jan 2012 12:40:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 148BB8FC16; Sat, 7 Jan 2012 12:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q07CejqC039954; Sat, 7 Jan 2012 12:40:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07CejIW039952; Sat, 7 Jan 2012 12:40:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201071240.q07CejIW039952@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 7 Jan 2012 12:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229773 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 12:40:46 -0000 Author: glebius Date: Sat Jan 7 12:40:45 2012 New Revision: 229773 URL: http://svn.freebsd.org/changeset/base/229773 Log: Fix indentation. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Sat Jan 7 12:32:50 2012 (r229772) +++ head/sys/contrib/pf/net/if_pfsync.c Sat Jan 7 12:40:45 2012 (r229773) @@ -3028,11 +3028,10 @@ pfsync_bulk_start(void) #else sc->sc_bulk_next = TAILQ_FIRST(&state_list); #endif - sc->sc_bulk_last = sc->sc_bulk_next; + sc->sc_bulk_last = sc->sc_bulk_next; - pfsync_bulk_status(PFSYNC_BUS_START); - callout_reset(&sc->sc_bulk_tmo, 1, - pfsync_bulk_update, sc); + pfsync_bulk_status(PFSYNC_BUS_START); + callout_reset(&sc->sc_bulk_tmo, 1, pfsync_bulk_update, sc); } #ifdef __FreeBSD__ PF_UNLOCK(); From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 13:03:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63E0B106566B; Sat, 7 Jan 2012 13:03:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DAF68FC15; Sat, 7 Jan 2012 13:03: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 q07D3Y8p040747; Sat, 7 Jan 2012 13:03:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07D3Yv1040745; Sat, 7 Jan 2012 13:03:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201071303.q07D3Yv1040745@svn.freebsd.org> From: Michael Tuexen Date: Sat, 7 Jan 2012 13:03: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: r229774 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 13:03:34 -0000 Author: tuexen Date: Sat Jan 7 13:03:33 2012 New Revision: 229774 URL: http://svn.freebsd.org/changeset/base/229774 Log: Improve the handling of received INITs. Send an ABORT when not accepting the connection. Also fix a crash, which could happen when the user closed the socket. MFC after: 1 month. Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jan 7 12:40:45 2012 (r229773) +++ head/sys/netinet/sctp_input.c Sat Jan 7 13:03:33 2012 (r229774) @@ -88,43 +88,14 @@ sctp_handle_init(struct mbuf *m, int iph { struct sctp_init *init; struct mbuf *op_err; - uint32_t init_limit; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - goto outnow; - } - } - op_err = NULL; - init = &cp->init; - /* First are we accepting? */ - if ((inp->sctp_socket->so_qlimit == 0) && (stcb == NULL)) { - SCTPDBG(SCTP_DEBUG_INPUT2, - "sctp_handle_init: Abort, so_qlimit:%d\n", - inp->sctp_socket->so_qlimit); - /* - * FIX ME ?? What about TCP model and we have a - * match/restart case? Actually no fix is needed. the lookup - * will always find the existing assoc so stcb would not be - * NULL. It may be questionable to do this since we COULD - * just send back the INIT-ACK and hope that the app did - * accept()'s by the time the COOKIE was sent. But there is - * a price to pay for COOKIE generation and I don't want to - * pay it on the chance that the app will actually do some - * accepts(). The App just looses and should NOT be in this - * state :-) - */ - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; } + /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, vrf_id, port); @@ -133,6 +104,7 @@ sctp_handle_init(struct mbuf *m, int iph goto outnow; } /* validate parameters */ + init = &cp->init; if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); @@ -169,19 +141,49 @@ sctp_handle_init(struct mbuf *m, int iph *abort_no_unlock = 1; goto outnow; } - init_limit = offset + ntohs(cp->ch.chunk_length); if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), - init_limit)) { + offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); if (stcb) *abort_no_unlock = 1; goto outnow; } - /* send an INIT-ACK w/cookie */ - SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, - ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + /* + * We are only accepting if we have a socket with positive + * so_qlimit. + */ + if ((stcb == NULL) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_socket == NULL) || + (inp->sctp_socket->so_qlimit == 0))) { + /* + * FIX ME ?? What about TCP model and we have a + * match/restart case? Actually no fix is needed. the lookup + * will always find the existing assoc so stcb would not be + * NULL. It may be questionable to do this since we COULD + * just send back the INIT-ACK and hope that the app did + * accept()'s by the time the COOKIE was sent. But there is + * a price to pay for COOKIE generation and I don't want to + * pay it on the chance that the app will actually do some + * accepts(). The App just looses and should NOT be in this + * state :-) + */ + sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + vrf_id, port); + goto outnow; + } + if ((stcb != NULL) && + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); + sctp_send_shutdown_ack(stcb, NULL); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); + } else { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, + ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + } outnow: if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); @@ -1025,7 +1027,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* Set the connected flag to disconnected */ - stcb->sctp_ep->sctp_socket->so_snd.sb_cc = 0; + stcb->sctp_socket->so_snd.sb_cc = 0; } } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -4499,7 +4501,6 @@ __attribute__((noinline)) * process all control chunks... */ if (((ch->chunk_type == SCTP_SELECTIVE_ACK) || - /* EY */ (ch->chunk_type == SCTP_NR_SELECTIVE_ACK) || (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { @@ -4613,54 +4614,30 @@ process_control_chunks: } switch (ch->chunk_type) { case SCTP_INITIATION: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore? */ - if ((stcb) && (stcb->asoc.total_output_queue_size)) { - /* - * collision case where we are - * sending to them too - */ - ; - } else { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - *offset = length; - return (NULL); - } - } - if ((chk_length > SCTP_LARGEST_INIT_ACCEPTED) || - (num_chunks > 1) || + /* The INIT chunk must be the only chunk. */ + if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + sctp_abort_association(inp, stcb, m, + iphlen, sh, NULL, vrf_id, port); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if ((stcb != NULL) && - (SCTP_GET_STATE(&stcb->asoc) == - SCTP_STATE_SHUTDOWN_ACK_SENT)) { - sctp_send_shutdown_ack(stcb, NULL); + /* Honor our resource limit. */ + if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { + struct mbuf *op_err; + + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); + sctp_abort_association(inp, stcb, m, + iphlen, sh, op_err, vrf_id, port); *offset = length; - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if (netp) { - sctp_handle_init(m, iphlen, *offset, sh, - (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, vrf_id, port); - } - if (abort_no_unlock) - return (NULL); - + sctp_handle_init(m, iphlen, *offset, sh, + (struct sctp_init_chunk *)ch, inp, + stcb, &abort_no_unlock, vrf_id, port); *offset = length; - if (locked_tcb) { + if ((!abort_no_unlock) && (locked_tcb)) { SCTP_TCB_UNLOCK(locked_tcb); } return (NULL); @@ -4668,7 +4645,6 @@ process_control_chunks: case SCTP_PAD_CHUNK: break; case SCTP_INITIATION_ACK: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -4697,6 +4673,7 @@ process_control_chunks: return (NULL); } } + /* The INIT-CK chunk must be the only chunk. */ if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { *offset = length; @@ -4711,16 +4688,17 @@ process_control_chunks: } else { ret = -1; } + *offset = length; + if (abort_no_unlock) { + return (NULL); + } /* * Special case, I must call the output routine to * get the cookie echoed */ - if (abort_no_unlock) - return (NULL); - - if ((stcb) && ret == 0) + if ((stcb != NULL) && (ret == 0)) { sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - *offset = length; + } if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } @@ -4977,7 +4955,6 @@ process_control_chunks: case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP-ERR\n"); if ((stcb) && netp && *netp && sctp_handle_error(ch, stcb, *netp) < 0) { - *offset = length; return (NULL); } @@ -5009,23 +4986,11 @@ process_control_chunks: if ((stcb == NULL) && (inp->sctp_socket->so_qlen >= inp->sctp_socket->so_qlimit)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit))) { - struct mbuf *oper; - struct sctp_paramhdr *phdr; + struct mbuf *op_err; - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); - if (oper) { - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr); - phdr = mtod(oper, - struct sctp_paramhdr *); - phdr->param_type = - htons(SCTP_CAUSE_OUT_OF_RESC); - phdr->param_length = - htons(sizeof(struct sctp_paramhdr)); - } + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, oper, vrf_id, port); + iphlen, sh, op_err, vrf_id, port); } *offset = length; return (NULL); From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 14:04:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63326106566B; Sat, 7 Jan 2012 14:04:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5F38FC0A; Sat, 7 Jan 2012 14:04:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q07E41aP042588; Sat, 7 Jan 2012 14:04:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07E41Bo042583; Sat, 7 Jan 2012 14:04:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201071404.q07E41Bo042583@svn.freebsd.org> From: Michael Tuexen Date: Sat, 7 Jan 2012 14:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229775 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 14:04:01 -0000 Author: tuexen Date: Sat Jan 7 14:04:00 2012 New Revision: 229775 URL: http://svn.freebsd.org/changeset/base/229775 Log: Retire the SCTP sysctl "strict_init". We always perform the validation and there is no reason to make is configuarable. Discussed with rrs@. Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jan 7 13:03:33 2012 (r229774) +++ head/sys/netinet/sctp_input.c Sat Jan 7 14:04:00 2012 (r229775) @@ -4617,7 +4617,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); *offset = length; @@ -4673,9 +4673,9 @@ process_control_chunks: return (NULL); } } - /* The INIT-CK chunk must be the only chunk. */ + /* The INIT-ACK chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat Jan 7 13:03:33 2012 (r229774) +++ head/sys/netinet/sctp_sysctl.c Sat Jan 7 14:04:00 2012 (r229775) @@ -58,7 +58,6 @@ sctp_init_sysctls() #if !defined(SCTP_WITH_NO_CSUM) SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; #endif - SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -607,7 +606,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #if !defined(SCTP_WITH_NO_CSUM) RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); #endif - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -876,10 +874,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", - SCTPCTL_STRICT_INIT_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat Jan 7 13:03:33 2012 (r229774) +++ head/sys/netinet/sctp_sysctl.h Sat Jan 7 14:04:00 2012 (r229775) @@ -50,7 +50,6 @@ struct sctp_sysctl { #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_no_csum_on_loopback; #endif - uint32_t sctp_strict_init; uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; @@ -168,12 +167,6 @@ struct sctp_sysctl { #define SCTPCTL_LOOPBACK_NOCSUM_MAX 1 #define SCTPCTL_LOOPBACK_NOCSUM_DEFAULT 1 -/* strict_init: Enable strict INIT/INIT-ACK singleton enforcement */ -#define SCTPCTL_STRICT_INIT_DESC "Enable strict INIT/INIT-ACK singleton enforcement" -#define SCTPCTL_STRICT_INIT_MIN 0 -#define SCTPCTL_STRICT_INIT_MAX 1 -#define SCTPCTL_STRICT_INIT_DEFAULT 1 - /* peer_chkoh: Amount to debit peers rwnd per chunk sent */ #define SCTPCTL_PEER_CHKOH_DESC "Amount to debit peers rwnd per chunk sent" #define SCTPCTL_PEER_CHKOH_MIN 0 From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 14:39:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1251065670; Sat, 7 Jan 2012 14:39:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A17F8FC08; Sat, 7 Jan 2012 14:39:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q07EdjlU043791; Sat, 7 Jan 2012 14:39:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07EdjZu043789; Sat, 7 Jan 2012 14:39:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201071439.q07EdjZu043789@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 7 Jan 2012 14:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229777 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 14:39:46 -0000 Author: glebius Date: Sat Jan 7 14:39:45 2012 New Revision: 229777 URL: http://svn.freebsd.org/changeset/base/229777 Log: Merge from OpenBSD: revision 1.170 date: 2011/10/30 23:04:38; author: mikeb; state: Exp; lines: +6 -7 Allow setting big MTU values on the pfsync interface but not larger than the syncdev MTU. Prompted by the discussion with and tested by Maxim Bourmistrov; ok dlg, mpf Consistently use sc_ifp->if_mtu in the MTU check throughout the module. This backs out r228813. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Sat Jan 7 14:35:37 2012 (r229776) +++ head/sys/contrib/pf/net/if_pfsync.c Sat Jan 7 14:39:45 2012 (r229777) @@ -47,6 +47,7 @@ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions + * 1.170 - SIOCSIFMTU checks */ #ifdef __FreeBSD__ @@ -492,13 +493,12 @@ pfsync_clone_create(struct if_clone *ifc ifp->if_type = IFT_PFSYNC; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_hdrlen = sizeof(struct pfsync_header); - ifp->if_mtu = 1500; /* XXX */ + ifp->if_mtu = ETHERMTU; #ifdef __FreeBSD__ callout_init(&sc->sc_tmo, CALLOUT_MPSAFE); callout_init_mtx(&sc->sc_bulk_tmo, &pf_task_mtx, 0); callout_init(&sc->sc_bulkfail_tmo, CALLOUT_MPSAFE); #else - ifp->if_hardmtu = MCLBYTES; /* XXX */ timeout_set(&sc->sc_tmo, pfsync_timeout, sc); timeout_set(&sc->sc_bulk_tmo, pfsync_bulk_update, sc); timeout_set(&sc->sc_bulkfail_tmo, pfsync_bulk_fail, sc); @@ -1614,7 +1614,7 @@ pfsync_in_bus(struct pfsync_pkt *pkt, st #ifdef __FreeBSD__ callout_reset(&sc->sc_bulkfail_tmo, 4 * hz + V_pf_pool_limits[PF_LIMIT_STATES].limit / - ((sc->sc_sync_if->if_mtu - PFSYNC_MINPKT) / + ((sc->sc_ifp->if_mtu - PFSYNC_MINPKT) / sizeof(struct pfsync_state)), pfsync_bulk_fail, V_pfsyncif); #else @@ -1821,10 +1821,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cm #endif break; case SIOCSIFMTU: - if (ifr->ifr_mtu <= PFSYNC_MINPKT) + if (!sc->sc_sync_if || + ifr->ifr_mtu <= PFSYNC_MINPKT || + ifr->ifr_mtu > sc->sc_sync_if->if_mtu) return (EINVAL); - if (ifr->ifr_mtu > MCLBYTES) /* XXX could be bigger */ - ifr->ifr_mtu = MCLBYTES; if (ifr->ifr_mtu < ifp->if_mtu) { s = splnet(); #ifdef __FreeBSD__ @@ -2667,7 +2667,7 @@ pfsync_request_update(u_int32_t creatori nlen += sizeof(struct pfsync_subheader); #ifdef __FreeBSD__ - if (sc->sc_len + nlen > sc->sc_sync_if->if_mtu) { + if (sc->sc_len + nlen > sc->sc_ifp->if_mtu) { #else if (sc->sc_len + nlen > sc->sc_if.if_mtu) { #endif From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:09:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB2C106564A; Sat, 7 Jan 2012 16:09:34 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 360FA8FC0A; Sat, 7 Jan 2012 16:09: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 q07G9Yl9046662; Sat, 7 Jan 2012 16:09:34 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07G9XPV046637; Sat, 7 Jan 2012 16:09:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071609.q07G9XPV046637@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229778 - in head/sbin: bsdlabel camcontrol devfs dhclient fsck_ffs hastctl hastd ifconfig ipfw mdmfs mount_nfs ping6 reboot routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:09:34 -0000 Author: uqs Date: Sat Jan 7 16:09:33 2012 New Revision: 229778 URL: http://svn.freebsd.org/changeset/base/229778 Log: Spelling fixes for sbin/ Modified: head/sbin/bsdlabel/bsdlabel.c head/sbin/camcontrol/camcontrol.c head/sbin/devfs/rule.c head/sbin/dhclient/dhclient-script.8 head/sbin/dhclient/options.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsutil.c head/sbin/hastctl/hastctl.8 head/sbin/hastd/activemap.c head/sbin/hastd/hast_compression.c head/sbin/hastd/hastd.c head/sbin/hastd/lzf.h head/sbin/hastd/primary.c head/sbin/hastd/proto.c head/sbin/ifconfig/ifieee80211.c head/sbin/ipfw/ipfw2.c head/sbin/ipfw/main.c head/sbin/mdmfs/mdmfs.c head/sbin/mount_nfs/mount_nfs.c head/sbin/ping6/ping6.c head/sbin/reboot/nextboot.8 head/sbin/routed/main.c head/sbin/routed/radix.c head/sbin/routed/table.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/bsdlabel/bsdlabel.c Sat Jan 7 16:09:33 2012 (r229778) @@ -189,8 +189,8 @@ main(int argc, char *argv[]) break; case 'r': /* - * We accept and ignode -r for compatibility with - * historically disklabel usage. + * We accept and ignore -r for compatibility with + * historical disklabel usage. */ break; case 'w': @@ -386,7 +386,7 @@ writelabel(void) struct disklabel *lp = &lab; if (disable_write) { - warnx("write to disk label supressed - label was as follows:"); + warnx("write to disk label suppressed - label was as follows:"); display(stdout, NULL); return (0); } @@ -1512,8 +1512,8 @@ getvirginlabel(void) loclab.d_secperunit = mediasize / secsize; /* - * Nobody in these enligthened days uses the CHS geometry for - * anything, but nontheless try to get it right. If we fail + * Nobody in these enlightened days uses the CHS geometry for + * anything, but nonetheless try to get it right. If we fail * to get any good ideas from the device, construct something * which is IBM-PC friendly. */ Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/camcontrol/camcontrol.c Sat Jan 7 16:09:33 2012 (r229778) @@ -5732,7 +5732,7 @@ usage(int verbose) "defects arguments:\n" "-f format specify defect list format (block, bfi or phys)\n" "-G get the grown defect list\n" -"-P get the permanant defect list\n" +"-P get the permanent defect list\n" "inquiry arguments:\n" "-D get the standard inquiry data\n" "-S get the serial number\n" Modified: head/sbin/devfs/rule.c ============================================================================== --- head/sbin/devfs/rule.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/devfs/rule.c Sat Jan 7 16:09:33 2012 (r229778) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -static void rulespec_infp(FILE *fp, unsigned long reqest, devfs_rsnum rsnum); +static void rulespec_infp(FILE *fp, unsigned long request, devfs_rsnum rsnum); static void rulespec_instr(struct devfs_rule *dr, const char *str, devfs_rsnum rsnum); static void rulespec_intok(struct devfs_rule *dr, int ac, char **av, Modified: head/sbin/dhclient/dhclient-script.8 ============================================================================== --- head/sbin/dhclient/dhclient-script.8 Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/dhclient/dhclient-script.8 Sat Jan 7 16:09:33 2012 (r229778) @@ -232,7 +232,7 @@ will check for the existence of .Pa /etc/dhclient-exit-hooks . If found, it will be sourced .Pq see Xr sh 1 . -These hooks scripts can be used to dynamically modify the enviornment at +These hooks scripts can be used to dynamically modify the environment at appropriate times during the DHCP negotiations. For example, if the administrator wishes to disable alias IP numbers on the DHCP interface, they might want to put the following in Modified: head/sbin/dhclient/options.c ============================================================================== --- head/sbin/dhclient/options.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/dhclient/options.c Sat Jan 7 16:09:33 2012 (r229778) @@ -284,8 +284,8 @@ find_search_domain_name_len(struct optio option->data[i + 1]; if (pointer >= *offset) { /* - * The pointer must indicates a prior - * occurance. + * The pointer must indicate a prior + * occurrence. */ warning("Invalid forward pointer in DHCP " "Domain Search option compression."); Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/fsck_ffs/fsck.h Sat Jan 7 16:09:33 2012 (r229778) @@ -220,7 +220,7 @@ struct inodesc { * To check if a block has been found as a duplicate it is only * necessary to search from duplist through muldup. To find the * total number of times that a block has been found as a duplicate - * the entire list must be searched for occurences of the block + * the entire list must be searched for occurrences of the block * in question. The following diagram shows a sample list where * w (found twice), x (found once), y (found three times), and z * (found once) are duplicate block numbers: Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/fsck_ffs/fsutil.c Sat Jan 7 16:09:33 2012 (r229778) @@ -717,7 +717,7 @@ dofix(struct inodesc *idesc, const char #include /* - * An unexpected inconsistency occured. + * An unexpected inconsistency occurred. * Die if preening or file system is running with soft dependency protocol, * otherwise just print message and continue. */ Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastctl/hastctl.8 Sat Jan 7 16:09:33 2012 (r229778) @@ -97,7 +97,7 @@ If extent size is too small, there will related to dirty map updates, which will degrade performance of the given resource. If extent size is too large, synchronization, even in case of short -outage, can take a long time increasing the risk of loosing up-to-date +outage, can take a long time increasing the risk of losing up-to-date node before synchronization process is completed. The default extent size is .Va 2MB . Modified: head/sbin/hastd/activemap.c ============================================================================== --- head/sbin/hastd/activemap.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastd/activemap.c Sat Jan 7 16:09:33 2012 (r229778) @@ -219,7 +219,7 @@ keepdirty_add(struct activemap *amp, int kd = keepdirty_find(amp, extent); if (kd != NULL) { /* - * Only move element at the begining. + * Only move element at the beginning. */ TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); @@ -573,7 +573,7 @@ activemap_sync_rewind(struct activemap * return; } /* - * Mark that we want to start synchronization from the begining. + * Mark that we want to start synchronization from the beginning. */ amp->am_syncoff = -1; } Modified: head/sbin/hastd/hast_compression.c ============================================================================== --- head/sbin/hastd/hast_compression.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastd/hast_compression.c Sat Jan 7 16:09:33 2012 (r229778) @@ -55,7 +55,7 @@ allzeros(const void *data, size_t size) * Because inside the loop we don't check at every step, we would * get an answer only after walking through entire buffer. * To return early if the buffer doesn't contain all zeros, we probe - * 8 bytes at the begining, in the middle and at the end of the buffer + * 8 bytes at the beginning, in the middle and at the end of the buffer * first. */ Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastd/hastd.c Sat Jan 7 16:09:33 2012 (r229778) @@ -786,7 +786,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_debug(2, "%s: resource=%s", raddr, resname); token = nv_get_uint8_array(nvin, &size, "token"); /* - * NULL token means that this is first conection. + * NULL token means that this is first connection. */ if (token != NULL && size != sizeof(res->hr_token)) { pjdlog_error("Received token of invalid size from %s (expected %zu, got %zu).", Modified: head/sbin/hastd/lzf.h ============================================================================== --- head/sbin/hastd/lzf.h Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastd/lzf.h Sat Jan 7 16:09:33 2012 (r229778) @@ -146,7 +146,7 @@ lzf_decompress (const void *const in_dat /* * Avoid assigning values to errno variable? for some embedding purposes - * (linux kernel for example), this is neccessary. NOTE: this breaks + * (linux kernel for example), this is necessary. NOTE: this breaks * the documentation in lzf.h. */ #ifndef AVOID_ERRNO @@ -167,7 +167,7 @@ lzf_decompress (const void *const in_dat * and return EINVAL if the input stream has been corrupted. This * only shields against overflowing the input buffer and will not * detect most corrupted streams. - * This check is not normally noticable on modern hardware + * This check is not normally noticeable on modern hardware * (<1% slowdown), but might slow down older cpus considerably. */ #ifndef CHECK_INPUT Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastd/primary.c Sat Jan 7 16:09:33 2012 (r229778) @@ -933,7 +933,7 @@ hastd_primary(struct hast_resource *res) /* * Create the guard thread first, so we can handle signals from the - * very begining. + * very beginning. */ error = pthread_create(&td, NULL, guard_thread, res); PJDLOG_ASSERT(error == 0); Modified: head/sbin/hastd/proto.c ============================================================================== --- head/sbin/hastd/proto.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/hastd/proto.c Sat Jan 7 16:09:33 2012 (r229778) @@ -131,7 +131,7 @@ proto_common_setup(const char *srcaddr, /* * ret == 0 - success * ret == -1 - dstaddr is not for this protocol - * ret > 0 - right protocol, but an error occured + * ret > 0 - right protocol, but an error occurred */ if (ret >= 0) break; @@ -142,7 +142,7 @@ proto_common_setup(const char *srcaddr, return (-1); } if (ret > 0) { - /* An error occured. */ + /* An error occurred. */ errno = ret; return (-1); } Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/ifconfig/ifieee80211.c Sat Jan 7 16:09:33 2012 (r229778) @@ -884,7 +884,7 @@ set80211wepkey(const char *val, int d, i } /* - * This function is purely a NetBSD compatability interface. The NetBSD + * This function is purely a NetBSD compatibility interface. The NetBSD * interface is too inflexible, but it's there so we'll support it since * it's not all that hard. */ Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/ipfw/ipfw2.c Sat Jan 7 16:09:33 2012 (r229778) @@ -454,8 +454,8 @@ _substrcmp(const char *str1, const char* * of the first. A warning is printed to stderr in the case that the * first string does not match the third. * - * This function exists to warn about the bizzare construction - * strncmp(str, "by", 2) which is used to allow people to use a shotcut + * This function exists to warn about the bizarre construction + * strncmp(str, "by", 2) which is used to allow people to use a shortcut * for "bytes". The problem is that in addition to accepting "by", * "byt", "byte", and "bytes", it also excepts "by_rabid_dogs" and any * other string beginning with "by". @@ -2866,9 +2866,9 @@ chkarg: ((struct sockaddr_in*)&result)->sin_addr.s_addr = INADDR_ANY; } else { - /* + /* * Resolve the host name or address to a family and a - * network representation of the addres. + * network representation of the address. */ if (getaddrinfo(*av, NULL, NULL, &res)) errx(EX_DATAERR, NULL); Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/ipfw/main.c Sat Jan 7 16:09:33 2012 (r229778) @@ -167,7 +167,7 @@ ipfw_main(int oldac, char **oldav) i++; bcopy(arg+j, av_p, i-j); av[ac] = av_p; - av_p += i-j; /* the lenght of the string */ + av_p += i-j; /* the length of the string */ *av_p++ = '\0'; ac++; j = i + 1; Modified: head/sbin/mdmfs/mdmfs.c ============================================================================== --- head/sbin/mdmfs/mdmfs.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/mdmfs/mdmfs.c Sat Jan 7 16:09:33 2012 (r229778) @@ -632,7 +632,7 @@ run(int *ofd, const char *cmdline, ...) * loop. */ (void)fprintf(stderr, "DEBUG: running:"); - /* Should be equivilent to 'cmd' (before strsep, of course). */ + /* Should be equivalent to 'cmd' (before strsep, of course). */ for (i = 0; argv[i] != NULL; i++) (void)fprintf(stderr, " %s", argv[i]); (void)fprintf(stderr, "\n"); Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/mount_nfs/mount_nfs.c Sat Jan 7 16:09:33 2012 (r229778) @@ -788,7 +788,7 @@ getnfsargs(char *spec, struct iovec **io for (;;) { /* * Try each entry returned by getaddrinfo(). Note the - * occurence of remote errors by setting `remoteerr'. + * occurrence of remote errors by setting `remoteerr'. */ remoteerr = 0; for (ai = ai_nfs; ai != NULL; ai = ai->ai_next) { Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/ping6/ping6.c Sat Jan 7 16:09:33 2012 (r229778) @@ -1166,7 +1166,7 @@ main(int argc, char *argv[]) /* * receive control messages only. Process the - * exceptions (currently the only possiblity is + * exceptions (currently the only possibility is * a path MTU notification.) */ if ((mtu = get_pathmtu(&m)) > 0) { Modified: head/sbin/reboot/nextboot.8 ============================================================================== --- head/sbin/reboot/nextboot.8 Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/reboot/nextboot.8 Sat Jan 7 16:09:33 2012 (r229778) @@ -117,7 +117,7 @@ The .Nm code is implemented in the .Xr loader 8 . -It is not the most throughly tested code. +It is not the most thoroughly tested code. It is also my first attempt to write in Forth. .Pp Finally, it does some evil things like writing to the file system before it Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/routed/main.c Sat Jan 7 16:09:33 2012 (r229778) @@ -414,7 +414,7 @@ usage: continue; } - /* Check the kernel table occassionally for mysteriously + /* Check the kernel table occasionally for mysteriously * evaporated routes */ timevalsub(&t2, &flush_kern_timer, &now); @@ -446,7 +446,7 @@ usage: * the previous update was finished. * Even if we just started after discovering * a 2nd interface or were otherwise delayed, - * pick a 30-second aniversary of the + * pick a 30-second anniversary of the * original broadcast time. */ n = 1 + (0-t2.tv_sec)/SUPPLY_INTERVAL; Modified: head/sbin/routed/radix.c ============================================================================== --- head/sbin/routed/radix.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/routed/radix.c Sat Jan 7 16:09:33 2012 (r229778) @@ -97,7 +97,7 @@ static struct radix_node *rn_match(void * node as high in the tree as we can go. * * The present version of the code makes use of normal routes in short- - * circuiting an explict mask and compare operation when testing whether + * circuiting an explicit mask and compare operation when testing whether * a key satisfies a normal route, and also in remembering the unique leaf * that governs a subtree. */ @@ -247,7 +247,7 @@ rn_match(void *v_arg, * * In this case, we have a complete match of the key. Unless * the node is one of the roots, we are finished. - * If it is the zeros root, then take what we have, prefering + * If it is the zeros root, then take what we have, preferring * any real data. * If it is the ones root, then pretend the target key was followed * by a byte of zeros. Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sat Jan 7 14:39:45 2012 (r229777) +++ head/sbin/routed/table.c Sat Jan 7 16:09:33 2012 (r229778) @@ -2071,7 +2071,7 @@ walk_age(struct radix_node *rn, /* try to switch to an alternative */ rtswitch(RT, 0); - /* Delete a dead route after it has been publically mourned. */ + /* Delete a dead route after it has been publicly mourned. */ if (now_garbage > RT->rt_time) { rtdelete(RT); return 0; From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:09:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F62110657C7; Sat, 7 Jan 2012 16:09:44 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E72B8FC12; Sat, 7 Jan 2012 16:09: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 q07G9i6J046711; Sat, 7 Jan 2012 16:09:44 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07G9iiG046705; Sat, 7 Jan 2012 16:09:44 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071609.q07G9iiG046705@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:09: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: r229779 - in head/release: doc/en_US.ISO8859-1/relnotes picobsd/tinyware/passwd picobsd/tinyware/simple_httpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:09:44 -0000 Author: uqs Date: Sat Jan 7 16:09:43 2012 New Revision: 229779 URL: http://svn.freebsd.org/changeset/base/229779 Log: Spelling fixes for release/ Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml head/release/picobsd/tinyware/passwd/local_passwd.c head/release/picobsd/tinyware/passwd/pw_copy.c head/release/picobsd/tinyware/simple_httpd/README Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sat Jan 7 16:09:33 2012 (r229778) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sat Jan 7 16:09:43 2012 (r229779) @@ -339,7 +339,7 @@ with the same semantics as (for example) &man.chmod.1;. - For compatiblity with other implementations, &man.cp.1; now + For compatibility with other implementations, &man.cp.1; now supports a flag, which is equivalent to specifying the flags. Modified: head/release/picobsd/tinyware/passwd/local_passwd.c ============================================================================== --- head/release/picobsd/tinyware/passwd/local_passwd.c Sat Jan 7 16:09:33 2012 (r229778) +++ head/release/picobsd/tinyware/passwd/local_passwd.c Sat Jan 7 16:09:43 2012 (r229779) @@ -172,7 +172,7 @@ getnewpasswd(pw, nis) to64(&salt[5], random(), 4); salt[9] = '\0'; #else - /* Make a good size salt for algoritms that can use it. */ + /* Make a good size salt for algorithms that can use it. */ gettimeofday(&tv,0); #ifdef LOGIN_CAP if (login_setcryptfmt(lc, "md5", NULL) == NULL) Modified: head/release/picobsd/tinyware/passwd/pw_copy.c ============================================================================== --- head/release/picobsd/tinyware/passwd/pw_copy.c Sat Jan 7 16:09:33 2012 (r229778) +++ head/release/picobsd/tinyware/passwd/pw_copy.c Sat Jan 7 16:09:43 2012 (r229779) @@ -193,7 +193,7 @@ err: pw_error(NULL, 1, 1); * by default, warning for IDs greater than USHRT_MAX. * * If pw_big_ids_warning is anything other than -1 on entry to pw_scan() - * it will be set based on the existance of PW_SCAN_BIG_IDS in the + * it will be set based on the existence of PW_SCAN_BIG_IDS in the * environment. */ int pw_big_ids_warning = -1; Modified: head/release/picobsd/tinyware/simple_httpd/README ============================================================================== --- head/release/picobsd/tinyware/simple_httpd/README Sat Jan 7 16:09:33 2012 (r229778) +++ head/release/picobsd/tinyware/simple_httpd/README Sat Jan 7 16:09:43 2012 (r229779) @@ -21,14 +21,14 @@ of html,gif,cgi whatever. Your traditio The "fetch" mode supports file transfer over httpd. This is best thought of as mate for fetch(1). This feature can be -usefull to transfer a file from one host to another. +useful to transfer a file from one host to another. Simple_httpd has the ability to run CGI scripts. All CGI scripts must be located in ${DOCUMENT_ROOT}/cgi-bin. The -server currently only sets 3 enviroment variables before calling +server currently only sets 3 environment variables before calling the script. -CGI Enviroment variables are below: +CGI Environment variables are below: SERVER_SOFTWARE = FreeBSD/PicoBSD REMOTE_HOST = client.canada_lower_taxes.com @@ -61,7 +61,7 @@ daemonize without fear of output on stdo -D Do not daemonize. The server will not run in the background. It will -stay attached to the tty. This is usefull for debugging. In this +stay attached to the tty. This is useful for debugging. In this mode no log file is created. Logging info is to stdout. This option is automatically selected if fetch option is selected. @@ -139,7 +139,7 @@ receiver# fetch http://sender.com:53/Ind To Do ===== -Simple authentication would be very usefull[understatment]. +Simple authentication would be very useful [understatment]. /etc/passwd or PAM would be nice. I think a netmask option would be good. Most internet appliances From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:09:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EA3F10656D5; Sat, 7 Jan 2012 16:09:55 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 462508FC18; Sat, 7 Jan 2012 16:09:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q07G9tql046772; Sat, 7 Jan 2012 16:09:55 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07G9sDx046751; Sat, 7 Jan 2012 16:09:54 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071609.q07G9sDx046751@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:09: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: r229780 - in head/libexec: bootpd bootpd/bootpgw bootpd/tools/bootptest ftpd getty lukemftpd rbootd revnetgroup rshd rtld-aout rtld-elf rtld-elf/mips rtld-elf/sparc64 tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:09:55 -0000 Author: uqs Date: Sat Jan 7 16:09:54 2012 New Revision: 229780 URL: http://svn.freebsd.org/changeset/base/229780 Log: Spelling fixes for libexec/ Modified: head/libexec/bootpd/bootpd.c head/libexec/bootpd/bootpgw/bootpgw.c head/libexec/bootpd/hash.h head/libexec/bootpd/tools/bootptest/bootptest.c head/libexec/bootpd/tools/bootptest/print-bootp.c head/libexec/ftpd/ftpcmd.y head/libexec/getty/init.c head/libexec/lukemftpd/nbsd_pidfile.h head/libexec/rbootd/parseconf.c head/libexec/rbootd/rbootd.c head/libexec/rbootd/rmpproto.c head/libexec/revnetgroup/parse_netgroup.c head/libexec/rshd/rshd.8 head/libexec/rtld-aout/shlib.c head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/rtld.h head/libexec/rtld-elf/sparc64/reloc.c head/libexec/tftpd/tftp-io.c head/libexec/tftpd/tftp-utils.h Modified: head/libexec/bootpd/bootpd.c ============================================================================== --- head/libexec/bootpd/bootpd.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/bootpd/bootpd.c Sat Jan 7 16:09:54 2012 (r229780) @@ -663,7 +663,7 @@ ignoring request for server %s from clie bp->bp_op = BOOTREPLY; if (bp->bp_ciaddr.s_addr == 0) { /* - * client doesnt know his IP address, + * client doesn't know his IP address, * search by hardware address. */ if (debug > 1) { @@ -1119,7 +1119,7 @@ sendreply(forward, dst_override) /* * This call checks read access to a file. It returns 0 if the file given - * by "path" exists and is publically readable. A value of -1 is returned if + * by "path" exists and is publicly readable. A value of -1 is returned if * access is not permitted or an error occurs. Successful calls also * return the file size in bytes using the long pointer "filesize". * Modified: head/libexec/bootpd/bootpgw/bootpgw.c ============================================================================== --- head/libexec/bootpd/bootpgw/bootpgw.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/bootpd/bootpgw/bootpgw.c Sat Jan 7 16:09:54 2012 (r229780) @@ -534,7 +534,7 @@ handle_request() /* Has this packet hopped too many times? */ hops = bp->bp_hops; if (++hops > maxhops) { - report(LOG_NOTICE, "reqest from %s reached hop limit", + report(LOG_NOTICE, "request from %s reached hop limit", inet_ntoa(recv_addr.sin_addr)); return; } Modified: head/libexec/bootpd/hash.h ============================================================================== --- head/libexec/bootpd/hash.h Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/bootpd/hash.h Sat Jan 7 16:09:54 2012 (r229780) @@ -81,7 +81,7 @@ SOFTWARE. * * A generalized hash function, hash_HashFunction(), is included * with this package to make things a little easier. It is not - * guarenteed to use the best hash algorithm in existence. . . . + * guaranteed to use the best hash algorithm in existence. . . . */ Modified: head/libexec/bootpd/tools/bootptest/bootptest.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/bootptest.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/bootpd/tools/bootptest/bootptest.c Sat Jan 7 16:09:54 2012 (r229780) @@ -186,7 +186,7 @@ main(argc, argv) break; switch (argv[0][1]) { - case 'f': /* File name to reqest. */ + case 'f': /* File name to request. */ if (argc < 2) goto error; argc--; argv++; Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/print-bootp.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/bootpd/tools/bootptest/print-bootp.c Sat Jan 7 16:09:54 2012 (r229780) @@ -187,7 +187,7 @@ bootp_print(bp, length, sport, dport) /* * Option description data follows. - * These are decribed in: RFC-1048, RFC-1395, RFC-1497, RFC-1533 + * These are described in: RFC-1048, RFC-1395, RFC-1497, RFC-1533 * * The first char of each option string encodes the data format: * ?: unknown Modified: head/libexec/ftpd/ftpcmd.y ============================================================================== --- head/libexec/ftpd/ftpcmd.y Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/ftpd/ftpcmd.y Sat Jan 7 16:09:54 2012 (r229780) @@ -1718,7 +1718,7 @@ exptilde(char *s) * Avoid expanding to a pathname including '\r' or '\n' in order to * not disrupt the FTP protocol. * The expansion found must be unique. - * Return the result as a malloced string, or NULL if an error occured. + * Return the result as a malloced string, or NULL if an error occurred. * * Problem: this production is used for all pathname * processing, but only gives a 550 error reply. Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/getty/init.c Sat Jan 7 16:09:54 2012 (r229780) @@ -64,7 +64,7 @@ struct gettystrs gettystrs[] = { { "et", &omode.c_cc[VEOF] }, /* eof chatacter (eot) */ { "pc", nullstr }, /* pad character */ { "tt" }, /* terminal type */ - { "ev" }, /* enviroment */ + { "ev" }, /* environment */ { "lo", loginprg }, /* login program */ { "hn", hostname }, /* host name */ { "he" }, /* host name edit */ Modified: head/libexec/lukemftpd/nbsd_pidfile.h ============================================================================== --- head/libexec/lukemftpd/nbsd_pidfile.h Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/lukemftpd/nbsd_pidfile.h Sat Jan 7 16:09:54 2012 (r229780) @@ -10,7 +10,7 @@ pidfile(const char *basename) pid_t otherpid, childpid; if (basename != NULL) { - errx(EX_USAGE, "Need to impliment NetBSD semantics."); + errx(EX_USAGE, "Need to implement NetBSD semantics."); } pfh = pidfile_open(basename, 0644, &otherpid); Modified: head/libexec/rbootd/parseconf.c ============================================================================== --- head/libexec/rbootd/parseconf.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rbootd/parseconf.c Sat Jan 7 16:09:54 2012 (r229780) @@ -145,7 +145,7 @@ ParseConfig(void) */ if ((addr = ParseAddr(bcp)) == NULL) { syslog(LOG_ERR, - "ParseConfig: line %d: cant parse <%s>", + "ParseConfig: line %d: can't parse <%s>", linecnt, bcp); continue; } @@ -193,7 +193,7 @@ ParseConfig(void) /* * Restricted list of boot files were spec'd, * however, none of them were found. Since we - * apparently cant let them boot "just anything", + * apparently can't let them boot "just anything", * the entire record is invalidated. */ if (i == 0) { @@ -355,7 +355,7 @@ GetBootFiles(void) (void) closedir(dfd); /* close BootDir */ - if (i == 0) /* cant find any boot files */ + if (i == 0) /* can't find any boot files */ syslog(LOG_ERR, "GetBootFiles: no boot files (%s)\n", BootDir); return(i); Modified: head/libexec/rbootd/rbootd.c ============================================================================== --- head/libexec/rbootd/rbootd.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rbootd/rbootd.c Sat Jan 7 16:09:54 2012 (r229780) @@ -231,7 +231,7 @@ main(int argc, char *argv[]) r = rset; - if (RmpConns == NULL) { /* timeout isnt necessary */ + if (RmpConns == NULL) { /* timeout isn't necessary */ nsel = select(maxfds, &r, NULL, NULL, NULL); } else { timeout.tv_sec = RMP_TIMEOUT; Modified: head/libexec/rbootd/rmpproto.c ============================================================================== --- head/libexec/rbootd/rmpproto.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rbootd/rmpproto.c Sat Jan 7 16:09:54 2012 (r229780) @@ -401,7 +401,7 @@ SendReadRepl(RMPCONN *rconn) int madeconn = 0; /* - * Find the old connection. If one doesnt exist, create one only + * Find the old connection. If one doesn't exist, create one only * to return the error code. */ if ((oldconn = FindConn(rconn)) == NULL) { @@ -515,7 +515,7 @@ BootDone(RMPCONN *rconn) struct rmp_packet *rpl; /* - * If we cant find the connection, ignore the request. + * If we can't find the connection, ignore the request. */ if ((oldconn = FindConn(rconn)) == NULL) { syslog(LOG_ERR, "BootDone: no existing connection (%s)", Modified: head/libexec/revnetgroup/parse_netgroup.c ============================================================================== --- head/libexec/revnetgroup/parse_netgroup.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/revnetgroup/parse_netgroup.c Sat Jan 7 16:09:54 2012 (r229780) @@ -199,8 +199,8 @@ parse_netgrp(char *group) if (lp->l_parsed) { #ifdef DEBUG /* - * This error message is largely superflous since the - * code handles the error condition sucessfully, and + * This error message is largely superfluous since the + * code handles the error condition successfully, and * spewing it out from inside libc can actually hose * certain programs. */ Modified: head/libexec/rshd/rshd.8 ============================================================================== --- head/libexec/rshd/rshd.8 Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rshd/rshd.8 Sat Jan 7 16:09:54 2012 (r229780) @@ -148,7 +148,7 @@ by The options are as follows: .Bl -tag -width indent .It Fl a -This flag is ignored, and is present for compatability purposes. +This flag is ignored, and is present for compatibility purposes. .It Fl D Sets the TCP_NODELAY socket option, which improves the performance of small back-to-back writes at the expense of additional network Modified: head/libexec/rtld-aout/shlib.c ============================================================================== --- head/libexec/rtld-aout/shlib.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rtld-aout/shlib.c Sat Jan 7 16:09:54 2012 (r229780) @@ -159,7 +159,7 @@ cmpndewey(int d1[], int n1, int d2[], in if (i == n2) return 1; - errx(1, "cmpndewey: cant happen"); + errx(1, "cmpndewey: can't happen"); return 0; } Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rtld-elf/mips/reloc.c Sat Jan 7 16:09:54 2012 (r229780) @@ -358,7 +358,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry def = find_symdef(i, obj, &defobj, false, NULL, lockstate); if (def == NULL) { - dbg("Warning4, cant find symbole %d", i); + dbg("Warning4, can't find symbole %d", i); return -1; } *got = def->st_value + (Elf_Addr)defobj->relocbase; Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rtld-elf/rtld.h Sat Jan 7 16:09:54 2012 (r229780) @@ -238,7 +238,7 @@ typedef struct Struct_Obj_Entry { Objlist dagmembers; /* DAG has these members (%) */ dev_t dev; /* Object's filesystem's device */ ino_t ino; /* Object's inode number */ - void *priv; /* Platform-dependant */ + void *priv; /* Platform-dependent */ } Obj_Entry; #define RTLD_MAGIC 0xd550b87a Modified: head/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/sparc64/reloc.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/rtld-elf/sparc64/reloc.c Sat Jan 7 16:09:54 2012 (r229780) @@ -623,7 +623,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr flush(where, 4); } else if (target >= 0 && target < (1L<<32)) { /* - * We're withing 32-bits of address zero. + * We're within 32-bits of address zero. * * The resulting code in the jump slot is: * @@ -643,7 +643,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr flush(where, 4); } else if (target <= 0 && target > -(1L<<32)) { /* - * We're withing 32-bits of address -1. + * We're within 32-bits of address -1. * * The resulting code in the jump slot is: * @@ -665,7 +665,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr flush(where, 4); } else if (offset <= (1L<<32) && offset >= -((1L<<32) - 4)) { /* - * We're withing 32-bits -- we can use a direct call + * We're within 32-bits -- we can use a direct call * insn * * The resulting code in the jump slot is: @@ -688,7 +688,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr flush(where, 4); } else if (offset >= 0 && offset < (1L<<44)) { /* - * We're withing 44 bits. We can generate this + * We're within 44 bits. We can generate this * pattern: * * The resulting code in the jump slot is: @@ -713,7 +713,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr flush(where, 4); } else if (offset < 0 && offset > -(1L<<44)) { /* - * We're withing 44 bits. We can generate this + * We're within 44 bits. We can generate this * pattern: * * The resulting code in the jump slot is: Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/tftpd/tftp-io.c Sat Jan 7 16:09:54 2012 (r229780) @@ -72,13 +72,13 @@ struct errmsg { #define DROPPACKET(s) \ if (packetdroppercentage != 0 && \ random()%100 < packetdroppercentage) { \ - tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s); \ + tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return; \ } #define DROPPACKETn(s,n) \ if (packetdroppercentage != 0 && \ random()%100 < packetdroppercentage) { \ - tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s); \ + tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return (n); \ } Modified: head/libexec/tftpd/tftp-utils.h ============================================================================== --- head/libexec/tftpd/tftp-utils.h Sat Jan 7 16:09:43 2012 (r229779) +++ head/libexec/tftpd/tftp-utils.h Sat Jan 7 16:09:54 2012 (r229780) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); #define MAXPKTSIZE (MAXSEGSIZE + 4) /* Maximum size of the packet */ /* For the blksize option */ -#define BLKSIZE_MIN 8 /* Minumum size of the data segment */ +#define BLKSIZE_MIN 8 /* Minimum size of the data segment */ #define BLKSIZE_MAX MAXSEGSIZE /* Maximum size of the data segment */ /* For the timeout option */ -#define TIMEOUT_MIN 0 /* Minumum timeout value */ +#define TIMEOUT_MIN 0 /* Minimum timeout value */ #define TIMEOUT_MAX 255 /* Maximum timeout value */ #define MIN_TIMEOUTS 3 From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:10:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F026710656D7; Sat, 7 Jan 2012 16:10:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8E998FC15; Sat, 7 Jan 2012 16:10: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 q07GAFsU046832; Sat, 7 Jan 2012 16:10:15 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07GAFji046824; Sat, 7 Jan 2012 16:10:15 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071610.q07GAFji046824@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:10: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: r229781 - in head/include: . arpa gssapi rpc rpcsvc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:10:16 -0000 Author: uqs Date: Sat Jan 7 16:10:15 2012 New Revision: 229781 URL: http://svn.freebsd.org/changeset/base/229781 Log: Spelling fixes for include/ Modified: head/include/arpa/nameser_compat.h head/include/gssapi/gssapi.h head/include/resolv.h head/include/rpc/svc.h head/include/rpcsvc/mount.x head/include/rpcsvc/nfs_prot.x head/include/rpcsvc/nis.x Modified: head/include/arpa/nameser_compat.h ============================================================================== --- head/include/arpa/nameser_compat.h Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/arpa/nameser_compat.h Sat Jan 7 16:10:15 2012 (r229781) @@ -63,7 +63,7 @@ typedef struct { /* fields in third byte */ unsigned qr: 1; /*%< response flag */ unsigned opcode: 4; /*%< purpose of message */ - unsigned aa: 1; /*%< authoritive answer */ + unsigned aa: 1; /*%< authoritative answer */ unsigned tc: 1; /*%< truncated message */ unsigned rd: 1; /*%< recursion desired */ /* fields in fourth byte */ @@ -77,7 +77,7 @@ typedef struct { /* fields in third byte */ unsigned rd :1; /*%< recursion desired */ unsigned tc :1; /*%< truncated message */ - unsigned aa :1; /*%< authoritive answer */ + unsigned aa :1; /*%< authoritative answer */ unsigned opcode :4; /*%< purpose of message */ unsigned qr :1; /*%< response flag */ /* fields in fourth byte */ Modified: head/include/gssapi/gssapi.h ============================================================================== --- head/include/gssapi/gssapi.h Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/gssapi/gssapi.h Sat Jan 7 16:10:15 2012 (r229781) @@ -756,11 +756,11 @@ OM_uint32 gss_release_oid OM_uint32 gss_decapsulate_token (const gss_buffer_t, /* mechanism independent token */ gss_OID, /* desired mechanism */ - gss_buffer_t /* decapsulated mechanism dependant token */ + gss_buffer_t /* decapsulated mechanism dependent token */ ); OM_uint32 gss_encapsulate_token - (const gss_buffer_t, /* mechanism dependant token */ + (const gss_buffer_t, /* mechanism dependent token */ gss_OID, /* desired mechanism */ gss_buffer_t /* encapsulated mechanism independent token */ ); Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/resolv.h Sat Jan 7 16:10:15 2012 (r229781) @@ -184,7 +184,7 @@ struct __res_state { u_int16_t nscount; u_int16_t nstimes[MAXNS]; /*%< ms. */ int nssocks[MAXNS]; - struct __res_state_ext *ext; /*%< extention for IPv6 */ + struct __res_state_ext *ext; /*%< extension for IPv6 */ } _ext; } _u; }; Modified: head/include/rpc/svc.h ============================================================================== --- head/include/rpc/svc.h Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/rpc/svc.h Sat Jan 7 16:10:15 2012 (r229781) @@ -314,7 +314,7 @@ __END_DECLS * Somebody has to wait for incoming requests and then call the correct * service routine. The routine svc_run does infinite waiting; i.e., * svc_run never returns. - * Since another (co-existant) package may wish to selectively wait for + * Since another (co-existent) package may wish to selectively wait for * incoming calls or other events outside of the rpc architecture, the * routine svc_getreq is provided. It must be passed readfds, the * "in-place" results of a select system call (see select, section 2). Modified: head/include/rpcsvc/mount.x ============================================================================== --- head/include/rpcsvc/mount.x Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/rpcsvc/mount.x Sat Jan 7 16:10:15 2012 (r229781) @@ -150,7 +150,7 @@ program MOUNTPROG { version MOUNTVERS { /* * Does no work. It is made available in all RPC services - * to allow server reponse testing and timing + * to allow server response testing and timing */ void MOUNTPROC_NULL(void) = 0; @@ -205,7 +205,7 @@ program MOUNTPROG { version MOUNTVERS3 { /* * Does no work. It is made available in all RPC services - * to allow server reponse testing and timing + * to allow server response testing and timing */ void MOUNTPROC_NULL(void) = 0; Modified: head/include/rpcsvc/nfs_prot.x ============================================================================== --- head/include/rpcsvc/nfs_prot.x Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/rpcsvc/nfs_prot.x Sat Jan 7 16:10:15 2012 (r229781) @@ -121,7 +121,7 @@ struct fattr { unsigned uid; /* owner user id */ unsigned gid; /* owner group id */ unsigned size; /* file size in bytes */ - unsigned blocksize; /* prefered block size */ + unsigned blocksize; /* preferred block size */ unsigned rdev; /* special device # */ unsigned blocks; /* Kb of disk used by file */ unsigned fsid; /* device # */ @@ -402,7 +402,7 @@ struct fattr3 { uid3 uid; /* owner user id */ gid3 gid; /* owner group id */ size3 size; /* file size in bytes */ - size3 used; /* prefered block size */ + size3 used; /* preferred block size */ specdata3 rdev; /* special device # */ uint64 fsid; /* device # */ fileid3 fileid; /* inode # */ Modified: head/include/rpcsvc/nis.x ============================================================================== --- head/include/rpcsvc/nis.x Sat Jan 7 16:09:54 2012 (r229780) +++ head/include/rpcsvc/nis.x Sat Jan 7 16:10:15 2012 (r229781) @@ -192,8 +192,8 @@ struct ping_args { * note that modifications will appear as two entries, for names, they have * an "OLD" entry followed by a "NEW" entry. For entries in tables, there * is a remove followed by an add. It is done this way so that we can read - * the log backwards to back out transactions and forwards to propogate - * updated. + * the log backwards to back out transactions and forwards to propagate + * updates. */ enum log_entry_t { LOG_NOP = 0, From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:10:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 366C110656E9; Sat, 7 Jan 2012 16:10:24 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 214188FC1B; Sat, 7 Jan 2012 16:10: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 q07GANU7046874; Sat, 7 Jan 2012 16:10:23 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07GANCs046872; Sat, 7 Jan 2012 16:10:23 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071610.q07GANCs046872@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229782 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:10:24 -0000 Author: uqs Date: Sat Jan 7 16:10:23 2012 New Revision: 229782 URL: http://svn.freebsd.org/changeset/base/229782 Log: Spelling fixes for bin/ Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Sat Jan 7 16:10:15 2012 (r229781) +++ head/bin/ps/ps.c Sat Jan 7 16:10:23 2012 (r229782) @@ -625,7 +625,7 @@ main(int argc, char *argv[]) ks = STAILQ_FIRST(&kinfo[i].ki_ks); STAILQ_REMOVE_HEAD(&kinfo[i].ki_ks, ks_next); - /* Truncate rightmost column if neccessary. */ + /* Truncate rightmost column if necessary. */ if (STAILQ_NEXT(vent, next_ve) == NULL && termwidth != UNLIMITED && ks->ks_str != NULL) { left = termwidth - linelen; From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:10:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DECA106573C; Sat, 7 Jan 2012 16:10:33 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D23918FC16; Sat, 7 Jan 2012 16:10: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 q07GAWiq046922; Sat, 7 Jan 2012 16:10:32 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07GAWZA046912; Sat, 7 Jan 2012 16:10:32 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071610.q07GAWZA046912@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:10: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: r229783 - in head/etc: . namedb rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:10:33 -0000 Author: uqs Date: Sat Jan 7 16:10:32 2012 New Revision: 229783 URL: http://svn.freebsd.org/changeset/base/229783 Log: Spelling fixes for etc/ Modified: head/etc/mac.conf head/etc/namedb/named.conf head/etc/network.subr head/etc/rc.d/bgfsck head/etc/rc.firewall head/etc/rc.initdiskless head/etc/rc.subr head/etc/services Modified: head/etc/mac.conf ============================================================================== --- head/etc/mac.conf Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/mac.conf Sat Jan 7 16:10:32 2012 (r229783) @@ -3,7 +3,7 @@ # # TrustedBSD MAC userland policy configuration file. Kernel modules # export label information, and mac.conf indicates to userland -# applications what defaults they should use in the absense of any +# applications what defaults they should use in the absence of any # other user-provided information. # Modified: head/etc/namedb/named.conf ============================================================================== --- head/etc/namedb/named.conf Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/namedb/named.conf Sat Jan 7 16:10:32 2012 (r229783) @@ -94,7 +94,7 @@ zone "." { type hint; file "/etc/namedb/ As documented at http://dns.icann.org/services/axfr/ these zones: "." (the root), ARPA, IN-ADDR.ARPA, IP6.ARPA, and ROOT-SERVERS.NET - are availble for AXFR from these servers on IPv4 and IPv6: + are available for AXFR from these servers on IPv4 and IPv6: xfr.lax.dns.icann.org, xfr.cjr.dns.icann.org */ /* Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/network.subr Sat Jan 7 16:10:32 2012 (r229783) @@ -139,7 +139,7 @@ ifconfig_up() _cfg=0 fi - # backward compatiblity: $ipv6_ifconfig_IF + # backward compatibility: $ipv6_ifconfig_IF ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF` if [ -n "${ifconfig_args}" ]; then warn "\$ipv6_ifconfig_$1 is obsolete." \ Modified: head/etc/rc.d/bgfsck ============================================================================== --- head/etc/rc.d/bgfsck Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/rc.d/bgfsck Sat Jan 7 16:10:32 2012 (r229783) @@ -22,7 +22,7 @@ bgfsck_start () background_fsck_delay=0 fi if [ ${background_fsck_delay} -lt 0 ]; then - echo "Background file system checks delayed indefinitly" + echo "Background file system checks delayed indefinitely" return 0 fi Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/rc.firewall Sat Jan 7 16:10:32 2012 (r229783) @@ -46,7 +46,7 @@ fi # client - will try to protect just this machine # simple - will try to protect a whole network # closed - totally disables IP services except via lo0 interface -# workstation - will try to protect just this machine using statefull +# workstation - will try to protect just this machine using stateful # firewalling. See below for rc.conf variables used # UNKNOWN - disables the loading of firewall rules. # filename - will load the rules in the given filename (full path required) @@ -105,7 +105,7 @@ setup_ipv6_mandatory () { ${fwcmd} add pass ipv6-icmp from fe80::/10 to fe80::/10 ${fwcmd} add pass ipv6-icmp from fe80::/10 to ff02::/16 - # Allow ICMPv6 destination unreach + # Allow ICMPv6 destination unreachable ${fwcmd} add pass ipv6-icmp from any to any icmp6types 1 # Allow NS/NA/toobig (don't filter it out) @@ -437,7 +437,7 @@ case ${firewall_type} in # default denied packets should be # logged (in /var/log/security). # firewall_nologports: List of TCP/UDP ports for which - # denied incomming packets are not + # denied incoming packets are not # logged. # Allow packets for which a state has been built. @@ -505,7 +505,7 @@ case ${firewall_type} in ${fwcmd} add deny { tcp or udp } from any to any $i in done - # Broadcasts and muticasts + # Broadcasts and multicasts ${fwcmd} add deny ip from any to 255.255.255.255 ${fwcmd} add deny ip from any to 224.0.0.0/24 in # XXX @@ -513,7 +513,7 @@ case ${firewall_type} in ${fwcmd} add deny udp from any to any 520 in # Noise from webbrowsing. - # The statefull filter is a bit agressive, and will cause some + # The stateful filter is a bit aggressive, and will cause some # connection teardowns to be logged. ${fwcmd} add deny tcp from any 80,443 to any 1024-65535 in Modified: head/etc/rc.initdiskless ============================================================================== --- head/etc/rc.initdiskless Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/rc.initdiskless Sat Jan 7 16:10:32 2012 (r229783) @@ -46,16 +46,16 @@ # bcast/${ipba} same as above # ${class} where ${class} is a list of directories supplied by # bootp/dhcp through the T134 option. -# ${ipba} and ${class} are typicall used to configure features +# ${ipba} and ${class} are typically used to configure features # for group of diskless clients, or even individual features; # ${ip} where ${ip} is the machine's assigned IP address, typically # used to set host-specific features; # ip/${ip} same as above # # Template directories are scanned in the order they are listed above, -# with each sucessive directory overriding (merged into) the previous one; +# with each successive directory overriding (merged into) the previous one; # non-existing directories are ignored. The subdirectory forms exist to -# help keep the top level /conf managable in large installations. +# help keep the top level /conf manageable in large installations. # # The existence of a directory /conf/T/M causes this script to create a # memory filesystem mounted as /M on the client. Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/rc.subr Sat Jan 7 16:10:32 2012 (r229783) @@ -1280,7 +1280,7 @@ backup_file() # Make a symbolic link 'link' to src from basedir. If the # directory in which link is to be created does not exist # a warning will be displayed and an error will be returned. -# Returns 0 on sucess, 1 otherwise. +# Returns 0 on success, 1 otherwise. # make_symlink() { Modified: head/etc/services ============================================================================== --- head/etc/services Sat Jan 7 16:10:23 2012 (r229782) +++ head/etc/services Sat Jan 7 16:10:32 2012 (r229783) @@ -795,7 +795,7 @@ alpes 463/udp kpasswd5 464/tcp # Kerberos (v5) kpasswd5 464/udp # Kerberos (v5) #PROBLEMS!============================================================== -# IANA has offically assigned these two ports as ``kpasswd'' +# IANA has officially assigned these two ports as ``kpasswd'' #kpasswd 464/tcp # Kerberos (v5) #kpasswd 464/udp # Kerberos (v5) #PROBLEMS!============================================================== @@ -1275,8 +1275,8 @@ hcp-wismar 686/tcp #Hardware Con hcp-wismar 686/udp #Hardware Control Protocol Wismar asipregistry 687/tcp asipregistry 687/udp -realm-rusd 688/tcp #ApplianceWare managment protocol -realm-rusd 688/udp #ApplianceWare managment protocol +realm-rusd 688/tcp #ApplianceWare management protocol +realm-rusd 688/udp #ApplianceWare management protocol nmap 689/tcp nmap 689/udp vatp 690/tcp #Velazquez Application Transfer Protocol @@ -2392,7 +2392,7 @@ xdsxdm 6558/tcp xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port -ircd 6667/tcp #Internet Relay Chat (unoffical) +ircd 6667/tcp #Internet Relay Chat (unofficial) frc-hp 6704/sctp #ForCES HP (High Priority) channel frc-mp 6705/sctp #ForCES MP (Medium Priority) channel frc-lp 6706/sctp #ForCES LP (Low priority) channel From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 16:13:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A74D1065672; Sat, 7 Jan 2012 16:13:57 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 638668FC19; Sat, 7 Jan 2012 16:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q07GDvBu047105; Sat, 7 Jan 2012 16:13:57 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07GDvqD047089; Sat, 7 Jan 2012 16:13:57 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201071613.q07GDvqD047089@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 7 Jan 2012 16:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229784 - in head/lib: libgssapi libutil libvgl msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 16:13:57 -0000 Author: uqs Date: Sat Jan 7 16:13:56 2012 New Revision: 229784 URL: http://svn.freebsd.org/changeset/base/229784 Log: Convert files to UTF-8 and add some copyright markers where missing. Modified: head/lib/libgssapi/gss_display_status.c head/lib/libgssapi/gss_pseudo_random.c head/lib/libgssapi/gss_release_oid.c head/lib/libutil/flopen.3 head/lib/libutil/kld.3 head/lib/libvgl/bitmap.c head/lib/libvgl/keyboard.c head/lib/libvgl/main.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/text.c head/lib/libvgl/vgl.3 head/lib/libvgl/vgl.h head/lib/msun/src/s_fabsl.c Modified: head/lib/libgssapi/gss_display_status.c ============================================================================== --- head/lib/libgssapi/gss_display_status.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libgssapi/gss_display_status.c Sat Jan 7 16:13:56 2012 (r229784) @@ -26,7 +26,7 @@ * $FreeBSD$ */ /* - * Copyright (c) 1998 - 2005 Kungliga Tekniska Hgskolan + * Copyright (c) 1998 - 2005 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -58,7 +58,7 @@ * SUCH DAMAGE. */ /* - * Copyright (c) 1998 - 2005 Kungliga Tekniska Hgskolan + * Copyright (c) 1998 - 2005 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * Modified: head/lib/libgssapi/gss_pseudo_random.c ============================================================================== --- head/lib/libgssapi/gss_pseudo_random.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libgssapi/gss_pseudo_random.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2007 Kungliga Tekniska Hgskolan +/*- + * Copyright (c) 2007 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * Modified: head/lib/libgssapi/gss_release_oid.c ============================================================================== --- head/lib/libgssapi/gss_release_oid.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libgssapi/gss_release_oid.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Kungliga Tekniska Hgskolan + * Copyright (c) 2006 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * Modified: head/lib/libutil/flopen.3 ============================================================================== --- head/lib/libutil/flopen.3 Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libutil/flopen.3 Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2007 Dag-Erling Codan Smrgrav +.\" Copyright (c) 2007 Dag-Erling Coïdan Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libutil/kld.3 ============================================================================== --- head/lib/libutil/kld.3 Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libutil/kld.3 Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2006 Dag-Erling Codan Smrgrav +.\" Copyright (c) 2006 Dag-Erling Coïdan Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/bitmap.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Sren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/keyboard.c ============================================================================== --- head/lib/libvgl/keyboard.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/keyboard.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1997 Sren Schmidt + * Copyright (c) 1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/main.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Sren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/mouse.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Sren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/simple.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Sren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/text.c ============================================================================== --- head/lib/libvgl/text.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/text.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Sren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/vgl.3 ============================================================================== --- head/lib/libvgl/vgl.3 Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/vgl.3 Sat Jan 7 16:13:56 2012 (r229784) @@ -1,4 +1,5 @@ -.\" Copyright (c) 1997 Sren Schmidt +.\"- +.\" Copyright (c) 1997 Søren Schmidt .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/libvgl/vgl.h Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Sren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/msun/src/s_fabsl.c ============================================================================== --- head/lib/msun/src/s_fabsl.c Sat Jan 7 16:10:32 2012 (r229783) +++ head/lib/msun/src/s_fabsl.c Sat Jan 7 16:13:56 2012 (r229784) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Dag-Erling Codan Smrgrav + * Copyright (c) 2003 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 19:38:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70429106564A; Sat, 7 Jan 2012 19:38:26 +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 5B8338FC0A; Sat, 7 Jan 2012 19:38: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 q07JcQek053678; Sat, 7 Jan 2012 19:38:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07JcQbf053676; Sat, 7 Jan 2012 19:38:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201071938.q07JcQbf053676@svn.freebsd.org> From: Adrian Chadd Date: Sat, 7 Jan 2012 19:38: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: r229789 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 19:38:26 -0000 Author: adrian Date: Sat Jan 7 19:38:26 2012 New Revision: 229789 URL: http://svn.freebsd.org/changeset/base/229789 Log: Fix the broken module build I introduced earlier. Modified: head/sys/i386/conf/XEN Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Sat Jan 7 18:53:14 2012 (r229788) +++ head/sys/i386/conf/XEN Sat Jan 7 19:38:26 2012 (r229789) @@ -83,6 +83,10 @@ device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) +# Wireless cards +options IEEE80211_SUPPORT_MESH +options AH_SUPPORT_AR5416 + # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 20:03:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCF0106564A; Sat, 7 Jan 2012 20:03:32 +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 173328FC16; Sat, 7 Jan 2012 20:03:32 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6cc4:185:83f6:3148] (unknown [IPv6:2001:7b8:3a7:0:6cc4:185:83f6:3148]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0B5565C37; Sat, 7 Jan 2012 21:03:31 +0100 (CET) Message-ID: <4F08A518.8090207@FreeBSD.org> Date: Sat, 07 Jan 2012 21:03:36 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201112300624.pBU6OxO9098906@svn.freebsd.org> In-Reply-To: <201112300624.pBU6OxO9098906@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 20:03:32 -0000 On 2011-12-30 07:24, Sergey Kandaurov wrote: > Author: pluknet > Date: Fri Dec 30 06:24:59 2011 > New Revision: 228985 > URL: http://svn.freebsd.org/changeset/base/228985 > > Log: > Unset the environment variables associated with individual menu items > before invoking the kernel. When I did a single-user mode boot to install a new world, I saw the following warning on the (serial) console during boot: /boot.config: -D -S115200 Consoles: internal video/keyboard serial port BIOS drive A: is disk0 BIOS drive C: is disk1 BIOS 638kB/3143616kB available memory FreeBSD/x86 bootstrap loader, Revision 1.1 (dim@vm-freebsd10-amd64.home.andric.com, Sat Jan 7 01:05:07 CET 2012) Loading /boot/defaults/loader.conf /boot/kernel/kernel data=0xb73530 data=0x11dbe0+0x2b4db8 syms=[0x8+0xfd620+0x8+0xec6b6] - Hit [Enter] to boot immediately, or any other key for command prompt. Type '?' for a list of commands, 'help' for more detailed help. OK boot -s menu-unset not found <<-- what's this? GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb [...kernel boots...] E.g, it always gives a 'menu-unset not found' warning (or maybe it's an error, it's not clear). This was not the case before r228985. I have almost no knowledge about forth, but it looks like this might be caused by the new try-menu-unset subroutine. My loader.conf is just this: beastie_disable="YES" comconsole_speed="115200" console="comconsole vidconsole" kern.hz="100" From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 20:13:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7E36106566B; Sat, 7 Jan 2012 20:13:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3B628FC0A; Sat, 7 Jan 2012 20:13: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 q07KDt8a054820; Sat, 7 Jan 2012 20:13:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07KDtiG054818; Sat, 7 Jan 2012 20:13:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201072013.q07KDtiG054818@svn.freebsd.org> From: Adrian Chadd Date: Sat, 7 Jan 2012 20:13: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: r229790 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 20:13:55 -0000 Author: adrian Date: Sat Jan 7 20:13:55 2012 New Revision: 229790 URL: http://svn.freebsd.org/changeset/base/229790 Log: Commit a temporary workaround for people who are building kernels where they've disabled all the wireless devices/framework. This is just a build workaround. If you're actively using wireless, you must still define AH_SUPPORT_AR5416 as I'm not sure what else will break! The real solution is to make the module build depend if AH_SUPPORT_AR5416 is defined, as well as make the 11n code in if_ath_tx.c and if_ath_tx_ht.c completely optional (maybe depend upon ATH_SUPPORT_11N.) Modified: head/sys/dev/ath/ath_hal/ah_desc.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sat Jan 7 19:38:26 2012 (r229789) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sat Jan 7 20:13:55 2012 (r229790) @@ -23,6 +23,17 @@ #include "opt_ah.h" /* NB: required for AH_SUPPORT_AR5416 */ /* + * For now, define this for the structure definitions. + * Because of how the HAL / driver module currently builds, + * it's not very feasible to build the module without + * this defined. The rest of the code (eg in the driver + * body) can work fine with these fields being uninitialised; + * they'll be initialised to 0 anyway. + */ + +#define AH_SUPPORT_AR5416 1 + +/* * Transmit descriptor status. This structure is filled * in only after the tx descriptor process method finds a * ``done'' descriptor; at which point it returns something From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 20:23:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65AE106564A; Sat, 7 Jan 2012 20:23:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D11B28FC0A; Sat, 7 Jan 2012 20:23: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 q07KN5bX055154; Sat, 7 Jan 2012 20:23:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07KN5RK055151; Sat, 7 Jan 2012 20:23:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201072023.q07KN5RK055151@svn.freebsd.org> From: Adrian Chadd Date: Sat, 7 Jan 2012 20:23: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: r229791 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 20:23:06 -0000 Author: adrian Date: Sat Jan 7 20:23:05 2012 New Revision: 229791 URL: http://svn.freebsd.org/changeset/base/229791 Log: .. the AR5416 HAL code touches the MIMO parts in HAL_CHANNEL, so this is also needed. Pointed out by: bz Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sat Jan 7 20:13:55 2012 (r229790) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sat Jan 7 20:23:05 2012 (r229791) @@ -31,7 +31,9 @@ * they'll be initialised to 0 anyway. */ +#ifndef AH_SUPPORT_AR5416 #define AH_SUPPORT_AR5416 1 +#endif /* * Transmit descriptor status. This structure is filled Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sat Jan 7 20:13:55 2012 (r229790) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sat Jan 7 20:23:05 2012 (r229791) @@ -30,6 +30,10 @@ #include #include "opt_ah.h" /* needed for AH_SUPPORT_AR5416 */ +#ifndef AH_SUPPORT_AR5416 +#define AH_SUPPORT_AR5416 1 +#endif + #ifndef NBBY #define NBBY 8 /* number of bits/byte */ #endif From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 22:17:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4ECF4106564A; Sat, 7 Jan 2012 22:17:35 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 70C291516EE; Sat, 7 Jan 2012 22:17:34 +0000 (UTC) Message-ID: <4F08C47D.7090906@FreeBSD.org> Date: Sat, 07 Jan 2012 14:17:33 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Ulrich Spoerlein References: <201201071610.q07GAWZA046912@svn.freebsd.org> In-Reply-To: <201201071610.q07GAWZA046912@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229783 - in head/etc: . namedb rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 22:17:35 -0000 On 01/07/2012 08:10, Ulrich Spoerlein wrote: > Modified: head/etc/namedb/named.conf Good catch, thanks. :) -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 23:15:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3810F1065678; Sat, 7 Jan 2012 23:15:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22F7A8FC08; Sat, 7 Jan 2012 23:15: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 q07NFMGK060479; Sat, 7 Jan 2012 23:15:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07NFM3v060477; Sat, 7 Jan 2012 23:15:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201072315.q07NFM3v060477@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jan 2012 23:15: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: r229794 - head/usr.bin/hexdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 23:15:22 -0000 Author: eadler (ports committer) Date: Sat Jan 7 23:15:21 2012 New Revision: 229794 URL: http://svn.freebsd.org/changeset/base/229794 Log: - Fix how hexdump parses escape strings From the NetBSD bug: The way how hexdump(1) parses escape sequences has some bugs. It shows up when an escape sequence is used as the non-last character of a format string. PR: bin/144722 Submitted by: gcooper Approved by: rpaulo Obtained from: NetBSD MFC after: 1 week Modified: head/usr.bin/hexdump/parse.c Modified: head/usr.bin/hexdump/parse.c ============================================================================== --- head/usr.bin/hexdump/parse.c Sat Jan 7 22:29:46 2012 (r229793) +++ head/usr.bin/hexdump/parse.c Sat Jan 7 23:15:21 2012 (r229794) @@ -255,7 +255,9 @@ rewrite(FS *fs) sokay = NOTOKAY; } - p2 = p1 + 1; /* Set end pointer. */ + p2 = *p1 ? p1 + 1 : p1; /* Set end pointer -- make sure + * that it's non-NUL/-NULL first + * though. */ cs[0] = *p1; /* Set conversion string. */ cs[1] = '\0'; @@ -449,13 +451,21 @@ escape(char *p1) char *p2; /* alphabetic escape sequences have to be done in place */ - for (p2 = p1;; ++p1, ++p2) { - if (!*p1) { - *p2 = *p1; - break; - } - if (*p1 == '\\') - switch(*++p1) { + for (p2 = p1; *p1; p1++, p2++) { + /* + * Let's take a peak at the next item and see whether or not + * we need to escape the value... + */ + if (*p1 == '\\') { + + p1++; + + switch(*p1) { + /* A standalone `\' */ + case '\0': + *p2 = '\\'; + *++p2 = '\0'; + break; case 'a': /* *p2 = '\a'; */ *p2 = '\007'; @@ -482,7 +492,12 @@ escape(char *p1) *p2 = *p1; break; } + + } else + *p2 = *p1; + } + } void From owner-svn-src-head@FreeBSD.ORG Sat Jan 7 23:41:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00235106566B; Sat, 7 Jan 2012 23:41:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF39C8FC0A; Sat, 7 Jan 2012 23:41: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 q07NfcTw061323; Sat, 7 Jan 2012 23:41:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q07NfcZk061321; Sat, 7 Jan 2012 23:41:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201072341.q07NfcZk061321@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 7 Jan 2012 23:41: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: r229795 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 23:41:39 -0000 Author: bz Date: Sat Jan 7 23:41:38 2012 New Revision: 229795 URL: http://svn.freebsd.org/changeset/base/229795 Log: Correct comment for the IPv6 case to say "traffic class" not "TOS" as pointed out back in 2009. MFC after: 3 days Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sat Jan 7 23:15:21 2012 (r229794) +++ head/sys/net80211/ieee80211_output.c Sat Jan 7 23:41:38 2012 (r229795) @@ -834,7 +834,7 @@ ieee80211_classify(struct ieee80211_node uint32_t flow; uint8_t tos; /* - * IPv6 frame, map the DSCP bits from the TOS field. + * IPv6 frame, map the DSCP bits from the traffic class field. */ m_copydata(m, sizeof(struct ether_header) + offsetof(struct ip6_hdr, ip6_flow), sizeof(flow),