From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 00:42:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CDC1065673; Sun, 7 Dec 2008 00:42:15 +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 E1C7B8FC0A; Sun, 7 Dec 2008 00:42:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB70gFir009494; Sun, 7 Dec 2008 00:42:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB70gFEK009493; Sun, 7 Dec 2008 00:42:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812070042.mB70gFEK009493@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 7 Dec 2008 00:42: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: r185727 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 00:42:16 -0000 Author: nwhitehorn Date: Sun Dec 7 00:42:15 2008 New Revision: 185727 URL: http://svn.freebsd.org/changeset/base/185727 Log: Add support for automated reboot after power failure on Apple Core99 machines (G3 laptops, all G4 machines, early G5s, G5 Xserves). The relevant sysctl is named dev.pmu.0.server_mode for mental compatibility with Linux. Modified: head/sys/powerpc/powermac/pmu.c Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Sun Dec 7 00:41:40 2008 (r185726) +++ head/sys/powerpc/powermac/pmu.c Sun Dec 7 00:42:15 2008 (r185727) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -65,10 +66,11 @@ static int pmu_probe(device_t); static int pmu_attach(device_t); static int pmu_detach(device_t); -static u_int pmu_adb_send(device_t dev, u_char command_byte, int len, +static u_int pmu_adb_send(device_t dev, u_char command_byte, int len, u_char *data, u_char poll); -static u_int pmu_adb_autopoll(device_t dev, uint16_t mask); -static void pmu_poll(device_t dev); +static u_int pmu_adb_autopoll(device_t dev, uint16_t mask); +static void pmu_poll(device_t dev); +static int pmu_server_mode(SYSCTL_HANDLER_ARGS); static device_method_t pmu_methods[] = { /* Device interface */ @@ -282,6 +284,8 @@ pmu_attach(device_t dev) uint8_t cmd[2] = {2, 0}; uint8_t resp[16]; phandle_t node,child; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -341,6 +345,17 @@ pmu_attach(device_t dev) } } + /* + * Set up sysctls + */ + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "server_mode", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + pmu_server_mode, "I", "Enable reboot after power failure"); + return (bus_generic_attach(dev)); } @@ -613,3 +628,46 @@ pmu_adb_autopoll(device_t dev, uint16_t return 0; } + +static int +pmu_server_mode(SYSCTL_HANDLER_ARGS) +{ + struct pmu_softc *sc = arg1; + + u_int server_mode = 0; + uint8_t getcmd[] = {PMU_PWR_GET_POWERUP_EVENTS}; + uint8_t setcmd[] = {0, 0, PMU_PWR_WAKEUP_AC_INSERT}; + uint8_t resp[3]; + int error, len; + + mtx_lock(&sc->sc_mutex); + len = pmu_send(sc, PMU_POWER_EVENTS, 1, getcmd, 3, resp); + mtx_unlock(&sc->sc_mutex); + + if (len == 3) + server_mode = (resp[2] & PMU_PWR_WAKEUP_AC_INSERT) ? 1 : 0; + + error = sysctl_handle_int(oidp, &server_mode, 0, req); + + if (len != 3) + return (EINVAL); + + if (error || !req->newptr) + return (error); + + if (server_mode == 1) + setcmd[0] = PMU_PWR_SET_POWERUP_EVENTS; + else if (server_mode == 0) + setcmd[0] = PMU_PWR_CLR_POWERUP_EVENTS; + else + return (EINVAL); + + setcmd[1] = resp[1]; + + mtx_lock(&sc->sc_mutex); + pmu_send(sc, PMU_POWER_EVENTS, 3, setcmd, 2, resp); + mtx_unlock(&sc->sc_mutex); + + return (0); +} + From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 01:45:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26FD41065672 for ; Sun, 7 Dec 2008 01:45:16 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by mx1.freebsd.org (Postfix) with ESMTP id 132968FC14 for ; Sun, 7 Dec 2008 01:45:16 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from pmesker-xp.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp019.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KBH00BITE3ERW30@asmtp019.mac.com>; Sat, 06 Dec 2008 16:45:16 -0800 (PST) Message-id: <01839E58-2D85-40CE-B39A-DC903D48955D@mac.com> From: Marcel Moolenaar To: Nathan Whitehorn In-reply-to: <200812070042.mB70gFEK009493@svn.freebsd.org> Date: Sat, 06 Dec 2008 16:45:14 -0800 References: <200812070042.mB70gFEK009493@svn.freebsd.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185727 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 01:45:16 -0000 On Dec 6, 2008, at 4:42 PM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Dec 7 00:42:15 2008 > New Revision: 185727 > URL: http://svn.freebsd.org/changeset/base/185727 > > Log: > Add support for automated reboot after power failure on Apple > Core99 machines > (G3 laptops, all G4 machines, early G5s, G5 Xserves). The relevant > sysctl > is named dev.pmu.0.server_mode for mental compatibility with Linux. Yay! Me and my RPC thank you :-) -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 02:32:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23599106564A; Sun, 7 Dec 2008 02:32:50 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120338FC12; Sun, 7 Dec 2008 02:32:50 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB72WnVP011585; Sun, 7 Dec 2008 02:32:49 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB72WnrR011584; Sun, 7 Dec 2008 02:32:49 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200812070232.mB72WnrR011584@svn.freebsd.org> From: Peter Wemm Date: Sun, 7 Dec 2008 02:32: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: r185728 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 02:32:50 -0000 Author: peter Date: Sun Dec 7 02:32:49 2008 New Revision: 185728 URL: http://svn.freebsd.org/changeset/base/185728 Log: When libthr and rtld start up, there are a number of magic spells cast in order to get the symbol binding state "just so". This is to allow locking to be activated and not run into recursion problems later. However, one of the magic bits involves an explicit call to _umtx_op() to force symbol resolution. It does a wakeup operation on a fake, uninitialized (ie: random contents) umtx. Since libthr isn't active, this is harmless. Nothing can match the random wakeup. However, valgrind finds this and is not amused. Normally I'd just write a suppression record for it, but the idea of passing random args to syscalls (on purpose) just doesn't feel right. Modified: head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Sun Dec 7 00:42:15 2008 (r185727) +++ head/lib/libthr/thread/thr_rtld.c Sun Dec 7 02:32:49 2008 (r185728) @@ -180,7 +180,7 @@ _thr_rtld_init(void) { struct RtldLockInfo li; struct pthread *curthread; - long dummy; + long dummy = -1; curthread = _get_curthread(); From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 03:23:59 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7282F1065670; Sun, 7 Dec 2008 03:23:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2F58E8FC08; Sun, 7 Dec 2008 03:23:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mB73NaAq039841; Sat, 6 Dec 2008 20:23:36 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 06 Dec 2008 20:23:44 -0700 (MST) Message-Id: <20081206.202344.-160243400.imp@bsdimp.com> To: kostikbel@gmail.com From: "M. Warner Losh" In-Reply-To: <20081205230002.GX2038@deviant.kiev.zoral.com.ua> References: <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org> <20081205230002.GX2038@deviant.kiev.zoral.com.ua> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, rdivacky@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r185647 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 03:23:59 -0000 In message: <20081205230002.GX2038@deviant.kiev.zoral.com.ua> Kostik Belousov writes: : On Fri, Dec 05, 2008 at 11:46:00PM +0100, Roman Divacky wrote: : > On Fri, Dec 05, 2008 at 08:50:24PM +0000, Konstantin Belousov wrote: : > > Author: kib : > > Date: Fri Dec 5 20:50:24 2008 : > > New Revision: 185647 : > > URL: http://svn.freebsd.org/changeset/base/185647 : > > : > > Log: : > > Several threads in a process may do vfork() simultaneously. Then, all : > > parent threads sleep on the parent' struct proc until corresponding : > > child releases the vmspace. Each sleep is interlocked with proc mutex of : > > the child, that triggers assertion in the sleepq_add(). The assertion : > > requires that at any time, all simultaneous sleepers for the channel use : > > the same interlock. : > > : > > Silent the assertion by using conditional variable allocated in the : > > child. Broadcast the variable event on exec() and exit(). : > > : > > Since struct proc * sleep wait channel is overloaded for several : > > unrelated events, I was unable to remove wakeups from the places where : > > cv_broadcast() is added, except exec(). : > : > are there any differences (performance etc.) in using condition variables : > instead of sleep/wakeup? : : I do not think that there is any measurable difference. On the other : hand, the patch makes struct proc bigger by int + pointer. This shall : not be a problem too. : : Would I been able to convert _all_ uses of the struct proc * wait channel : to cond vars operation, this may be measurable on some loads, since it : would exclude spurious wakeups. Is that a measurable good difference, or a measurable bad difference? Warner From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 03:33:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AFF51065673; Sun, 7 Dec 2008 03:33:37 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18BC68FC14; Sun, 7 Dec 2008 03:33:37 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB73XaiL012992; Sun, 7 Dec 2008 03:33:36 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB73XaM1012989; Sun, 7 Dec 2008 03:33:36 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200812070333.mB73XaM1012989@svn.freebsd.org> From: Peter Wemm Date: Sun, 7 Dec 2008 03:33: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: r185729 - 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: Sun, 07 Dec 2008 03:33:37 -0000 Author: peter Date: Sun Dec 7 03:33:36 2008 New Revision: 185729 URL: http://svn.freebsd.org/changeset/base/185729 Log: Add filler man pages for the kinfo functions I added recently. While here, hook up the hexdump(3) man page which wasn't being installed. Added: head/lib/libutil/kinfo_getfile.3 (contents, props changed) head/lib/libutil/kinfo_getvmmap.3 (contents, props changed) Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Sun Dec 7 02:32:49 2008 (r185728) +++ head/lib/libutil/Makefile Sun Dec 7 03:33:36 2008 (r185729) @@ -30,7 +30,8 @@ MAN+= kld.3 login.3 login_auth.3 login_t login_cap.3 login_class.3 login_times.3 login_ok.3 \ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 humanize_number.3 \ - pidfile.3 flopen.3 expand_number.3 + pidfile.3 flopen.3 expand_number.3 hexdump.3 \ + kinfo_getfile.3 kinfo_getvmmap.3 MAN+= login.conf.5 auth.conf.5 MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 Added: head/lib/libutil/kinfo_getfile.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/kinfo_getfile.3 Sun Dec 7 03:33:36 2008 (r185729) @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2008 Peter Wemm +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 6, 2008 +.Os +.Dt KINFO_GETFILE 3 +.Sh NAME +.Nm kinfo_getfile +.Nd function for getting per-process file descriptor information +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In sys/types.h +.In libutil.h +.Ft struct kinfo_file * +.Fn kinfo_getfile "pid_t pid" "int *cntp" +.Sh DESCRIPTION +This function is used for obtaining the file descriptor information +of a particular process. +.Pp +The +.Ar pid +field contains the process identifier. +This should be the a process that you have privilige to access. +The +.Ar cntp +field is allows the caller to know how many records are returned. +.Pp +This function is a wrapper around +.Xr sysctl 3 +with the +.Dv KERN_PROC_FILEDESC +mib. +While the kernel returns a packed structure, this function expands the +data into a fixed record format. +.Sh RETURN VALUES +The +.Fn kinfo_getfile +function returns a pointer to an array of +.Vt struct kinfo_file +structures. +The array was obtained by an internal call to +.Xr malloc 3 +and must be freed by the caller with a call to +.Xr free 3 . +.Sh SEE ALSO +.Xr free 3 , +.Xr kinfo_getvmmap 3 , +.Xr malloc 3 , +.Xr sysctl 3 Added: head/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/kinfo_getvmmap.3 Sun Dec 7 03:33:36 2008 (r185729) @@ -0,0 +1,73 @@ +.\" +.\" Copyright (c) 2008 Peter Wemm +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 6, 2008 +.Os +.Dt KINFO_GETVMMAP 3 +.Sh NAME +.Nm kinfo_getvmmap +.Nd function for getting per-process memory map information +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In sys/types.h +.In libutil.h +.Ft struct kinfo_vmentry * +.Fn kinfo_getfile "pid_t pid" "int *cntp" +.Sh DESCRIPTION +This function is used for obtaining the file descriptor information +of a particular process. +.Pp +The +.Ar pid +field contains the process identifier. +This should be the a process that you have privilige to access. +The +.Ar cntp +field is allows the caller to know how many records are returned. +.Pp +This function is a wrapper around +.Xr sysctl 3 +with the +.Dv KERN_PROC_VMMAP +mib. +While the kernel returns a packed structure, this function expands the +data into a fixed record format. +.Sh RETURN VALUES +The +.Fn kinfo_getvmmap +function returns a pointer to an array of +.Vt struct kinfo_vmentry +structures. +The array was obtained by an internal call to +.Xr malloc 3 +and must be freed by the caller with a call to +.Xr free 3 . +.Sh SEE ALSO +.Xr free 3 , +.Xr kinfo_getfile 3 , +.Xr malloc 3 From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 06:18:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DB321065793; Sun, 7 Dec 2008 06:18:48 +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 1B9FE8FC13; Sun, 7 Dec 2008 06:18:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB76ImNo016348; Sun, 7 Dec 2008 06:18:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB76IlrY016346; Sun, 7 Dec 2008 06:18:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812070618.mB76IlrY016346@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 7 Dec 2008 06:18: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: r185736 - head/share/man/man4/man4.powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 06:18:48 -0000 Author: nwhitehorn Date: Sun Dec 7 06:18:47 2008 New Revision: 185736 URL: http://svn.freebsd.org/changeset/base/185736 Log: Now that pmu(4) has features, it should also have a man page. Added: head/share/man/man4/man4.powerpc/pmu.4 (contents, props changed) Modified: head/share/man/man4/man4.powerpc/Makefile Modified: head/share/man/man4/man4.powerpc/Makefile ============================================================================== --- head/share/man/man4/man4.powerpc/Makefile Sun Dec 7 06:01:09 2008 (r185735) +++ head/share/man/man4/man4.powerpc/Makefile Sun Dec 7 06:18:47 2008 (r185736) @@ -1,6 +1,7 @@ # $FreeBSD$ MAN= bm.4 \ + pmu.4 \ powermac_nvram.4 MANSUBDIR=/powerpc Added: head/share/man/man4/man4.powerpc/pmu.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/pmu.4 Sun Dec 7 06:18:47 2008 (r185736) @@ -0,0 +1,95 @@ +.\"- +.\" Copyright (c) 2008 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 6, 2008 +.Dt PMU 4 +.Os +.Sh NAME +.Nm pmu +.Nd Apple PMU99 Power Management Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Cd "device pmu" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Power Management Unit (PMU) find in Apple +Core99 hardware. This includes late G3 laptops, all G4 machines, early G5 +desktops and all G5 XServes. +.Ed +.Pp +The Apple PMU controller is a multi-purpose ASIC that provides power +management and thermal control, as well as an ADB bus for the internal +keyboard and mouse on laptops. +.Sh HARDWARE +.Pp +Chips supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple KeyLargo PMU +.It +Apple K2-KeyLargo PMU +.El +.Pp +.Sh SYSCTL VARIABLES +The +.Nm +driver provides power management services in addition to an +.Xr adb 4 +interface. The following sysctls can be used to control the +power management behavior. +.Bl -tag -width indent +.It Va dev.pmu.%d.server_mode +Restart after power failure behavior (1 causes system to reboot after power +cut, 0 causes system to remain off) +.Sh SEE ALSO +.Xr adb 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Nx 4.0 , +and then in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Michael Lorenz +.Aq macallan@NetBSD.org +and ported to FreeBSD by +.An Nathan Whitehorn +.Aq nwhitehorn@freebsd.org . From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 06:34:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C7AE1065670; Sun, 7 Dec 2008 06:34:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AFD48FC12; Sun, 7 Dec 2008 06:34:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB76Yomk016719; Sun, 7 Dec 2008 06:34:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB76YoAU016718; Sun, 7 Dec 2008 06:34:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812070634.mB76YoAU016718@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 7 Dec 2008 06:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185737 - head/share/man/man4/man4.powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 06:34:51 -0000 Author: nwhitehorn Date: Sun Dec 7 06:34:50 2008 New Revision: 185737 URL: http://svn.freebsd.org/changeset/base/185737 Log: Fix spelling error (find -> found). Modified: head/share/man/man4/man4.powerpc/pmu.4 Modified: head/share/man/man4/man4.powerpc/pmu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/pmu.4 Sun Dec 7 06:18:47 2008 (r185736) +++ head/share/man/man4/man4.powerpc/pmu.4 Sun Dec 7 06:34:50 2008 (r185737) @@ -42,7 +42,7 @@ kernel configuration file: .Sh DESCRIPTION The .Nm -driver provides support for the Power Management Unit (PMU) find in Apple +driver provides support for the Power Management Unit (PMU) found in Apple Core99 hardware. This includes late G3 laptops, all G4 machines, early G5 desktops and all G5 XServes. .Ed From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 10:26:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BD27106564A; Sun, 7 Dec 2008 10:26:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8A28FC18; Sun, 7 Dec 2008 10:26:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L9GqF-0001QD-TC; Sun, 07 Dec 2008 12:26:23 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mB7AQKhM025327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 7 Dec 2008 12:26:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mB7AQK9Z074739; Sun, 7 Dec 2008 12:26:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mB7AQKxi074738; Sun, 7 Dec 2008 12:26:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 7 Dec 2008 12:26:20 +0200 From: Kostik Belousov To: "M. Warner Losh" Message-ID: <20081207102620.GK2038@deviant.kiev.zoral.com.ua> References: <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org> <20081205230002.GX2038@deviant.kiev.zoral.com.ua> <20081206.202344.-160243400.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9SzJfJEKNI6APITJ" Content-Disposition: inline In-Reply-To: <20081206.202344.-160243400.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L9GqF-0001QD-TC 1335506a674f49f83f1572321f12c0d1 X-Terabit: YES Cc: svn-src-head@freebsd.org, rdivacky@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r185647 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 10:26:26 -0000 --9SzJfJEKNI6APITJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 06, 2008 at 08:23:44PM -0700, M. Warner Losh wrote: > In message: <20081205230002.GX2038@deviant.kiev.zoral.com.ua> > Kostik Belousov writes: > : On Fri, Dec 05, 2008 at 11:46:00PM +0100, Roman Divacky wrote: > : > On Fri, Dec 05, 2008 at 08:50:24PM +0000, Konstantin Belousov wrote: > : > > Author: kib > : > > Date: Fri Dec 5 20:50:24 2008 > : > > New Revision: 185647 > : > > URL: http://svn.freebsd.org/changeset/base/185647 > : > >=20 > : > > Log: > : > > Several threads in a process may do vfork() simultaneously. Then,= all > : > > parent threads sleep on the parent' struct proc until correspondi= ng > : > > child releases the vmspace. Each sleep is interlocked with proc m= utex of > : > > the child, that triggers assertion in the sleepq_add(). The asser= tion > : > > requires that at any time, all simultaneous sleepers for the chan= nel use > : > > the same interlock. > : > > =20 > : > > Silent the assertion by using conditional variable allocated in t= he > : > > child. Broadcast the variable event on exec() and exit(). > : > > =20 > : > > Since struct proc * sleep wait channel is overloaded for several > : > > unrelated events, I was unable to remove wakeups from the places = where > : > > cv_broadcast() is added, except exec(). > : >=20 > : > are there any differences (performance etc.) in using condition varia= bles > : > instead of sleep/wakeup? > :=20 > : I do not think that there is any measurable difference. On the other > : hand, the patch makes struct proc bigger by int + pointer. This shall > : not be a problem too. > :=20 > : Would I been able to convert _all_ uses of the struct proc * wait chann= el > : to cond vars operation, this may be measurable on some loads, since it > : would exclude spurious wakeups. >=20 > Is that a measurable good difference, or a measurable bad difference? I expect this could be measurable good difference, i.e. such patch might improve performance on some loads by eliminating false wakeups. --9SzJfJEKNI6APITJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkk7pMsACgkQC3+MBN1Mb4iETgCfX2qVnP2e+1gPG2HBrwspv+HV EtoAoMuhcsgY0JbRg3gnuTQ3zvSmU0Af =jhP7 -----END PGP SIGNATURE----- --9SzJfJEKNI6APITJ-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 13:25:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECDA41065678; Sun, 7 Dec 2008 13:25:06 +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 DBE3A8FC1C; Sun, 7 Dec 2008 13:25:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7DP66w026631; Sun, 7 Dec 2008 13:25:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7DP64P026630; Sun, 7 Dec 2008 13:25:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812071325.mB7DP64P026630@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Dec 2008 13:25: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: r185739 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 13:25:07 -0000 Author: kib Date: Sun Dec 7 13:25:06 2008 New Revision: 185739 URL: http://svn.freebsd.org/changeset/base/185739 Log: Improve usefulness of the panic by printing the pointer to the problematic dquot. In-tree gdb is often unable to get the dq value, so supply it in panic message. MFC after: 3 days Modified: head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Sun Dec 7 07:02:26 2008 (r185738) +++ head/sys/ufs/ufs/ufs_quota.c Sun Dec 7 13:25:06 2008 (r185739) @@ -1151,7 +1151,7 @@ hfound: DQI_LOCK(dq); return (EUSERS); } if (dq->dq_cnt || (dq->dq_flags & DQ_MOD)) - panic("dqget: free dquot isn't"); + panic("dqget: free dquot isn't %p", dq); TAILQ_REMOVE(&dqfreelist, dq, dq_freelist); if (dq->dq_ump != NULL) LIST_REMOVE(dq, dq_hash); From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 18:32:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63C4010656AE; Sun, 7 Dec 2008 18:32:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51C518FC16; Sun, 7 Dec 2008 18:32:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7IW9IJ032500; Sun, 7 Dec 2008 18:32:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7IW96f032499; Sun, 7 Dec 2008 18:32:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812071832.mB7IW96f032499@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Dec 2008 18:32: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: r185740 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 18:32:10 -0000 Author: imp Date: Sun Dec 7 18:32:09 2008 New Revision: 185740 URL: http://svn.freebsd.org/changeset/base/185740 Log: Use atomic_add_int rather than a simple ++ to ensure no cache races if the power interrupt and init code waiting for the interrupt are running on different CPUs. I haven't seen this make any real difference, but I've also had some reports of odd behavior I can't otherwise explain. It is an infrequent operation, and certainly wouldn't hurt. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Sun Dec 7 13:25:06 2008 (r185739) +++ head/sys/dev/pccbb/pccbb_pci.c Sun Dec 7 18:32:09 2008 (r185740) @@ -730,7 +730,7 @@ cbb_pci_filt(void *arg) if (sockevent & CBB_SOCKET_EVENT_POWER) { cbb_clrb(sc, CBB_SOCKET_MASK, CBB_SOCKET_EVENT_POWER); cbb_set(sc, CBB_SOCKET_EVENT, CBB_SOCKET_EVENT_POWER); - sc->powerintr++; + atomic_add_int(&sc->powerintr, 1); wakeup((void *)&sc->powerintr); } retval = FILTER_HANDLED; From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 18:34:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4B91065675; Sun, 7 Dec 2008 18:34:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 996108FC0C; Sun, 7 Dec 2008 18:34:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7IYRxq032654; Sun, 7 Dec 2008 18:34:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7IYR7k032653; Sun, 7 Dec 2008 18:34:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812071834.mB7IYR7k032653@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Dec 2008 18: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: r185741 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 18:34:27 -0000 Author: imp Date: Sun Dec 7 18:34:27 2008 New Revision: 185741 URL: http://svn.freebsd.org/changeset/base/185741 Log: Use '0' rather than PZERO to not change the priority that I'm waiting at. I don't think this will make a huge difference, but I have received a report of a interrupt storm on one 16-bit card that this might fix (chances are it won't, since I think that we may need to check both the CBB registers for the 16-bit card as well as the PCIC registers for power state change). Submitted by: jhb@ Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Sun Dec 7 18:32:09 2008 (r185740) +++ head/sys/dev/pccbb/pccbb.c Sun Dec 7 18:34:27 2008 (r185741) @@ -515,11 +515,11 @@ cbb_event_thread(void *arg) */ mtx_lock(&sc->mtx); cbb_setb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD | CBB_SOCKET_MASK_CSTS); - msleep(&sc->intrhand, &sc->mtx, PZERO, "-", 0); + msleep(&sc->intrhand, &sc->mtx, 0, "-", 0); err = 0; while (err != EWOULDBLOCK && (sc->flags & CBB_KTHREAD_DONE) == 0) - err = msleep(&sc->intrhand, &sc->mtx, PZERO, "-", hz / 5); + err = msleep(&sc->intrhand, &sc->mtx, 0, "-", hz / 5); } DEVPRINTF((sc->dev, "Thread terminating\n")); sc->flags &= ~CBB_KTHREAD_RUNNING; @@ -795,7 +795,7 @@ cbb_power(device_t brdev, int volts) sane = 10; while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) && cnt == sc->powerintr && sane-- > 0) - msleep(&sc->powerintr, &sc->mtx, PZERO, "-", hz / 20); + msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20); mtx_unlock(&sc->mtx); /* * The TOPIC95B requires a little bit extra time to get From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 18:45:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FABD1065673; Sun, 7 Dec 2008 18:45:30 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DCAA8FC17; Sun, 7 Dec 2008 18:45:30 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7IjUJL032888; Sun, 7 Dec 2008 18:45:30 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7IjU4T032887; Sun, 7 Dec 2008 18:45:30 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200812071845.mB7IjU4T032887@svn.freebsd.org> From: Tom Rhodes Date: Sun, 7 Dec 2008 18:45: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: r185742 - head/usr.sbin/syslogd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 18:45:30 -0000 Author: trhodes Date: Sun Dec 7 18:45:30 2008 New Revision: 185742 URL: http://svn.freebsd.org/changeset/base/185742 Log: Use "allowed_peer" throughout this manual page. Modified: head/usr.sbin/syslogd/syslogd.8 Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Sun Dec 7 18:34:27 2008 (r185741) +++ head/usr.sbin/syslogd/syslogd.8 Sun Dec 7 18:45:30 2008 (r185742) @@ -95,8 +95,9 @@ Multiple .Fl a options may be specified. .Pp -.Ar Allowed_peer -can be any of the following: +The +.Ar allowed_peer +option may be any of the following: .Bl -tag -width "ipaddr/masklen[:service]XX" .It Xo .Sm off From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 19:17:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1F7D106564A; Sun, 7 Dec 2008 19:17:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD2FC8FC13; Sun, 7 Dec 2008 19:17:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7JHYK2033544; Sun, 7 Dec 2008 19:17:34 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7JHYYJ033534; Sun, 7 Dec 2008 19:17:34 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812071917.mB7JHYYJ033534@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Dec 2008 19: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: r185743 - in head/tools/tools/ath: . athdebug athkey athpow athprom athregs athstats 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: Sun, 07 Dec 2008 19:17:35 -0000 Author: sam Date: Sun Dec 7 19:17:33 2008 New Revision: 185743 URL: http://svn.freebsd.org/changeset/base/185743 Log: bring in diagnostic tools that are useful now that we have hal source code Added: head/tools/tools/ath/Makefile.inc (contents, props changed) head/tools/tools/ath/athkey/ head/tools/tools/ath/athkey/Makefile (contents, props changed) head/tools/tools/ath/athkey/athkey.c (contents, props changed) head/tools/tools/ath/athpow/ head/tools/tools/ath/athpow/Makefile (contents, props changed) head/tools/tools/ath/athpow/athpow.c (contents, props changed) head/tools/tools/ath/athprom/ head/tools/tools/ath/athprom/Makefile (contents, props changed) head/tools/tools/ath/athprom/athprom.c (contents, props changed) head/tools/tools/ath/athprom/eeprom-14 (contents, props changed) head/tools/tools/ath/athprom/eeprom-3 (contents, props changed) head/tools/tools/ath/athprom/eeprom-4 (contents, props changed) head/tools/tools/ath/athprom/eeprom-5 (contents, props changed) head/tools/tools/ath/athregs/ head/tools/tools/ath/athregs/Makefile (contents, props changed) head/tools/tools/ath/athregs/dumpregs.c (contents, props changed) head/tools/tools/ath/athregs/dumpregs.h (contents, props changed) head/tools/tools/ath/athregs/dumpregs_5210.c (contents, props changed) head/tools/tools/ath/athregs/dumpregs_5211.c (contents, props changed) head/tools/tools/ath/athregs/dumpregs_5212.c (contents, props changed) head/tools/tools/ath/athregs/dumpregs_5416.c (contents, props changed) head/tools/tools/ath/common/ head/tools/tools/ath/common/ah_osdep.h (contents, props changed) head/tools/tools/ath/common/diag.h (contents, props changed) Modified: head/tools/tools/ath/Makefile head/tools/tools/ath/athdebug/Makefile head/tools/tools/ath/athstats/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Sun Dec 7 18:45:30 2008 (r185742) +++ head/tools/tools/ath/Makefile Sun Dec 7 19:17:33 2008 (r185743) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= athstats athdebug +SUBDIR= athdebug athkey athprom athregs athstats .include Added: head/tools/tools/ath/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/Makefile.inc Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +BINDIR= /usr/local/bin +NO_MAN= + +ATH_DEFAULT= ath0 + +CFLAGS+=-DATH_DEFAULT='"${ATH_DEFAULT}"' +CFLAGS+=-I../common +CFLAGS+=-I../../../../sys/dev/ath +CFLAGS+=-I../../../../sys/dev/ath/ath_hal Modified: head/tools/tools/ath/athdebug/Makefile ============================================================================== --- head/tools/tools/ath/athdebug/Makefile Sun Dec 7 18:45:30 2008 (r185742) +++ head/tools/tools/ath/athdebug/Makefile Sun Dec 7 19:17:33 2008 (r185743) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= athdebug -BINDIR= /usr/local/bin -NO_MAN= + +.include <../Makefile.inc> .include Added: head/tools/tools/ath/athkey/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athkey/Makefile Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= athkey + +.include <../Makefile.inc> + +.include Added: head/tools/tools/ath/athkey/athkey.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athkey/athkey.c Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,203 @@ +/*- + * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include "diag.h" + +#include "ah.h" +#include "ah_internal.h" + +#include +#include +#include +#include +#include + +const char *progname; + +static int +toint(int c) +{ + return isdigit(c) ? c - '0' : isupper(c) ? c - 'A' + 10 : c - 'a' + 10; +} + +static int +getdata(const char *arg, u_int8_t *data, size_t maxlen) +{ + const char *cp = arg; + int len; + + if (cp[0] == '0' && (cp[1] == 'x' || cp[1] == 'X')) + cp += 2; + len = 0; + while (*cp) { + int b0, b1; + if (cp[0] == ':' || cp[0] == '-' || cp[0] == '.') { + cp++; + continue; + } + if (!isxdigit(cp[0])) { + fprintf(stderr, "%s: invalid data value %c (not hex)\n", + progname, cp[0]); + exit(-1); + } + b0 = toint(cp[0]); + if (cp[1] != '\0') { + if (!isxdigit(cp[1])) { + fprintf(stderr, "%s: invalid data value %c " + "(not hex)\n", progname, cp[1]); + exit(-1); + } + b1 = toint(cp[1]); + cp += 2; + } else { /* fake up 0 */ + b1 = b0, b0 = 0; + cp += 1; + } + if (len > maxlen) { + fprintf(stderr, + "%s: too much data in %s, max %u bytes\n", + progname, arg, maxlen); + } + data[len++] = (b0<<4) | b1; + } + return len; +} + +/* XXX this assumes 5212 key types are common to 5211 and 5210 */ + +static int +getcipher(const char *name) +{ +#define streq(a,b) (strcasecmp(a,b) == 0) + + if (streq(name, "wep")) + return HAL_CIPHER_WEP; + if (streq(name, "tkip")) + return HAL_CIPHER_TKIP; + if (streq(name, "aes-ocb") || streq(name, "ocb")) + return HAL_CIPHER_AES_OCB; + if (streq(name, "aes-ccm") || streq(name, "ccm") || + streq(name, "aes")) + return HAL_CIPHER_AES_CCM; + if (streq(name, "ckip")) + return HAL_CIPHER_CKIP; + if (streq(name, "none") || streq(name, "clr")) + return HAL_CIPHER_CLR; + + fprintf(stderr, "%s: unknown cipher %s\n", progname, name); + exit(-1); +#undef streq +} + +static void +usage(void) +{ + fprintf(stderr, "usage: %s [-i device] keyix cipher keyval [mac]\n", + progname); + exit(-1); +} + +int +main(int argc, char *argv[]) +{ + const char *ifname; + struct ath_diag atd; + HAL_DIAG_KEYVAL setkey; + const char *cp; + int s, c; + u_int16_t keyix; + int op = HAL_DIAG_SETKEY; + int xor = 0; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(1, "socket"); + ifname = getenv("ATH"); + if (!ifname) + ifname = ATH_DEFAULT; + + progname = argv[0]; + while ((c = getopt(argc, argv, "di:x")) != -1) + switch (c) { + case 'd': + op = HAL_DIAG_RESETKEY; + break; + case 'i': + ifname = optarg; + break; + case 'x': + xor = 1; + break; + default: + usage(); + /*NOTREACHED*/ + } + argc -= optind; + argv += optind; + if (argc < 1) + usage(); + + keyix = (u_int16_t) atoi(argv[0]); + if (keyix > 127) + errx(-1, "%s: invalid key index %s, must be [0..127]", + progname, argv[0]); + strncpy(atd.ad_name, ifname, sizeof (atd.ad_name)); + atd.ad_id = op | ATH_DIAG_IN | ATH_DIAG_DYN; + atd.ad_out_data = NULL; + atd.ad_out_size = 0; + switch (op) { + case HAL_DIAG_RESETKEY: + atd.ad_in_data = (caddr_t) &keyix; + atd.ad_in_size = sizeof(u_int16_t); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + return 0; + case HAL_DIAG_SETKEY: + if (argc != 3 && argc != 4) + usage(); + memset(&setkey, 0, sizeof(setkey)); + setkey.dk_keyix = keyix; + setkey.dk_xor = xor; + setkey.dk_keyval.kv_type = getcipher(argv[1]); + setkey.dk_keyval.kv_len = getdata(argv[2], + setkey.dk_keyval.kv_val, sizeof(setkey.dk_keyval.kv_val)); + /* XXX MIC */ + if (argc == 4) + (void) getdata(argv[3], setkey.dk_mac, + IEEE80211_ADDR_LEN); + atd.ad_in_data = (caddr_t) &setkey; + atd.ad_in_size = sizeof(setkey); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + return 0; + } + return -1; +} Added: head/tools/tools/ath/athpow/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athpow/Makefile Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= athpow + +.include <../Makefile.inc> + +.include Added: head/tools/tools/ath/athpow/athpow.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athpow/athpow.c Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,198 @@ +/*- + * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#include "diag.h" + +#include +#include +#include + +#include "ah.h" +#include "ah_internal.h" +#include "ah_eeprom.h" +#include "ah_eeprom_v1.h" +#include "ah_eeprom_v3.h" +#include "ah_eeprom_v14.h" +#include "ar5212/ar5212reg.h" +#define IS_5112(ah) \ + (((ah)->ah_analog5GhzRev&0xf0) >= AR_RAD5112_SREV_MAJOR \ + && ((ah)->ah_analog5GhzRev&0xf0) < AR_RAD2316_SREV_MAJOR ) +#define IS_2316(ah) \ + ((ah)->ah_macVersion == AR_SREV_2415) +#define IS_2413(ah) \ + ((ah)->ah_macVersion == AR_SREV_2413 || IS_2316(ah)) +#define IS_5424(ah) \ + ((ah)->ah_macVersion == AR_SREV_5424 || \ + ((ah)->ah_macVersion == AR_SREV_5413 && \ + (ah)->ah_macRev <= AR_SREV_D2PLUS_MS)) +#define IS_5413(ah) \ + ((ah)->ah_macVersion == AR_SREV_5413 || IS_5424(ah)) + +#ifndef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +static void printPcdacTable(FILE *fd, u_int16_t pcdac[], u_int n); +static void printPowerPerRate(FILE *fd, u_int16_t ratesArray[], u_int n); +static void printRevs(FILE *fd, const HAL_REVS *revs); + +static void +usage(const char *progname) +{ + fprintf(stderr, "usage: %s [-v] [-i dev]\n", progname); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + int s, i, verbose = 0, c; + struct ath_diag atd; + const char *ifname; + HAL_REVS revs; + u_int16_t pcdacTable[MAX(PWR_TABLE_SIZE,PWR_TABLE_SIZE_2413)]; + u_int16_t ratesArray[16]; + u_int nrates, npcdac; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(1, "socket"); + ifname = getenv("ATH"); + if (!ifname) + ifname = ATH_DEFAULT; + while ((c = getopt(argc, argv, "i:v")) != -1) + switch (c) { + case 'i': + ifname = optarg; + break; + case 'v': + verbose++; + break; + default: + usage(argv[0]); + } + strncpy(atd.ad_name, ifname, sizeof (atd.ad_name)); + + atd.ad_id = HAL_DIAG_REVS; + atd.ad_out_data = (caddr_t) &revs; + atd.ad_out_size = sizeof(revs); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + + if (verbose) + printRevs(stdout, &revs); + + atd.ad_id = HAL_DIAG_TXRATES; + atd.ad_out_data = (caddr_t) ratesArray; + atd.ad_out_size = sizeof(ratesArray); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + nrates = sizeof(ratesArray) / sizeof(u_int16_t); + + atd.ad_id = HAL_DIAG_PCDAC; + atd.ad_out_data = (caddr_t) pcdacTable; + atd.ad_out_size = sizeof(pcdacTable); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + if (IS_2413(&revs) || IS_5413(&revs)) + npcdac = PWR_TABLE_SIZE_2413; + else + npcdac = PWR_TABLE_SIZE; + + printf("PCDAC table:\n"); + printPcdacTable(stdout, pcdacTable, npcdac); + + printf("Power per rate table:\n"); + printPowerPerRate(stdout, ratesArray, nrates); + + return 0; +} + +static void +printPcdacTable(FILE *fd, u_int16_t pcdac[], u_int n) +{ + int i, halfRates = n/2; + + for (i = 0; i < halfRates; i += 2) + fprintf(fd, "[%2u] %04x %04x [%2u] %04x %04x\n", + i, pcdac[2*i + 1], pcdac[2*i], + i+1, pcdac[2*(i+1) + 1], pcdac[2*(i+1)]); +} + +static void +printPowerPerRate(FILE *fd, u_int16_t ratesArray[], u_int n) +{ + const char *rateString[] = { + " 6mb OFDM", " 9mb OFDM", "12mb OFDM", "18mb OFDM", + "24mb OFDM", "36mb OFDM", "48mb OFDM", "54mb OFDM", + "1L CCK ", "2L CCK ", "2S CCK ", "5.5L CCK ", + "5.5S CCK ", "11L CCK ", "11S CCK ", "XR " + }; + int i, halfRates = n/2; + + for (i = 0; i < halfRates; i++) + fprintf(fd, " %s %3d.%1d dBm | %s %3d.%1d dBm\n", + rateString[i], ratesArray[i]/2, + (ratesArray[i] %2) * 5, + rateString[i + halfRates], + ratesArray[i + halfRates]/2, + (ratesArray[i + halfRates] %2) *5); +} + +static void +printRevs(FILE *fd, const HAL_REVS *revs) +{ + const char *rfbackend; + + fprintf(fd, "PCI device id 0x%x subvendor id 0x%x\n", + revs->ah_devid, revs->ah_subvendorid); + fprintf(fd, "mac %d.%d phy %d.%d" + , revs->ah_macVersion, revs->ah_macRev + , revs->ah_phyRev >> 4, revs->ah_phyRev & 0xf + ); + rfbackend = IS_5413(revs) ? "5413" : + IS_2413(revs) ? "2413" : + IS_5112(revs) ? "5112" : + "5111"; + if (revs->ah_analog5GhzRev && revs->ah_analog2GhzRev) + fprintf(fd, " 5ghz radio %d.%d 2ghz radio %d.%d (%s)\n" + , revs->ah_analog5GhzRev >> 4 + , revs->ah_analog5GhzRev & 0xf + , revs->ah_analog2GhzRev >> 4 + , revs->ah_analog2GhzRev & 0xf + , rfbackend + ); + else + fprintf(fd, " radio %d.%d (%s)\n" + , revs->ah_analog5GhzRev >> 4 + , revs->ah_analog5GhzRev & 0xf + , rfbackend + ); +} Added: head/tools/tools/ath/athprom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athprom/Makefile Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +PROG= athprom + +.include <../Makefile.inc> + +TEMPLATEDIR= /usr/local/libdata/athprom +TEXTMODE?= 444 + +CFLAGS+=-DDIR_TEMPLATE='"${TEMPLATEDIR}"' + +beforeinstall: + mkdir -p ${DESTDIR}${TEMPLATEDIR} + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${TEXTMODE} \ + ${.CURDIR}/eeprom-* ${DESTDIR}${TEMPLATEDIR}/ + +.include Added: head/tools/tools/ath/athprom/athprom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athprom/athprom.c Sun Dec 7 19:17:33 2008 (r185743) @@ -0,0 +1,978 @@ +/*- + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#include "diag.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_eeprom_v1.h" +#include "ah_eeprom_v3.h" +#include "ah_eeprom_v14.h" + +#define IS_VERS(op, v) (eeprom.ee_version op (v)) + +#include +#include +#include +#include +#include + +#ifndef DIR_TEMPLATE +#define DIR_TEMPLATE "/usr/local/libdata/athprom" +#endif + +struct ath_diag atd; +int s; +const char *progname; +union { + HAL_EEPROM legacy; /* format v3.x ... v5.x */ + struct ar5416eeprom v14; /* 11n format v14.x ... */ +} eep; +#define eeprom eep.legacy +#define eepromN eep.v14 + +static void parseTemplate(FILE *ftemplate, FILE *fd); +static uint16_t eeread(uint16_t); +static void eewrite(uint16_t, uint16_t); + +static void +usage() +{ + fprintf(stderr, "usage: %s [-i ifname] [-t pathname] [offset | offset=value]\n", progname); + exit(-1); +} + +static FILE * +opentemplate(const char *dir) +{ + char filename[PATH_MAX]; + FILE *fd; + + /* find the template using the eeprom version */ + snprintf(filename, sizeof(filename), "%s/eeprom-%d.%d", + dir, eeprom.ee_version >> 12, eeprom.ee_version & 0xfff); + fd = fopen(filename, "r"); + if (fd == NULL && errno == ENOENT) { + /* retry with just the major version */ + snprintf(filename, sizeof(filename), "%s/eeprom-%d", + dir, eeprom.ee_version >> 12); + fd = fopen(filename, "r"); + if (fd != NULL) /* XXX verbose */ + warnx("Using template file %s", filename); + } + return fd; +} + +int +main(int argc, char *argv[]) +{ + FILE *fd = NULL; + const char *ifname; + int c; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(1, "socket"); + ifname = getenv("ATH"); + if (!ifname) + ifname = ATH_DEFAULT; + + progname = argv[0]; + while ((c = getopt(argc, argv, "i:t:")) != -1) + switch (c) { + case 'i': + ifname = optarg; + break; + case 't': + fd = fopen(optarg, "r"); + if (fd == NULL) + err(-1, "Cannot open %s", optarg); + break; + default: + usage(); + /*NOTREACHED*/ + } + argc -= optind; + argv += optind; + + strncpy(atd.ad_name, ifname, sizeof (atd.ad_name)); + + if (argc != 0) { + for (; argc > 0; argc--, argv++) { + uint16_t off, val, oval; + char line[256]; + char *cp; + + cp = strchr(argv[0], '='); + if (cp != NULL) + *cp = '\0'; + off = (uint16_t) strtoul(argv[0], NULL, 0); + if (off == 0 && errno == EINVAL) + errx(1, "%s: invalid eeprom offset %s", + progname, argv[0]); + if (cp == NULL) { + printf("%04x: %04x\n", off, eeread(off)); + } else { + val = (uint16_t) strtoul(cp+1, NULL, 0); + if (val == 0 && errno == EINVAL) + errx(1, "%s: invalid eeprom value %s", + progname, cp+1); + oval = eeread(off); + printf("Write %04x: %04x = %04x? ", + off, oval, val); + fflush(stdout); + if (fgets(line, sizeof(line), stdin) != NULL && + line[0] == 'y') + eewrite(off, val); + } + } + } else { + atd.ad_id = HAL_DIAG_EEPROM; + atd.ad_out_data = (caddr_t) &eep; + atd.ad_out_size = sizeof(eep); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + if (fd == NULL) { + fd = opentemplate(DIR_TEMPLATE); + if (fd == NULL) + fd = opentemplate("."); + if (fd == NULL) + errx(-1, "Cannot locate template file for " + "v%d.%d EEPROM", eeprom.ee_version >> 12, + eeprom.ee_version & 0xfff); + } + parseTemplate(fd, stdout); + fclose(fd); + } + return 0; +} + +static u_int16_t +eeread(u_int16_t off) +{ + u_int16_t eedata; + + atd.ad_id = HAL_DIAG_EEREAD | ATH_DIAG_IN | ATH_DIAG_DYN; + atd.ad_in_size = sizeof(off); + atd.ad_in_data = (caddr_t) &off; + atd.ad_out_size = sizeof(eedata); + atd.ad_out_data = (caddr_t) &eedata; + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + return eedata; +} + +static void +eewrite(uint16_t off, uint16_t value) +{ + HAL_DIAG_EEVAL eeval; + + eeval.ee_off = off; + eeval.ee_data = value; + + atd.ad_id = HAL_DIAG_EEWRITE | ATH_DIAG_IN; + atd.ad_in_size = sizeof(eeval); + atd.ad_in_data = (caddr_t) &eeval; + atd.ad_out_size = 0; + atd.ad_out_data = NULL; + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); +} + +#define MAXID 128 +int lineno; +int bol; +int curmode = -1; +int curchan; +int curpdgain; /* raw pdgain index */ +int curlpdgain; /* logical pdgain index */ +int curpcdac; +int curctl; +int numChannels; +const RAW_DATA_STRUCT_2413 *pRaw; +const TRGT_POWER_INFO *pPowerInfo; +const DATA_PER_CHANNEL *pDataPerChannel; +const EEPROM_POWER_EXPN_5112 *pExpnPower; +int singleXpd; + +static int +token(FILE *fd, char id[], int maxid, const char *what) +{ + int c, i; + + i = 0; + for (;;) { + c = getc(fd); + if (c == EOF) + return EOF; + if (!isalnum(c) && c != '_') { + ungetc(c, fd); + break; + } + if (i == maxid-1) { + warnx("line %d, %s too long", lineno, what); + break; + } + id[i++] = c; + } + id[i] = '\0'; + if (i != 0) + bol = 0; + return i; +} + +static int +skipto(FILE *fd, const char *what) +{ + char id[MAXID]; + int c; + + for (;;) { + c = getc(fd); + if (c == EOF) + goto bad; + if (c == '.' && bol) { /* .directive */ + if (token(fd, id, MAXID, ".directive") == EOF) + goto bad; + if (strcasecmp(id, what) == 0) + break; + continue; + } + if (c == '\\') { /* escape next character */ + c = getc(fd); + if (c == EOF) + goto bad; + } + bol = (c == '\n'); + if (bol) + lineno++; + } + return 0; +bad: + warnx("EOF with no matching .%s", what); + return EOF; +} + +static int +skipws(FILE *fd) +{ + int c, i; + + i = 0; + while ((c = getc(fd)) != EOF && isblank(c)) + i++; + if (c != EOF) + ungetc(c, fd); + if (i != 0) + bol = 0; + return 0; +} + +static void +setmode(int mode) +{ + EEPROM_POWER_EXPN_5112 *exp; + + curmode = mode; + curchan = -1; + curctl = -1; + curpdgain = -1; + curlpdgain = -1; + curpcdac = -1; + switch (curmode) { + case headerInfo11A: + pPowerInfo = eeprom.ee_trgtPwr_11a; + pDataPerChannel = eeprom.ee_dataPerChannel11a; + break; + case headerInfo11B: + pPowerInfo = eeprom.ee_trgtPwr_11b; + pDataPerChannel = eeprom.ee_dataPerChannel11b; + break; + case headerInfo11G: + pPowerInfo = eeprom.ee_trgtPwr_11g; + pDataPerChannel = eeprom.ee_dataPerChannel11g; + break; + } + if (IS_VERS(<, AR_EEPROM_VER4_0)) /* nothing to do */ + return; + if (IS_VERS(<, AR_EEPROM_VER5_0)) { + exp = &eeprom.ee_modePowerArray5112[curmode]; + /* fetch indirect data*/ + atd.ad_id = HAL_DIAG_EEPROM_EXP_11A+curmode; + atd.ad_out_size = roundup( + sizeof(u_int16_t) * exp->numChannels, sizeof(u_int32_t)) + + sizeof(EXPN_DATA_PER_CHANNEL_5112) * exp->numChannels; + atd.ad_out_data = (caddr_t) malloc(atd.ad_out_size); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + exp->pChannels = (void *) atd.ad_out_data; + exp->pDataPerChannel = (void *)((char *)atd.ad_out_data + + roundup(sizeof(u_int16_t) * exp->numChannels, sizeof(u_int32_t))); + pExpnPower = exp; + numChannels = pExpnPower->numChannels; + if (exp->xpdMask != 0x9) { + for (singleXpd = 0; singleXpd < NUM_XPD_PER_CHANNEL; singleXpd++) + if (exp->xpdMask == (1<numChannels; + } +} + +int +nextctl(int start) +{ + int i; + + for (i = start; i < eeprom.ee_numCtls && eeprom.ee_ctl[i]; i++) { + switch (eeprom.ee_ctl[i] & 3) { + case 0: case 3: + if (curmode != headerInfo11A) + continue; + break; + case 1: + if (curmode != headerInfo11B) + continue; + break; + case 2: + if (curmode != headerInfo11G) + continue; + break; + } + return i; + } + return -1; +} + +static void +printAntennaControl(FILE *fd, int ant) +{ + fprintf(fd, "0x%02X", eeprom.ee_antennaControl[ant][curmode]); +} + +static void +printEdge(FILE *fd, int edge) +{ + const RD_EDGES_POWER *pRdEdgePwrInfo = + &eeprom.ee_rdEdgesPower[curctl*NUM_EDGES]; + + if (pRdEdgePwrInfo[edge].rdEdge == 0) + fprintf(fd, " -- "); + else + fprintf(fd, "%04d", pRdEdgePwrInfo[edge].rdEdge); +} + +static void +printEdgePower(FILE *fd, int edge) +{ + const RD_EDGES_POWER *pRdEdgePwrInfo = + &eeprom.ee_rdEdgesPower[curctl*NUM_EDGES]; + + if (pRdEdgePwrInfo[edge].rdEdge == 0) + fprintf(fd, " -- "); + else + fprintf(fd, "%2d.%d", + pRdEdgePwrInfo[edge].twice_rdEdgePower / 2, + (pRdEdgePwrInfo[edge].twice_rdEdgePower % 2) * 5); +} + +static void +printEdgeFlag(FILE *fd, int edge) +{ + const RD_EDGES_POWER *pRdEdgePwrInfo = + &eeprom.ee_rdEdgesPower[curctl*NUM_EDGES]; + + if (pRdEdgePwrInfo[edge].rdEdge == 0) + fprintf(fd, "--"); + else + fprintf(fd, " %1d", pRdEdgePwrInfo[edge].flag); +} + +static int16_t +getMaxPowerV5(const RAW_DATA_PER_CHANNEL_2413 *data) +{ + uint32_t i; + uint16_t numVpd; + + for (i = 0; i < MAX_NUM_PDGAINS_PER_CHANNEL; i++) { + numVpd = data->pDataPerPDGain[i].numVpd; + if (numVpd > 0) + return data->pDataPerPDGain[i].pwr_t4[numVpd-1]; + } + return 0; +} + +static void +printQuarterDbmPower(FILE *fd, int16_t power25dBm) +{ + fprintf(fd, "%2d.%02d", power25dBm / 4, (power25dBm % 4) * 25); +} + +static void +printHalfDbmPower(FILE *fd, int16_t power5dBm) +{ + fprintf(fd, "%2d.%d", power5dBm / 2, (power5dBm % 2) * 5); +} + +static void +printVpd(FILE *fd, int vpd) +{ + fprintf(fd, "[%3d]", vpd); +} + +static void +printPcdacValue(FILE *fd, int v) +{ + fprintf(fd, "%2d.%02d", v / EEP_SCALE, v % EEP_SCALE); +} + +static void +undef(const char *what) +{ + warnx("%s undefined for version %d.%d format EEPROM", what, + eeprom.ee_version >> 12, eeprom.ee_version & 0xfff); +} + +static int +pdgain(int lpdgain) +{ + uint32_t mask; + int i, l = lpdgain; + + if (IS_VERS(<, AR_EEPROM_VER5_0)) + mask = pExpnPower->xpdMask; + else + mask = pRaw->xpd_mask; + for (i = 0; mask != 0; mask >>= 1, i++) + if ((mask & 1) && l-- == 0) + return i; + warnx("can't find logical pdgain %d", lpdgain); + return -1; +} + +#define COUNTRY_ERD_FLAG 0x8000 +#define WORLDWIDE_ROAMING_FLAG 0x4000 + +void +eevar(FILE *fd, const char *var) +{ +#define streq(a,b) (strcasecmp(a,b) == 0) +#define strneq(a,b,n) (strncasecmp(a,b,n) == 0) + if (streq(var, "mode")) { + fprintf(fd, "%s", + curmode == headerInfo11A ? "11a" : + curmode == headerInfo11B ? "11b" : + curmode == headerInfo11G ? "11g" : "???"); + } else if (streq(var, "version")) { + fprintf(fd, "%04x", eeprom.ee_version); + } else if (streq(var, "V_major")) { + fprintf(fd, "%2d", eeprom.ee_version >> 12); + } else if (streq(var, "V_minor")) { + fprintf(fd, "%2d", eeprom.ee_version & 0xfff); + } else if (streq(var, "earStart")) { + fprintf(fd, "%03x", eeprom.ee_earStart); + } else if (streq(var, "tpStart")) { + fprintf(fd, "%03x", eeprom.ee_targetPowersStart); + } else if (streq(var, "eepMap")) { + fprintf(fd, "%3d", eeprom.ee_eepMap); + } else if (streq(var, "exist32KHzCrystal")) { + fprintf(fd, "%3d", eeprom.ee_exist32kHzCrystal); + } else if (streq(var, "eepMap2PowerCalStart")) { + fprintf(fd , "%3d", eeprom.ee_eepMap2PowerCalStart); + } else if (streq(var, "Amode")) { + fprintf(fd , "%1d", eeprom.ee_Amode); + } else if (streq(var, "Bmode")) { + fprintf(fd , "%1d", eeprom.ee_Bmode); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 19:26:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87481065679; Sun, 7 Dec 2008 19:26:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A81A8FC1F; Sun, 7 Dec 2008 19:26:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7JQYkm033767; Sun, 7 Dec 2008 19:26:34 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7JQYud033765; Sun, 7 Dec 2008 19:26:34 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812071926.mB7JQYud033765@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Dec 2008 19:26: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: r185744 - 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, 07 Dec 2008 19:26:34 -0000 Author: sam Date: Sun Dec 7 19:26:34 2008 New Revision: 185744 URL: http://svn.freebsd.org/changeset/base/185744 Log: New periodic calibration scheme needed for 11n parts that have multiple algorithms and potentially collect multiple samples. Instead of a single calibration interval we now have short and long intervals; the long interval roughly corresponds to the previous single interval. The short interval is used to speedup collection of samples and happens much quicker. We make calls using the short interval until we're told the calibration work is complete at which point we fallback to the long interval. In addition there is a much longer reset interval used to flush all calibration state and cause everthing to start anew. With these changes you can also disable calibration entirely by setting the long interval to zero. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Dec 7 19:17:33 2008 (r185743) +++ head/sys/dev/ath/if_ath.c Sun Dec 7 19:26:34 2008 (r185744) @@ -219,9 +219,15 @@ static void ath_announce(struct ath_soft SYSCTL_DECL(_hw_ath); /* XXX validate sysctl values */ -static int ath_calinterval = 30; /* calibrate every 30 secs */ -SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval, - 0, "chip calibration interval (secs)"); +static int ath_longcalinterval = 30; /* long cals every 30 secs */ +SYSCTL_INT(_hw_ath, OID_AUTO, longcal, CTLFLAG_RW, &ath_longcalinterval, + 0, "long chip calibration interval (secs)"); +static int ath_shortcalinterval = 100; /* short cals every 100 ms */ +SYSCTL_INT(_hw_ath, OID_AUTO, shortcal, CTLFLAG_RW, &ath_shortcalinterval, + 0, "short chip calibration interval (msecs)"); +static int ath_resetcalinterval = 20*60; /* reset cal state 20 mins */ +SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval, + 0, "reset chip calibration results (secs)"); static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf, @@ -1433,8 +1439,9 @@ ath_init(void *arg) * state cached in the driver. */ sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; + sc->sc_lastlongcal = 0; + sc->sc_resetcal = 1; + sc->sc_lastcalreset = 0; /* * Setup the hardware after reset: the key cache @@ -1566,8 +1573,6 @@ ath_reset(struct ifnet *ifp) if_printf(ifp, "%s: unable to reset hardware; hal status %u\n", __func__, status); sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; if (ath_startrecv(sc) != 0) /* restart recv */ if_printf(ifp, "%s: unable to start recv logic\n", __func__); /* @@ -5493,8 +5498,6 @@ ath_chan_set(struct ath_softc *sc, struc } sc->sc_curchan = hchan; sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; /* * Re-enable rx framework. @@ -5528,54 +5531,76 @@ ath_calibrate(void *arg) { struct ath_softc *sc = arg; struct ath_hal *ah = sc->sc_ah; - HAL_BOOL iqCalDone; - - sc->sc_stats.ast_per_cal++; + struct ifnet *ifp = sc->sc_ifp; + HAL_BOOL longCal, isCalDone; + int nextcal; - if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz); + if (longCal) { + sc->sc_stats.ast_per_cal++; + if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + /* + * Rfgain is out of bounds, reset the chip + * to load new gain values. + */ + DPRINTF(sc, ATH_DEBUG_CALIBRATE, + "%s: rfgain change\n", __func__); + sc->sc_stats.ast_per_rfgain++; + ath_reset(ifp); + } /* - * Rfgain is out of bounds, reset the chip - * to load new gain values. + * If this long cal is after an idle period, then + * reset the data collection state so we start fresh. */ - DPRINTF(sc, ATH_DEBUG_CALIBRATE, - "%s: rfgain change\n", __func__); - sc->sc_stats.ast_per_rfgain++; - ath_reset(sc->sc_ifp); + if (sc->sc_resetcal) { + (void) ath_hal_calreset(ah, &sc->sc_curchan); + sc->sc_lastcalreset = ticks; + sc->sc_resetcal = 0; + } } - if (!ath_hal_calibrate(ah, &sc->sc_curchan, &iqCalDone)) { + if (ath_hal_calibrateN(ah, &sc->sc_curchan, longCal, &isCalDone)) { + if (longCal) { + /* + * Calibrate noise floor data again in case of change. + */ + ath_hal_process_noisefloor(ah); + } + } else { DPRINTF(sc, ATH_DEBUG_ANY, "%s: calibration of channel %u failed\n", __func__, sc->sc_curchan.channel); sc->sc_stats.ast_per_calfail++; } - /* - * Calibrate noise floor data again in case of change. - */ - ath_hal_process_noisefloor(ah); - /* - * Poll more frequently when the IQ calibration is in - * progress to speedup loading the final settings. - * We temper this aggressive polling with an exponential - * back off after 4 tries up to ath_calinterval. - */ - if (iqCalDone || sc->sc_calinterval >= ath_calinterval) { - sc->sc_caltries = 0; - sc->sc_calinterval = ath_calinterval; - } else if (sc->sc_caltries > 4) { - sc->sc_caltries = 0; - sc->sc_calinterval <<= 1; - if (sc->sc_calinterval > ath_calinterval) - sc->sc_calinterval = ath_calinterval; - } - KASSERT(0 < sc->sc_calinterval && sc->sc_calinterval <= ath_calinterval, - ("bad calibration interval %u", sc->sc_calinterval)); - - DPRINTF(sc, ATH_DEBUG_CALIBRATE, - "%s: next +%u (%siqCalDone tries %u)\n", __func__, - sc->sc_calinterval, iqCalDone ? "" : "!", sc->sc_caltries); - sc->sc_caltries++; - callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz, - ath_calibrate, sc); + if (!isCalDone) { + /* + * Use a shorter interval to potentially collect multiple + * data samples required to complete calibration. Once + * we're told the work is done we drop back to a longer + * interval between requests. We're more aggressive doing + * work when operating as an AP to improve operation right + * after startup. + */ + nextcal = (1000*ath_shortcalinterval)/hz; + if (sc->sc_opmode != HAL_M_HOSTAP) + nextcal *= 10; + } else { + nextcal = ath_longcalinterval*hz; + sc->sc_lastlongcal = ticks; + if (sc->sc_lastcalreset == 0) + sc->sc_lastcalreset = sc->sc_lastlongcal; + else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz) + sc->sc_resetcal = 1; /* setup reset next trip */ + } + + if (nextcal != 0) { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: next +%u (%sisCalDone)\n", + __func__, nextcal, isCalDone ? "" : "!"); + callout_reset(&sc->sc_cal_ch, nextcal, ath_calibrate, sc); + } else { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: calibration disabled\n", + __func__); + /* NB: don't rearm timer */ + } } static void @@ -5803,10 +5828,12 @@ ath_newstate(struct ieee80211vap *vap, e * Finally, start any timers and the task q thread * (in case we didn't go through SCAN state). */ - if (sc->sc_calinterval != 0) { + if (ath_longcalinterval != 0) { /* start periodic recalibration timer */ - callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz, - ath_calibrate, sc); + callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc); + } else { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, + "%s: calibration disabled\n", __func__); } taskqueue_unblock(sc->sc_tq); } else if (nstate == IEEE80211_S_INIT) { Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Dec 7 19:17:33 2008 (r185743) +++ head/sys/dev/ath/if_athvar.h Sun Dec 7 19:26:34 2008 (r185744) @@ -248,7 +248,8 @@ struct ath_softc { sc_swbmiss : 1,/* sta mode using sw bmiss */ sc_stagbeacons:1,/* use staggered beacons */ sc_wmetkipmic:1,/* can do WME+TKIP MIC */ - sc_resume_up: 1;/* on resume, start all vaps */ + sc_resume_up: 1,/* on resume, start all vaps */ + sc_resetcal : 1;/* reset cal state next trip */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ @@ -334,8 +335,8 @@ struct ath_softc { int sc_nbcnvaps; /* # vaps with beacons */ struct callout sc_cal_ch; /* callout handle for cals */ - int sc_calinterval; /* current polling interval */ - int sc_caltries; /* cals at current interval */ + int sc_lastlongcal; /* last long cal completed */ + int sc_lastcalreset;/* last cal reset done */ HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */ }; @@ -438,6 +439,16 @@ void ath_intr(void *); ((*(_ah)->ah_setChannel)((_ah), (_chan))) #define ath_hal_calibrate(_ah, _chan, _iqcal) \ ((*(_ah)->ah_perCalibration)((_ah), (_chan), (_iqcal))) +#if HAL_ABI_VERSION >= 0x08111000 +#define ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \ + ((*(_ah)->ah_perCalibrationN)((_ah), (_chan), 0x1, (_lcal), (_isdone))) +#define ath_hal_calreset(_ah, _chan) \ + ((*(_ah)->ah_resetCalValid)((_ah), (_chan))) +#else +#define ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \ + ath_hal_calibrate(_ah, _chan, _isdone) +#define ath_hal_calreset(_ah, _chan) (0) +#endif #define ath_hal_setledstate(_ah, _state) \ ((*(_ah)->ah_setLedState)((_ah), (_state))) #define ath_hal_beaconinit(_ah, _nextb, _bperiod) \ From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 19:29:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F2C106564A; Sun, 7 Dec 2008 19:29:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 649988FC16; Sun, 7 Dec 2008 19:29:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7JTCMe033856; Sun, 7 Dec 2008 19:29:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7JTCjB033855; Sun, 7 Dec 2008 19:29:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812071929.mB7JTCjB033855@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Dec 2008 19:29: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: r185745 - 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, 07 Dec 2008 19:29:12 -0000 Author: sam Date: Sun Dec 7 19:29:11 2008 New Revision: 185745 URL: http://svn.freebsd.org/changeset/base/185745 Log: honor IEEE80211_BPF_CRYPTO for raw xmit; fixes shared key auth in sta mode PR: kern/129022 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Dec 7 19:26:34 2008 (r185744) +++ head/sys/dev/ath/if_ath.c Sun Dec 7 19:29:11 2008 (r185745) @@ -6912,7 +6912,7 @@ ath_tx_raw_start(struct ath_softc *sc, s struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; int error, ismcast, ismrr; - int hdrlen, pktlen, try0, txantenna; + int keyix, hdrlen, pktlen, try0, txantenna; u_int8_t rix, cix, txrate, ctsrate, rate1, rate2, rate3; struct ieee80211_frame *wh; u_int flags, ctsduration; @@ -6931,6 +6931,54 @@ ath_tx_raw_start(struct ath_softc *sc, s /* XXX honor IEEE80211_BPF_DATAPAD */ pktlen = m0->m_pkthdr.len - (hdrlen & 3) + IEEE80211_CRC_LEN; + if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { + const struct ieee80211_cipher *cip; + struct ieee80211_key *k; + + /* + * Construct the 802.11 header+trailer for an encrypted + * frame. The only reason this can fail is because of an + * unknown or unsupported cipher/key type. + */ + k = ieee80211_crypto_encap(ni, m0); + if (k == NULL) { + /* + * This can happen when the key is yanked after the + * frame was queued. Just discard the frame; the + * 802.11 layer counts failures and provides + * debugging/diagnostics. + */ + ath_freetx(m0); + return EIO; + } + /* + * Adjust the packet + header lengths for the crypto + * additions and calculate the h/w key index. When + * a s/w mic is done the frame will have had any mic + * added to it prior to entry so m0->m_pkthdr.len will + * account for it. Otherwise we need to add it to the + * packet length. + */ + cip = k->wk_cipher; + hdrlen += cip->ic_header; + pktlen += cip->ic_header + cip->ic_trailer; + /* NB: frags always have any TKIP MIC done in s/w */ + if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0) + pktlen += cip->ic_miclen; + keyix = k->wk_keyix; + + /* packet header may have moved, reset our local pointer */ + wh = mtod(m0, struct ieee80211_frame *); + } else if (ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) { + /* + * Use station key cache slot, if assigned. + */ + keyix = ni->ni_ucastkey.wk_keyix; + if (keyix == IEEE80211_KEYIX_NONE) + keyix = HAL_TXKEYIX_INVALID; + } else + keyix = HAL_TXKEYIX_INVALID; + error = ath_tx_dmasetup(sc, bf, m0); if (error != 0) return error; @@ -7019,7 +7067,7 @@ ath_tx_raw_start(struct ath_softc *sc, s , atype /* Atheros packet type */ , params->ibp_power /* txpower */ , txrate, try0 /* series 0 rate/tries */ - , HAL_TXKEYIX_INVALID /* key cache index */ + , keyix /* key cache index */ , txantenna /* antenna mode */ , flags /* flags */ , ctsrate /* rts/cts rate */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 19:42:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E2ED1065670; Sun, 7 Dec 2008 19:42:20 +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 4B89A8FC22; Sun, 7 Dec 2008 19:42:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7JgK3w034138; Sun, 7 Dec 2008 19:42:20 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7JgK94034137; Sun, 7 Dec 2008 19:42:20 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200812071942.mB7JgK94034137@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 7 Dec 2008 19:42: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: r185746 - 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: Sun, 07 Dec 2008 19:42:20 -0000 Author: luigi Date: Sun Dec 7 19:42:20 2008 New Revision: 185746 URL: http://svn.freebsd.org/changeset/base/185746 Log: PROBLEM: putting in a loader config file a line of the form loader_conf_files="foo bar baz" should cause loading the files listed, and then resume with the remaining config files (from previous values of the variable). Unfortunately, sometimes the line was ignored -- actually even modifying the line in /boot/default/loader.conf sometimes doesn't work. ANALYSIS: After much investigation, turned out to be a bug in the logic. The existing code detected a new assignment by looking at the address of the the variable containing the string. This only worked by pure chance, i.e. if the new string is longer than the previous value then the memory allocator may return a different address to store the string hence triggering the detection. SOLUTION: This commit contains a minimal change to fix the problem, without altering too much the existing structure of the code. However, as a step towards improving the quality and reliability of this code, I have introduced a handful of one-line functions (strget, strset, strfree, string= ) that could be used in dozens of places in the existing code. HOWEVER: There is a much bigger problem here. Even though I am no Forth expert (as most fellow src committers) I can tell that much of the forth code (in support.4th at least) is in severe need of a review/refactoring: + pieces of code are replicated multiple times instead of writing functions (see e.g. set_module_*); + a lot of stale code (e.g. "structure" definitions for preloaded_files, kernel_module, pnp stuff) which is not used or at least belongs elsewhere. The code bload is extremely bad as the loader runs with very small memory constraints, and we already hit the limit once (see http://svn.freebsd.org/viewvc/base?view=revision&revision=185132 Reducing the footprint of the forth files is critical. + two different styles of coding, one using pure stack functions (maybe beautiful but surely highly unreadable), one using high level mechanisms to give names to arguments and local variables (which leads to readable code). Note that this code is used by default by all FreeBSD installations, so the fragility and the code bloat are extremely damaging. I will try to work fixing the three items above, but if others have time, please have a look at these issues. MFC after: 4 weeks Modified: head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Sun Dec 7 19:29:11 2008 (r185745) +++ head/sys/boot/forth/support.4th Sun Dec 7 19:42:20 2008 (r185746) @@ -288,6 +288,17 @@ only forth also support-functions defini : free-memory free if free_error throw then ; +: strget { var -- addr len } var .addr @ var .len @ ; + +\ assign addr len to variable. +: strset { addr len var -- } addr var .addr ! len var .len ! ; + +\ free memory and reset fields +: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ; + +\ free old content, make a copy of the string and assign to variable +: string= { addr len var -- } var strfree addr len strdup var strset ; + \ Assignment data temporary storage string name_buffer @@ -712,19 +723,6 @@ only forth also support-functions also f module_loaderror_suffix suffix_type? ; -: set_conf_files - conf_files .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - - else - value_buffer .addr @ value_buffer .len @ - then - strdup - conf_files .len ! conf_files .addr ! -; - : set_nextboot_conf nextboot_conf_file .addr @ ?dup if free-memory @@ -888,6 +886,11 @@ only forth also support-functions also f then ; +: set_conf_files + set_environment_variable + s" loader_conf_files" getenv conf_files string= +; + : set_nextboot_flag yes_value? to nextboot? ; @@ -1045,7 +1048,6 @@ only forth also support-functions defini \ Variables used for processing multiple conf files string current_file_name -variable current_conf_files \ Indicates if any conf file was succesfully read @@ -1053,16 +1055,8 @@ variable current_conf_files \ loader_conf_files processing support functions -: set_current_conf_files - conf_files .addr @ current_conf_files ! -; - -: get_conf_files - conf_files .addr @ conf_files .len @ strdup -; - -: recurse_on_conf_files? - current_conf_files @ conf_files .addr @ <> +: get_conf_files ( -- addr len ) \ put addr/len on stack, reset var + conf_files strget 0 0 conf_files strset ; : skip_leading_spaces { addr len pos -- addr len pos' } @@ -1133,7 +1127,6 @@ variable current_conf_files \ Interface to loader_conf_files processing : include_conf_files - set_current_conf_files get_conf_files 0 begin get_next_file ?dup @@ -1141,7 +1134,7 @@ variable current_conf_files set_current_file_name ['] load_conf catch process_conf_errors - recurse_on_conf_files? if recurse then + conf_files .addr @ if recurse then repeat ; From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 21:15:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DC5A1065678; Sun, 7 Dec 2008 21:15:44 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09E478FC1F; Sun, 7 Dec 2008 21:15:44 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7LFhoe036519; Sun, 7 Dec 2008 21:15:43 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7LFhD1036508; Sun, 7 Dec 2008 21:15:43 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812072115.mB7LFhD1036508@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Dec 2008 21:15: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: r185747 - in head/sys: contrib/pf/net kern net 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: Sun, 07 Dec 2008 21:15:44 -0000 Author: kmacy Date: Sun Dec 7 21:15:43 2008 New Revision: 185747 URL: http://svn.freebsd.org/changeset/base/185747 Log: - convert radix node head lock from mutex to rwlock - make radix node head lock not recursive - fix LOR in rtexpunge - fix LOR in rtredirect Reviewed by: sam Modified: head/sys/contrib/pf/net/pf_table.c head/sys/kern/subr_witness.c head/sys/kern/vfs_export.c head/sys/net/radix.c head/sys/net/radix.h head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/contrib/pf/net/pf_table.c ============================================================================== --- head/sys/contrib/pf/net/pf_table.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/contrib/pf/net/pf_table.c Sun Dec 7 21:15:43 2008 (r185747) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #ifdef __FreeBSD__ #include #endif Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/kern/subr_witness.c Sun Dec 7 21:15:43 2008 (r185747) @@ -505,7 +505,7 @@ static struct witness_order_list_entry o * Routing */ { "so_rcv", &lock_class_mtx_sleep }, - { "radix node head", &lock_class_mtx_sleep }, + { "radix node head", &lock_class_rw }, { "rtentry", &lock_class_mtx_sleep }, { "ifaddr", &lock_class_mtx_sleep }, { NULL, NULL }, Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/kern/vfs_export.c Sun Dec 7 21:15:43 2008 (r185747) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -425,10 +426,10 @@ vfs_export_lookup(struct mount *mp, stru saddr = nam; rnh = nep->ne_rtable[saddr->sa_family]; if (rnh != NULL) { - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_RLOCK(rnh); np = (struct netcred *) (*rnh->rnh_matchaddr)(saddr, rnh); - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); if (np && np->netc_rnodes->rn_flags & RNF_ROOT) np = NULL; } Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/net/radix.c Sun Dec 7 21:15:43 2008 (r185747) @@ -38,6 +38,7 @@ #ifdef _KERNEL #include #include +#include #include #include #include Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/net/radix.h Sun Dec 7 21:15:43 2008 (r185747) @@ -36,6 +36,7 @@ #ifdef _KERNEL #include #include +#include #endif #ifdef MALLOC_DECLARE @@ -132,7 +133,7 @@ struct radix_node_head { struct radix_node rnh_nodes[3]; /* empty tree for common case */ int rnh_multipath; /* multipath capable ? */ #ifdef _KERNEL - struct mtx rnh_mtx; /* locks entire radix tree */ + struct rwlock rnh_lock; /* locks entire radix tree */ #endif }; @@ -146,11 +147,17 @@ struct radix_node_head { #define Free(p) free((caddr_t)p, M_RTABLE); #define RADIX_NODE_HEAD_LOCK_INIT(rnh) \ - mtx_init(&(rnh)->rnh_mtx, "radix node head", NULL, MTX_DEF | MTX_RECURSE) -#define RADIX_NODE_HEAD_LOCK(rnh) mtx_lock(&(rnh)->rnh_mtx) -#define RADIX_NODE_HEAD_UNLOCK(rnh) mtx_unlock(&(rnh)->rnh_mtx) -#define RADIX_NODE_HEAD_DESTROY(rnh) mtx_destroy(&(rnh)->rnh_mtx) -#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) mtx_assert(&(rnh)->rnh_mtx, MA_OWNED) + rw_init_flags(&(rnh)->rnh_lock, "radix node head", 0) +#define RADIX_NODE_HEAD_LOCK(rnh) rw_wlock(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_UNLOCK(rnh) rw_wunlock(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_RLOCK(rnh) rw_rlock(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_RUNLOCK(rnh) rw_runlock(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_LOCK_TRY_UPGRADE(rnh) rw_try_upgrade(&(rnh)->rnh_lock) + + +#define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED) +#define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ void rn_init(void); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/net/route.c Sun Dec 7 21:15:43 2008 (r185747) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,8 @@ rtalloc1_fib(struct sockaddr *dst, int r struct rtentry *newrt; struct rt_addrinfo info; u_long nflags; - int err = 0, msgtype = RTM_MISS; + int needresolve = 0, err = 0, msgtype = RTM_MISS; + int needlock; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ @@ -283,59 +285,92 @@ rtalloc1_fib(struct sockaddr *dst, int r V_rtstat.rts_unreach++; goto miss2; } - RADIX_NODE_HEAD_LOCK(rnh); - if ((rn = rnh->rnh_matchaddr(dst, rnh)) && - (rn->rn_flags & RNF_ROOT) == 0) { - /* - * If we find it and it's not the root node, then - * get a reference on the rtentry associated. - */ + needlock = !(ignflags & RTF_RNH_LOCKED); +retry: + if (needlock) + RADIX_NODE_HEAD_RLOCK(rnh); +#ifdef INVARIANTS + else + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); +#endif + rn = rnh->rnh_matchaddr(dst, rnh); + if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { + newrt = rt = RNTORT(rn); nflags = rt->rt_flags & ~ignflags; if (report && (nflags & RTF_CLONING)) { - /* - * We are apparently adding (report = 0 in delete). - * If it requires that it be cloned, do so. - * (This implies it wasn't a HOST route.) - */ - err = rtrequest_fib(RTM_RESOLVE, dst, NULL, - NULL, 0, &newrt, fibnum); - if (err) { + if (needlock && !RADIX_NODE_HEAD_LOCK_TRY_UPGRADE(rnh)) { + RADIX_NODE_HEAD_RUNLOCK(rnh); + RADIX_NODE_HEAD_LOCK(rnh); /* - * If the cloning didn't succeed, maybe - * what we have will do. Return that. + * lookup again to make sure it wasn't changed */ - newrt = rt; /* existing route */ - RT_LOCK(newrt); - RT_ADDREF(newrt); - goto miss; - } - KASSERT(newrt, ("no route and no error")); - RT_LOCK(newrt); - if (newrt->rt_flags & RTF_XRESOLVE) { - /* - * If the new route specifies it be - * externally resolved, then go do that. - */ - msgtype = RTM_RESOLVE; - goto miss; - } - /* Inform listeners of the new route. */ - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = rt_key(newrt); - info.rti_info[RTAX_NETMASK] = rt_mask(newrt); - info.rti_info[RTAX_GATEWAY] = newrt->rt_gateway; - if (newrt->rt_ifp != NULL) { - info.rti_info[RTAX_IFP] = - newrt->rt_ifp->if_addr->ifa_addr; - info.rti_info[RTAX_IFA] = newrt->rt_ifa->ifa_addr; + rn = rnh->rnh_matchaddr(dst, rnh); + if (!(rn && ((rn->rn_flags & RNF_ROOT) == 0))) { + RADIX_NODE_HEAD_UNLOCK(rnh); + needresolve = 0; + log(LOG_INFO, "retrying route lookup ...\n"); + goto retry; + } } - rt_missmsg(RTM_ADD, &info, newrt->rt_flags, 0); + needresolve = 1; } else { RT_LOCK(newrt); RT_ADDREF(newrt); + if (needlock) + RADIX_NODE_HEAD_RUNLOCK(rnh); + goto done; } - RADIX_NODE_HEAD_UNLOCK(rnh); + } + /* + * if needresolve is set then we have the exclusive lock + * and we need to keep it held for the benefit of rtrequest_fib + */ + if (!needresolve && needlock) + RADIX_NODE_HEAD_RUNLOCK(rnh); + + if (needresolve) { + RADIX_NODE_HEAD_WLOCK_ASSERT(rnh); + /* + * We are apparently adding (report = 0 in delete). + * If it requires that it be cloned, do so. + * (This implies it wasn't a HOST route.) + */ + err = rtrequest_fib(RTM_RESOLVE, dst, NULL, + NULL, RTF_RNH_LOCKED, &newrt, fibnum); + if (err) { + /* + * If the cloning didn't succeed, maybe + * what we have will do. Return that. + */ + newrt = rt; /* existing route */ + RT_LOCK(newrt); + RT_ADDREF(newrt); + goto miss; + } + KASSERT(newrt, ("no route and no error")); + RT_LOCK(newrt); + if (newrt->rt_flags & RTF_XRESOLVE) { + /* + * If the new route specifies it be + * externally resolved, then go do that. + */ + msgtype = RTM_RESOLVE; + goto miss; + } + /* Inform listeners of the new route. */ + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = rt_key(newrt); + info.rti_info[RTAX_NETMASK] = rt_mask(newrt); + info.rti_info[RTAX_GATEWAY] = newrt->rt_gateway; + if (newrt->rt_ifp != NULL) { + info.rti_info[RTAX_IFP] = + newrt->rt_ifp->if_addr->ifa_addr; + info.rti_info[RTAX_IFA] = newrt->rt_ifa->ifa_addr; + } + rt_missmsg(RTM_ADD, &info, newrt->rt_flags, 0); + if (needlock) + RADIX_NODE_HEAD_UNLOCK(rnh); } else { /* * Either we hit the root or couldn't find any match, @@ -344,7 +379,8 @@ rtalloc1_fib(struct sockaddr *dst, int r */ V_rtstat.rts_unreach++; miss: - RADIX_NODE_HEAD_UNLOCK(rnh); + if (needlock && needresolve) + RADIX_NODE_HEAD_UNLOCK(rnh); miss2: if (report) { /* * If required, report the failure to the supervising @@ -356,6 +392,7 @@ rtalloc1_fib(struct sockaddr *dst, int r rt_missmsg(msgtype, &info, 0, err); } } +done: if (newrt) RT_LOCK_ASSERT(newrt); return (newrt); @@ -475,6 +512,8 @@ rtredirect_fib(struct sockaddr *dst, short *stat = NULL; struct rt_addrinfo info; struct ifaddr *ifa; + struct radix_node_head *rnh = + V_rt_tables[rt->rt_fibnum][dst->sa_family]; /* verify the gateway is directly reachable */ if ((ifa = ifa_ifwithnet(gateway)) == NULL) { @@ -524,14 +563,17 @@ rtredirect_fib(struct sockaddr *dst, info.rti_info[RTAX_NETMASK] = netmask; info.rti_ifa = ifa; info.rti_flags = flags; + if (rt0 != NULL) + RT_UNLOCK(rt0); /* drop lock to avoid LOR with RNH */ error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); if (rt != NULL) { RT_LOCK(rt); - EVENTHANDLER_INVOKE(route_redirect_event, rt0, rt, dst); + if (rt0 != NULL) + EVENTHANDLER_INVOKE(route_redirect_event, rt0, rt, dst); flags = rt->rt_flags; } - if (rt0) - RTFREE_LOCKED(rt0); + if (rt0 != NULL) + RTFREE(rt0); stat = &V_rtstat.rts_dynamic; } else { @@ -547,8 +589,12 @@ rtredirect_fib(struct sockaddr *dst, /* * add the key and gateway (in one malloc'd chunk). */ + RT_UNLOCK(rt); + RADIX_NODE_HEAD_LOCK(rnh); + RT_LOCK(rt); rt_setgate(rt, rt_key(rt), gateway); - gwrt = rtalloc1(gateway, 1, 0); + gwrt = rtalloc1(gateway, 1, RTF_RNH_LOCKED); + RADIX_NODE_HEAD_UNLOCK(rnh); EVENTHANDLER_INVOKE(route_redirect_event, rt, gwrt, dst); RTFREE_LOCKED(gwrt); } @@ -782,7 +828,9 @@ rtexpunge(struct rtentry *rt) struct ifaddr *ifa; int error = 0; + rnh = V_rt_tables[rt->rt_fibnum][rt_key(rt)->sa_family]; RT_LOCK_ASSERT(rt); + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); #if 0 /* * We cannot assume anything about the reference count @@ -798,8 +846,6 @@ rtexpunge(struct rtentry *rt) if (rnh == NULL) return (EAFNOSUPPORT); - RADIX_NODE_HEAD_LOCK(rnh); - /* * Remove the item from the tree; it should be there, * but when callers invoke us blindly it may not (sigh). @@ -854,7 +900,6 @@ rtexpunge(struct rtentry *rt) */ V_rttrash++; bad: - RADIX_NODE_HEAD_UNLOCK(rnh); return (error); } @@ -869,7 +914,7 @@ rtrequest1_fib(int req, struct rt_addrin u_int fibnum) { INIT_VNET_NET(curvnet); - int error = 0; + int error = 0, needlock = 0; register struct rtentry *rt; register struct radix_node *rn; register struct radix_node_head *rnh; @@ -886,7 +931,10 @@ rtrequest1_fib(int req, struct rt_addrin rnh = V_rt_tables[fibnum][dst->sa_family]; if (rnh == NULL) return (EAFNOSUPPORT); - RADIX_NODE_HEAD_LOCK(rnh); + needlock = ((flags & RTF_RNH_LOCKED) == 0); + flags &= ~RTF_RNH_LOCKED; + if (needlock) + RADIX_NODE_HEAD_LOCK(rnh); /* * If we are adding a host route then we don't want to put * a netmask in the tree, nor do we want to clone it. @@ -1200,7 +1248,8 @@ deldone: error = EOPNOTSUPP; } bad: - RADIX_NODE_HEAD_UNLOCK(rnh); + if (needlock) + RADIX_NODE_HEAD_UNLOCK(rnh); return (error); #undef senderr } @@ -1307,7 +1356,8 @@ rt_setgate(struct rtentry *rt, struct so again: RT_LOCK_ASSERT(rt); - + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); + /* * A host route with the destination equal to the gateway * will interfere with keeping LLINFO in the routing @@ -1333,7 +1383,7 @@ again: struct rtentry *gwrt; RT_UNLOCK(rt); /* XXX workaround LOR */ - gwrt = rtalloc1_fib(gate, 1, 0, rt->rt_fibnum); + gwrt = rtalloc1_fib(gate, 1, RTF_RNH_LOCKED, rt->rt_fibnum); if (gwrt == rt) { RT_REMREF(rt); return (EADDRINUSE); /* failure */ @@ -1404,12 +1454,8 @@ again: arg.rnh = rnh; arg.rt0 = rt; - RT_UNLOCK(rt); /* XXX workaround LOR */ - RADIX_NODE_HEAD_LOCK(rnh); - RT_LOCK(rt); rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), rt_fixchange, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); } return 0; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/net/route.h Sun Dec 7 21:15:43 2008 (r185747) @@ -196,6 +196,7 @@ struct ortentry { #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ /* 0x1000000 and up unassigned */ +#define RTF_RNH_LOCKED 0x40000000 /* radix node head locked by caller */ /* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */ #define RTF_FMASK \ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/net/rtsock.c Sun Dec 7 21:15:43 2008 (r185747) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -554,11 +555,11 @@ route_output(struct mbuf *m, struct sock rnh = V_rt_tables[so->so_fibnum][info.rti_info[RTAX_DST]->sa_family]; if (rnh == NULL) senderr(EAFNOSUPPORT); - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_RLOCK(rnh); rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST], info.rti_info[RTAX_NETMASK], rnh); if (rt == NULL) { /* XXX looks bogus */ - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); senderr(ESRCH); } #ifdef RADIX_MPATH @@ -574,14 +575,14 @@ route_output(struct mbuf *m, struct sock (rtm->rtm_type != RTM_GET || info.rti_info[RTAX_GATEWAY])) { rt = rt_mpath_matchgate(rt, info.rti_info[RTAX_GATEWAY]); if (!rt) { - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); senderr(ESRCH); } } #endif RT_LOCK(rt); RT_ADDREF(rt); - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); /* * Fix for PR: 82974 Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/netinet6/in6_rmx.c Sun Dec 7 21:15:43 2008 (r185747) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sun Dec 7 19:42:20 2008 (r185746) +++ head/sys/netinet6/nd6_rtr.c Sun Dec 7 21:15:43 2008 (r185747) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 21:32:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECDED1065676; Sun, 7 Dec 2008 21:32:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1DF78FC08; Sun, 7 Dec 2008 21:32:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7LWuJY036874; Sun, 7 Dec 2008 21:32:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7LWuIT036873; Sun, 7 Dec 2008 21:32:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812072132.mB7LWuIT036873@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Dec 2008 21:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185748 - 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: Sun, 07 Dec 2008 21:32:57 -0000 Author: thompsa Date: Sun Dec 7 21:32:56 2008 New Revision: 185748 URL: http://svn.freebsd.org/changeset/base/185748 Log: Restore opt_inet.h include which was lost in the last commit. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Dec 7 21:15:43 2008 (r185747) +++ head/sys/dev/e1000/if_em.c Sun Dec 7 21:32:56 2008 (r185748) @@ -34,6 +34,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" +#include "opt_inet.h" #endif #include From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 22:49:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71EDF1065670; Sun, 7 Dec 2008 22:49:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 607698FC18; Sun, 7 Dec 2008 22:49:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7Mnm12038342; Sun, 7 Dec 2008 22:49:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7MnmdA038341; Sun, 7 Dec 2008 22:49:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812072249.mB7MnmdA038341@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Dec 2008 22:49: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: r185749 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 22:49:48 -0000 Author: imp Date: Sun Dec 7 22:49:47 2008 New Revision: 185749 URL: http://svn.freebsd.org/changeset/base/185749 Log: Minor tweaks to some of the comments. Also, add a XXX wondering if we need to frob the 16-bit EXCA registers during the new interrupt-driven power-up sequence. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Sun Dec 7 21:32:56 2008 (r185748) +++ head/sys/dev/pccbb/pccbb.c Sun Dec 7 22:49:47 2008 (r185749) @@ -765,15 +765,17 @@ cbb_power(device_t brdev, int volts) reg = cbb_o2micro_power_hack(sc); /* - * We have to mask the card change detect interrupt while - * we're messing with the power. It is allowed to bounce - * while we're messing with power as things settle down. In - * addition, we mask off the card's function interrupt by - * routing it via the ISA bus. This bit generally only - * affects 16-bit cards. Some bridges allow one to set - * another bit to have it also affect 32-bit cards. Since - * 32-bit cards are required to be better behaved, we don't - * bother to get into those bridge specific features. + * We have to mask the card change detect interrupt while we're + * messing with the power. It is allowed to bounce while we're + * messing with power as things settle down. In addition, we mask off + * the card's function interrupt by routing it via the ISA bus. This + * bit generally only affects 16-bit cards. Some bridges allow one to + * set another bit to have it also affect 32-bit cards. Since 32-bit + * cards are required to be better behaved, we don't bother to get + * into those bridge specific features. + * + * XXX I wonder if we need to enable the READY bit interrupt in the + * EXCA CSC register for 16-bit cards, and disable the CD bit? */ mask = cbb_get(sc, CBB_SOCKET_MASK); mask |= CBB_SOCKET_MASK_POWER; @@ -786,11 +788,10 @@ cbb_power(device_t brdev, int volts) mtx_lock(&sc->mtx); cnt = sc->powerintr; /* - * We have a shortish timeout of 500ms here. Some - * bridges do not generate a POWER_CYCLE event for - * 16-bit cards. In those cases, we have to cope the - * best we can, and having only a short delay is - * better than the alternatives. + * We have a shortish timeout of 500ms here. Some bridges do + * not generate a POWER_CYCLE event for 16-bit cards. In + * those cases, we have to cope the best we can, and having + * only a short delay is better than the alternatives. */ sane = 10; while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) && @@ -798,9 +799,9 @@ cbb_power(device_t brdev, int volts) msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20); mtx_unlock(&sc->mtx); /* - * The TOPIC95B requires a little bit extra time to get - * its act together, so delay for an additional 100ms. Also - * as documented below, it doesn't seem to set the POWER_CYCLE + * The TOPIC95B requires a little bit extra time to get its + * act together, so delay for an additional 100ms. Also as + * documented below, it doesn't seem to set the POWER_CYCLE * bit, so don't whine if it never came on. */ if (sc->chipset == CB_TOPIC95) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 23:02:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372B41065676; Sun, 7 Dec 2008 23:02:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2522B8FC21; Sun, 7 Dec 2008 23:02:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB7N2c5t038635; Sun, 7 Dec 2008 23:02:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB7N2bkp038633; Sun, 7 Dec 2008 23:02:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200812072302.mB7N2bkp038633@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Dec 2008 23:02: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: r185750 - head/sys/dev/dc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 07 Dec 2008 23:02:38 -0000 Author: marius Date: Sun Dec 7 23:02:37 2008 New Revision: 185750 URL: http://svn.freebsd.org/changeset/base/185750 Log: - According to the corresponding Linux, NetBSD and OpenSolaris drivers, there should be a 1us delay after every write when bit-banging the MII. Also insert barriers in order to ensure the intended ordering. These changes hopefully will solve the bus wedging occasionally experienced with DM9102A since r182461. - Deobfuscate dc_mii_readreg() a bit. Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sun Dec 7 22:49:47 2008 (r185749) +++ head/sys/dev/dc/if_dc.c Sun Dec 7 23:02:37 2008 (r185750) @@ -607,15 +607,22 @@ dc_read_eeprom(struct dc_softc *sc, cadd static void dc_mii_writebit(struct dc_softc *sc, int bit) { + uint32_t reg; - if (bit) - CSR_WRITE_4(sc, DC_SIO, - DC_SIO_ROMCTL_WRITE | DC_SIO_MII_DATAOUT); - else - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); - - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_WRITE | (bit != 0 ? DC_SIO_MII_DATAOUT : 0); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); } /* @@ -624,11 +631,22 @@ dc_mii_writebit(struct dc_softc *sc, int static int dc_mii_readbit(struct dc_softc *sc) { + uint32_t reg; - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR); - CSR_READ_4(sc, DC_SIO); - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR; + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + (void)CSR_READ_4(sc, DC_SIO); + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); if (CSR_READ_4(sc, DC_SIO) & DC_SIO_MII_DATAIN) return (1); @@ -644,6 +662,9 @@ dc_mii_sync(struct dc_softc *sc) int i; CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); for (i = 0; i < 32; i++) dc_mii_writebit(sc, 1); @@ -667,15 +688,13 @@ dc_mii_send(struct dc_softc *sc, u_int32 static int dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame) { - int i, ack; + int i; /* * Set up frame for RX. */ frame->mii_stdelim = DC_MII_STARTDELIM; frame->mii_opcode = DC_MII_READOP; - frame->mii_turnaround = 0; - frame->mii_data = 0; /* * Sync the PHYs. @@ -690,38 +709,28 @@ dc_mii_readreg(struct dc_softc *sc, stru dc_mii_send(sc, frame->mii_phyaddr, 5); dc_mii_send(sc, frame->mii_regaddr, 5); -#ifdef notdef - /* Idle bit */ - dc_mii_writebit(sc, 1); - dc_mii_writebit(sc, 0); -#endif - - /* Check for ack. */ - ack = dc_mii_readbit(sc); - /* - * Now try reading data bits. If the ack failed, we still + * Now try reading data bits. If the turnaround failed, we still * need to clock through 16 cycles to keep the PHY(s) in sync. */ - if (ack) { + frame->mii_turnaround = dc_mii_readbit(sc); + if (frame->mii_turnaround != 0) { for (i = 0; i < 16; i++) dc_mii_readbit(sc); goto fail; } - for (i = 0x8000; i; i >>= 1) { - if (!ack) { - if (dc_mii_readbit(sc)) - frame->mii_data |= i; - } + if (dc_mii_readbit(sc)) + frame->mii_data |= i; } fail: + /* Clock the idle bits. */ dc_mii_writebit(sc, 0); dc_mii_writebit(sc, 0); - if (ack) + if (frame->mii_turnaround != 0) return (1); return (0); } @@ -736,7 +745,6 @@ dc_mii_writereg(struct dc_softc *sc, str /* * Set up frame for TX. */ - frame->mii_stdelim = DC_MII_STARTDELIM; frame->mii_opcode = DC_MII_WRITEOP; frame->mii_turnaround = DC_MII_TURNAROUND; @@ -753,7 +761,7 @@ dc_mii_writereg(struct dc_softc *sc, str dc_mii_send(sc, frame->mii_turnaround, 2); dc_mii_send(sc, frame->mii_data, 16); - /* Idle bit. */ + /* Clock the idle bits. */ dc_mii_writebit(sc, 0); dc_mii_writebit(sc, 0); Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Sun Dec 7 22:49:47 2008 (r185749) +++ head/sys/dev/dc/if_dcreg.h Sun Dec 7 23:02:37 2008 (r185750) @@ -791,6 +791,9 @@ struct dc_softc { #define CSR_READ_4(sc, reg) \ bus_space_read_4(sc->dc_btag, sc->dc_bhandle, reg) +#define CSR_BARRIER_4(sc, reg, flags) \ + bus_space_barrier(sc->dc_btag, sc->dc_bhandle, reg, 4, flags) + #define DC_TIMEOUT 1000 #define ETHER_ALIGN 2 From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 00:28:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 491AC106564A; Mon, 8 Dec 2008 00:28:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37A668FC1C; Mon, 8 Dec 2008 00:28:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB80SMaR040241; Mon, 8 Dec 2008 00:28:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB80SM3s040238; Mon, 8 Dec 2008 00:28:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812080028.mB80SM3s040238@svn.freebsd.org> From: Warner Losh Date: Mon, 8 Dec 2008 00:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185751 - in head/sys: net 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, 08 Dec 2008 00:28:22 -0000 Author: imp Date: Mon Dec 8 00:28:21 2008 New Revision: 185751 URL: http://svn.freebsd.org/changeset/base/185751 Log: Add missing include to sys/lock.h before sys/rwlock.h Modified: head/sys/net/rtsock.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Dec 7 23:02:37 2008 (r185750) +++ head/sys/net/rtsock.c Mon Dec 8 00:28:21 2008 (r185751) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sun Dec 7 23:02:37 2008 (r185750) +++ head/sys/netinet6/in6_rmx.c Mon Dec 8 00:28:21 2008 (r185751) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sun Dec 7 23:02:37 2008 (r185750) +++ head/sys/netinet6/nd6_rtr.c Mon Dec 8 00:28:21 2008 (r185751) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 01:44:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD6DD1065675; Mon, 8 Dec 2008 01:44:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC3BF8FC1A; Mon, 8 Dec 2008 01:44:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB81iI2M041698; Mon, 8 Dec 2008 01:44:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB81iIF0041697; Mon, 8 Dec 2008 01:44:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812080144.mB81iIF0041697@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Dec 2008 01:44: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: r185752 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 01:44:18 -0000 Author: yongari Date: Mon Dec 8 01:44:18 2008 New Revision: 185752 URL: http://svn.freebsd.org/changeset/base/185752 Log: Make sure to return the result of meida change request. Previously it used to return success regardless of the result. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Dec 8 00:28:21 2008 (r185751) +++ head/sys/dev/re/if_re.c Mon Dec 8 01:44:18 2008 (r185752) @@ -2652,14 +2652,15 @@ re_ifmedia_upd(struct ifnet *ifp) { struct rl_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; mii = device_get_softc(sc->rl_miibus); RL_LOCK(sc); - mii_mediachg(mii); + error = mii_mediachg(mii); RL_UNLOCK(sc); - return (0); + return (error); } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 02:34:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF95106564A; Mon, 8 Dec 2008 02:34:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D1EE8FC1F; Mon, 8 Dec 2008 02:34:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB82YEXV042790; Mon, 8 Dec 2008 02:34:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB82YDD7042788; Mon, 8 Dec 2008 02:34:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812080234.mB82YDD7042788@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Dec 2008 02:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185753 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 02:34:14 -0000 Author: yongari Date: Mon Dec 8 02:34:13 2008 New Revision: 185753 URL: http://svn.freebsd.org/changeset/base/185753 Log: o Implemented miibus_statchg handler. It detects whether re(4) established a valid link or not. In miibus_statchg handler add a check for established link is valid one for the controller(e.g. 1000baseT is not a valid link for fastethernet controllers.) o Added a flag RE_FLAG_FASTETHER to mark fastethernet controllers. o Added additional check to know whether we've really encountered watchdog timeouts or missed Tx completion interrupts. This change may help to track down the cause of watchdog timeouts. o In interrupt handler, removed a check for link state change interrupt. Not all controllers have the bit and re(4) did not rely on the event for a long time. In addition, re(4) didn't request the interrupt in RL_IMR register. Tested by: rpaulo Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Dec 8 01:44:18 2008 (r185752) +++ head/sys/dev/re/if_re.c Mon Dec 8 02:34:13 2008 (r185753) @@ -573,7 +573,39 @@ re_miibus_writereg(device_t dev, int phy static void re_miibus_statchg(device_t dev) { + struct rl_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; + sc = device_get_softc(dev); + mii = device_get_softc(sc->rl_miibus); + ifp = sc->rl_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->rl_flags &= ~RL_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->rl_flags |= RL_FLAG_LINK; + break; + case IFM_1000_T: + if ((sc->rl_flags & RL_FLAG_FASTETHER) != 0) + break; + sc->rl_flags |= RL_FLAG_LINK; + break; + default: + break; + } + } + /* + * RealTek controllers does not provide any interface to + * Tx/Rx MACs for resolved speed, duplex and flow-control + * parameters. + */ } /* @@ -1204,18 +1236,18 @@ re_attach(device_t dev) switch (hw_rev->rl_rev) { case RL_HWREV_8139CPLUS: - sc->rl_flags |= RL_FLAG_NOJUMBO; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE; + RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER; break; case RL_HWREV_8102E: case RL_HWREV_8102EL: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | - RL_FLAG_MACSTAT; + RL_FLAG_MACSTAT | RL_FLAG_FASTETHER; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: @@ -2011,30 +2043,14 @@ re_tick(void *xsc) { struct rl_softc *sc; struct mii_data *mii; - struct ifnet *ifp; sc = xsc; - ifp = sc->rl_ifp; RL_LOCK_ASSERT(sc); - re_watchdog(sc); - mii = device_get_softc(sc->rl_miibus); mii_tick(mii); - if ((sc->rl_flags & RL_FLAG_LINK) != 0) { - if (!(mii->mii_media_status & IFM_ACTIVE)) - sc->rl_flags &= ~RL_FLAG_LINK; - } else { - if (mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->rl_flags |= RL_FLAG_LINK; - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, - &sc->rl_txtask); - } - } - + re_watchdog(sc); callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } @@ -2149,11 +2165,6 @@ re_int_task(void *arg, int npending) re_init_locked(sc); } - if (status & RL_ISR_LINKCHG) { - callout_stop(&sc->rl_stat_callout); - re_tick(sc); - } - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2815,18 +2826,30 @@ re_ioctl(struct ifnet *ifp, u_long comma static void re_watchdog(struct rl_softc *sc) { + struct ifnet *ifp; RL_LOCK_ASSERT(sc); if (sc->rl_watchdog_timer == 0 || --sc->rl_watchdog_timer != 0) return; - device_printf(sc->rl_dev, "watchdog timeout\n"); - sc->rl_ifp->if_oerrors++; - + ifp = sc->rl_ifp; re_txeof(sc); + if (sc->rl_ldata.rl_tx_free == sc->rl_ldata.rl_tx_desc_cnt) { + if_printf(ifp, "watchdog timeout (missed Tx interrupts) " + "-- recovering\n"); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + return; + } + + if_printf(ifp, "watchdog timeout\n"); + ifp->if_oerrors++; + re_rxeof(sc); re_init_locked(sc); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); } /* Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Dec 8 01:44:18 2008 (r185752) +++ head/sys/pci/if_rlreg.h Mon Dec 8 02:34:13 2008 (r185753) @@ -882,6 +882,7 @@ struct rl_softc { #define RL_FLAG_PAR 0x0020 #define RL_FLAG_DESCV2 0x0040 #define RL_FLAG_MACSTAT 0x0080 +#define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_LINK 0x8000 }; From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 02:37:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EA821065670; Mon, 8 Dec 2008 02:37:09 +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 6AD778FC08; Mon, 8 Dec 2008 02:37:09 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB82b9R3042876; Mon, 8 Dec 2008 02:37:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB82b9Hs042873; Mon, 8 Dec 2008 02:37:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812080237.mB82b9Hs042873@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 8 Dec 2008 02:37: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: r185754 - in head: share/man/man4/man4.powerpc sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 02:37:09 -0000 Author: nwhitehorn Date: Mon Dec 8 02:37:08 2008 New Revision: 185754 URL: http://svn.freebsd.org/changeset/base/185754 Log: Add facilities to pmu(4) to interrogate battery status on Apple PowerPC laptops. This includes battery presence detection, charging status, current and voltage readouts, and charge level indication. The sysctl interface is somewhat ACPI-like. Modified: head/share/man/man4/man4.powerpc/pmu.4 head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/pmuvar.h Modified: head/share/man/man4/man4.powerpc/pmu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/pmu.4 Mon Dec 8 02:34:13 2008 (r185753) +++ head/share/man/man4/man4.powerpc/pmu.4 Mon Dec 8 02:37:08 2008 (r185754) @@ -69,13 +69,32 @@ The driver provides power management services in addition to an .Xr adb 4 interface. The following sysctls can be used to control the -power management behavior. +power management behavior and to examine current system power and +thermal conditions. .Bl -tag -width indent .It Va dev.pmu.%d.server_mode Restart after power failure behavior (1 causes system to reboot after power -cut, 0 causes system to remain off) +cut, 0 causes system to remain off). +.It Va dev.pmu.%d.batteries.%d.present +Indicates whether the relevant battery is inserted. +.It Va dev.pmu.%d.batteries.%d.charging +Indicates whether the battery is currently charging. +.It Va dev.pmu.%d.batteries.%d.charge +The current battery charge, in milliamp hours. +.It Va dev.pmu.%d.batteries.%d.maxcharge +The battery's self-reported maximum charge, in milliamp hours. +.It Va dev.pmu.%d.batteries.%d.rate +The current into the battery, in milliamps. While the battery is discharging, +this will be negative. +.It Va dev.pmu.%d.batteries.%d.voltage +Battery voltage, in millivolts. +.It Va dev.pmu.%d.batteries.%d.time +Estimated time until full battery charge (or discharge), in minutes. +.It Va dev.pmu.%d.batteries.%d.life +Current fraction of the battery's maximum charge, in percent. .Sh SEE ALSO -.Xr adb 4 +.Xr adb 4 , +.Xr acpi 4 .Sh HISTORY The .Nm Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Mon Dec 8 02:34:13 2008 (r185753) +++ head/sys/powerpc/powermac/pmu.c Mon Dec 8 02:37:08 2008 (r185754) @@ -67,10 +67,29 @@ static int pmu_attach(device_t); static int pmu_detach(device_t); static u_int pmu_adb_send(device_t dev, u_char command_byte, int len, - u_char *data, u_char poll); + u_char *data, u_char poll); static u_int pmu_adb_autopoll(device_t dev, uint16_t mask); static void pmu_poll(device_t dev); + static int pmu_server_mode(SYSCTL_HANDLER_ARGS); +static int pmu_query_battery(struct pmu_softc *sc, int batt, + struct pmu_battstate *info); +static int pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS); + +/* + * List of battery-related sysctls we might ask for + */ + +enum { + PMU_BATSYSCTL_PRESENT = 1 << 8, + PMU_BATSYSCTL_CHARGING = 2 << 8, + PMU_BATSYSCTL_CHARGE = 3 << 8, + PMU_BATSYSCTL_MAXCHARGE = 4 << 8, + PMU_BATSYSCTL_CURRENT = 5 << 8, + PMU_BATSYSCTL_VOLTAGE = 6 << 8, + PMU_BATSYSCTL_TIME = 7 << 8, + PMU_BATSYSCTL_LIFE = 8 << 8 +}; static device_method_t pmu_methods[] = { /* Device interface */ @@ -280,6 +299,7 @@ pmu_attach(device_t dev) { struct pmu_softc *sc; + int i; uint8_t reg; uint8_t cmd[2] = {2, 0}; uint8_t resp[16]; @@ -312,8 +332,6 @@ pmu_attach(device_t dev) return (ENXIO); } - sc->sc_error = 0; - sc->sc_polling = 0; sc->sc_autopoll = 0; /* Init PMU */ @@ -343,6 +361,18 @@ pmu_attach(device_t dev) if (strncmp(name, "adb", 4) == 0) { sc->adb_bus = device_add_child(dev,"adb",-1); } + + if (strncmp(name, "power-mgt", 9) == 0) { + uint32_t prim_info[9]; + + if (OF_getprop(child, "prim-info", prim_info, + sizeof(prim_info)) >= 7) + sc->sc_batteries = (prim_info[6] >> 16) & 0xff; + + if (bootverbose && sc->sc_batteries > 0) + device_printf(dev, "%d batteries detected\n", + sc->sc_batteries); + } } /* @@ -353,8 +383,61 @@ pmu_attach(device_t dev) tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "server_mode", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - pmu_server_mode, "I", "Enable reboot after power failure"); + "server_mode", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + pmu_server_mode, "I", "Enable reboot after power failure"); + + if (sc->sc_batteries > 0) { + struct sysctl_oid *oid, *battroot; + char battnum[2]; + + battroot = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "batteries", CTLFLAG_RD, 0, "Battery Information"); + + for (i = 0; i < sc->sc_batteries; i++) { + battnum[0] = i + '0'; + battnum[1] = '\0'; + + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(battroot), + OID_AUTO, battnum, CTLFLAG_RD, 0, + "Battery Information"); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "present", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_PRESENT | i, pmu_battquery_sysctl, + "I", "Battery present"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "charging", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_CHARGING | i, pmu_battquery_sysctl, + "I", "Battery charging"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "charge", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_CHARGE | i, pmu_battquery_sysctl, + "I", "Battery charge (mAh)"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "maxcharge", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_MAXCHARGE | i, pmu_battquery_sysctl, + "I", "Maximum battery capacity (mAh)"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rate", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_CURRENT | i, pmu_battquery_sysctl, + "I", "Battery discharge rate (mA)"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "voltage", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_VOLTAGE | i, pmu_battquery_sysctl, + "I", "Battery voltage (mV)"); + + /* Knobs for mental compatibility with ACPI */ + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "time", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_TIME | i, pmu_battquery_sysctl, + "I", "Time Remaining (minutes)"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "life", CTLTYPE_INT | CTLFLAG_RD, sc, + PMU_BATSYSCTL_LIFE | i, pmu_battquery_sysctl, + "I", "Capacity remaining (percent)"); + } + } return (bus_generic_attach(dev)); } @@ -437,7 +520,6 @@ pmu_send(void *cookie, int cmd, int leng /* wait idle */ do {} while (pmu_intr_state(sc)); - sc->sc_error = 0; /* send command */ pmu_send_byte(sc, cmd); @@ -671,3 +753,124 @@ pmu_server_mode(SYSCTL_HANDLER_ARGS) return (0); } +static int +pmu_query_battery(struct pmu_softc *sc, int batt, struct pmu_battstate *info) +{ + uint8_t reg; + uint8_t resp[16]; + int len; + + reg = batt + 1; + + mtx_lock(&sc->sc_mutex); + len = pmu_send(sc, PMU_SMART_BATTERY_STATE, 1, ®, 16, resp); + mtx_unlock(&sc->sc_mutex); + + if (len < 3) + return (-1); + + /* All PMU battery info replies share a common header: + * Byte 1 Payload Format + * Byte 2 Battery Flags + */ + + info->state = resp[2]; + + switch (resp[1]) { + case 3: + case 4: + /* + * Formats 3 and 4 appear to be the same: + * Byte 3 Charge + * Byte 4 Max Charge + * Byte 5 Current + * Byte 6 Voltage + */ + + info->charge = resp[3]; + info->maxcharge = resp[4]; + /* Current can be positive or negative */ + info->current = (int8_t)resp[5]; + info->voltage = resp[6]; + break; + case 5: + /* + * Formats 5 is a wider version of formats 3 and 4 + * Byte 3-4 Charge + * Byte 5-6 Max Charge + * Byte 7-8 Current + * Byte 9-10 Voltage + */ + + info->charge = (resp[3] << 8) | resp[4]; + info->maxcharge = (resp[5] << 8) | resp[6]; + /* Current can be positive or negative */ + info->current = (int16_t)((resp[7] << 8) | resp[8]); + info->voltage = (resp[9] << 8) | resp[10]; + break; + default: + device_printf(sc->sc_dev, "Unknown battery info format (%d)!\n", + resp[1]); + return (-1); + } + + return (0); +} + +static int +pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct pmu_softc *sc; + struct pmu_battstate batt; + int error, result; + + sc = arg1; + + error = pmu_query_battery(sc, arg2 & 0x00ff, &batt); + + if (error != 0) + return (error); + + switch (arg2 & 0xff00) { + case PMU_BATSYSCTL_PRESENT: + result = (batt.state & PMU_PWR_BATT_PRESENT) ? 1 : 0; + break; + case PMU_BATSYSCTL_CHARGING: + result = (batt.state & PMU_PWR_BATT_CHARGING) ? 1 : 0; + break; + case PMU_BATSYSCTL_CHARGE: + result = batt.charge; + break; + case PMU_BATSYSCTL_MAXCHARGE: + result = batt.maxcharge; + break; + case PMU_BATSYSCTL_CURRENT: + result = batt.current; + break; + case PMU_BATSYSCTL_VOLTAGE: + result = batt.voltage; + break; + case PMU_BATSYSCTL_TIME: + /* Time remaining until full charge/discharge, in minutes */ + + if (batt.current >= 0) + result = (batt.maxcharge - batt.charge) /* mAh */ * 60 + / batt.current /* mA */; + else + result = (batt.charge /* mAh */ * 60) + / (-batt.current /* mA */); + break; + case PMU_BATSYSCTL_LIFE: + /* Battery charge fraction, in percent */ + result = (batt.charge * 100) / batt.maxcharge; + break; + default: + /* This should never happen */ + result = -1; + }; + + error = sysctl_handle_int(oidp, &result, 0, req); + + return (error); +} + Modified: head/sys/powerpc/powermac/pmuvar.h ============================================================================== --- head/sys/powerpc/powermac/pmuvar.h Mon Dec 8 02:34:13 2008 (r185753) +++ head/sys/powerpc/powermac/pmuvar.h Mon Dec 8 02:37:08 2008 (r185754) @@ -158,14 +158,18 @@ struct pmu_softc { void *sc_ih; struct mtx sc_mutex; - device_t adb_bus; + volatile int sc_autopoll; + int sc_batteries; +}; + +struct pmu_battstate { + int state; - int sc_node; - volatile int sc_state; - int sc_polling; - int sc_error; - volatile int sc_autopoll; + int charge; + int maxcharge; + int current; + int voltage; }; #endif /* PMUVAR_H */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 02:38:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 119351065672; Mon, 8 Dec 2008 02:38:14 +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 007538FC08; Mon, 8 Dec 2008 02:38:14 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB82cDX7042930; Mon, 8 Dec 2008 02:38:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB82cD7I042929; Mon, 8 Dec 2008 02:38:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812080238.mB82cD7I042929@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 8 Dec 2008 02:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185755 - 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: Mon, 08 Dec 2008 02:38:14 -0000 Author: nwhitehorn Date: Mon Dec 8 02:38:13 2008 New Revision: 185755 URL: http://svn.freebsd.org/changeset/base/185755 Log: Accidentally left ADB out of the PowerPC NOTES file during initial import. Modified: head/sys/powerpc/conf/NOTES Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Mon Dec 8 02:37:08 2008 (r185754) +++ head/sys/powerpc/conf/NOTES Mon Dec 8 02:38:13 2008 (r185755) @@ -26,6 +26,9 @@ device pci device bm # Apple BMAC (Big Mac Ethernet) device ofwd # Open Firmware disks +device adb # Apple Desktop Bus +device cuda # VIA-CUDA ADB interface +device pmu # Apple Power Management Unit ##################################################################### From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 02:48:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E761065670; Mon, 8 Dec 2008 02:48:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7B038FC1A; Mon, 8 Dec 2008 02:48:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB82mf4u043155; Mon, 8 Dec 2008 02:48:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB82mfV9043154; Mon, 8 Dec 2008 02:48:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812080248.mB82mfV9043154@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Dec 2008 02:48: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: r185756 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 02:48:42 -0000 Author: yongari Date: Mon Dec 8 02:48:41 2008 New Revision: 185756 URL: http://svn.freebsd.org/changeset/base/185756 Log: Reduce spin wait time consumed in GMII register access routines. Waiting for 1ms for each GMII register access looks overkill and it may also decrease overall performance of driver because re(4) invokes mii_tick for every hz. Tested by: rpaulo Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Dec 8 02:38:13 2008 (r185755) +++ head/sys/dev/re/if_re.c Mon Dec 8 02:48:41 2008 (r185756) @@ -417,13 +417,12 @@ re_gmii_readreg(device_t dev, int phy, i } CSR_WRITE_4(sc, RL_PHYAR, reg << 16); - DELAY(1000); for (i = 0; i < RL_TIMEOUT; i++) { + DELAY(30); rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; - DELAY(100); } if (i == RL_TIMEOUT) { @@ -445,13 +444,12 @@ re_gmii_writereg(device_t dev, int phy, CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); - DELAY(1000); for (i = 0; i < RL_TIMEOUT; i++) { + DELAY(30); rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; - DELAY(100); } if (i == RL_TIMEOUT) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 03:00:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FD9F1065676; Mon, 8 Dec 2008 03:00:45 +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 7D8298FC0C; Mon, 8 Dec 2008 03:00:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB830jMd044570; Mon, 8 Dec 2008 03:00:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB830j7j044568; Mon, 8 Dec 2008 03:00:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812080300.mB830j7j044568@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 8 Dec 2008 03:00: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: r185757 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 03:00:45 -0000 Author: nwhitehorn Date: Mon Dec 8 03:00:45 2008 New Revision: 185757 URL: http://svn.freebsd.org/changeset/base/185757 Log: Clean up the mac GPIO interface a little. Also remove bogus copyright and 3rd license clause. Submitted by: Marco Trillo Modified: head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/macgpiovar.h Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Mon Dec 8 02:48:41 2008 (r185756) +++ head/sys/powerpc/powermac/macgpio.c Mon Dec 8 03:00:45 2008 (r185757) @@ -1,5 +1,5 @@ /*- - * Copyright 2002 by Peter Grehan. All rights reserved. + * Copyright 2008 by Nathan Whitehorn. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -9,8 +9,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -51,6 +49,8 @@ #include #include +#include + /* * Macgpio softc */ @@ -62,21 +62,18 @@ struct macgpio_softc { static MALLOC_DEFINE(M_MACGPIO, "macgpio", "macgpio device information"); -static int macgpio_probe(device_t); -static int macgpio_attach(device_t); -static int macgpio_print_child(device_t dev, device_t child); -static void macgpio_probe_nomatch(device_t, device_t); -static struct resource *macgpio_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); -static int macgpio_activate_resource(device_t, device_t, int, int, - struct resource *); -static int macgpio_deactivate_resource(device_t, device_t, int, int, - struct resource *); +static int macgpio_probe(device_t); +static int macgpio_attach(device_t); +static int macgpio_print_child(device_t dev, device_t child); +static void macgpio_probe_nomatch(device_t, device_t); +static struct resource *macgpio_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static int macgpio_activate_resource(device_t, device_t, int, int, + struct resource *); +static int macgpio_deactivate_resource(device_t, device_t, int, int, + struct resource *); static ofw_bus_get_devinfo_t macgpio_get_devinfo; -uint8_t macgpio_read(device_t dev); -void macgpio_write(device_t dev,uint8_t); - /* * Bus interface definition */ @@ -125,7 +122,7 @@ struct macgpio_devinfo { struct ofw_bus_devinfo mdi_obdinfo; struct resource_list mdi_resources; - int gpio_num; + int gpio_num; }; static int @@ -215,8 +212,14 @@ macgpio_print_child(device_t dev, device dinfo = device_get_ivars(child); retval += bus_print_child_header(dev, child); + + if (dinfo->gpio_num >= GPIO_BASE) + printf(" gpio %d", dinfo->gpio_num - GPIO_BASE); + else if (dinfo->gpio_num >= GPIO_EXTINT_BASE) + printf(" extint-gpio %d", dinfo->gpio_num - GPIO_EXTINT_BASE); + else + printf(" addr 0x%02x", dinfo->gpio_num); /* should not happen */ - printf(" gpio %d",dinfo->gpio_num); resource_list_print_type(&dinfo->mdi_resources, "irq", SYS_RES_IRQ, "%ld"); retval += bus_print_child_footer(dev, child); Modified: head/sys/powerpc/powermac/macgpiovar.h ============================================================================== --- head/sys/powerpc/powermac/macgpiovar.h Mon Dec 8 02:48:41 2008 (r185756) +++ head/sys/powerpc/powermac/macgpiovar.h Mon Dec 8 03:00:45 2008 (r185757) @@ -9,8 +9,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -30,13 +28,15 @@ #ifndef _MACIO_MACGPIOVAR_H_ #define _MACIO_MACGPIOVAR_H_ -struct macgpio_devinfo { - struct ofw_bus_devinfo mdi_obdinfo; - struct resource_list mdi_resources; - - int gpio_num; -}; - +/* relative offsets into gpio space */ +#define GPIO_EXTINT_BASE 0x08 +#define GPIO_BASE 0x1a + +/* gpio bit definitions */ +#define GPIO_DATA 0x01 /* GPIO data */ +#define GPIO_LEVEL_RO 0x02 /* read-only level on pin */ +#define GPIO_DDR_INPUT 0x00 /* use for input */ +#define GPIO_DDR_OUTPUT 0x04 /* use for output */ uint8_t macgpio_read(device_t dev); void macgpio_write(device_t dev,uint8_t); From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 03:48:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7BC11065670; Mon, 8 Dec 2008 03:48:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A64CF8FC0C; Mon, 8 Dec 2008 03:48:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB83m3eG045960; Mon, 8 Dec 2008 03:48:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB83m3Oi045959; Mon, 8 Dec 2008 03:48:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812080348.mB83m3Oi045959@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Dec 2008 03:48: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: r185758 - head/sys/dev/fxp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 03:48:03 -0000 Author: yongari Date: Mon Dec 8 03:48:03 2008 New Revision: 185758 URL: http://svn.freebsd.org/changeset/base/185758 Log: mutex.h is needed here. It got it by namespace pollution. Pointed out by: bde Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Dec 8 03:00:45 2008 (r185757) +++ head/sys/dev/fxp/if_fxp.c Mon Dec 8 03:48:03 2008 (r185758) @@ -44,7 +44,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 05:47:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 243C01065678 for ; Mon, 8 Dec 2008 05:47:25 +0000 (UTC) (envelope-from moguabjy@gmail.com) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.189]) by mx1.freebsd.org (Postfix) with ESMTP id B13258FC18 for ; Mon, 8 Dec 2008 05:47:24 +0000 (UTC) (envelope-from moguabjy@gmail.com) Received: by ti-out-0910.google.com with SMTP id a1so629922tib.3 for ; Sun, 07 Dec 2008 21:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=ehtrZMpa9QIQ4eXXFGRp4xYUcLs4EvlPg1lvxTDCuJ0=; b=Dl7t3NQUxcMYjsOsiuuTTos2NPPaRHyrZ+46C76yMEmu8KL7HQxWhZlq+W+ORcyraA vw2g/wrYJF7l4oI7B2DP8SDegnmJQJ0wKv58+rDgiS6eMAQFs/D68GN6j3DNUYCZFOGF jgt64TwU15xfi/ITq+nomfvvBfWCGqCcV149k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=f8fO8Fj589Qj+NmZlkzRI9+USl3VS08IEvqbwnN59Jnstm5D+qZHg7ns/BOxx6UUEK s8aLero8lNWqkaHzMvRi4r44I71js2AJ2pSVQM1kVuWuxCz/RN7G/kAg8t0FHt1AJqV+ p+fWJb44/kYlDKk4Qa2DIQ+iZNxGWgeznAQjg= Received: by 10.110.49.6 with SMTP id w6mr2851362tiw.40.1228713272653; Sun, 07 Dec 2008 21:14:32 -0800 (PST) Received: by 10.110.33.11 with HTTP; Sun, 7 Dec 2008 21:14:32 -0800 (PST) Message-ID: Date: Mon, 8 Dec 2008 14:14:32 +0900 From: "Bang Jun-young" Sender: moguabjy@gmail.com To: "Tim Kientzle" In-Reply-To: <200812060612.mB66COVb084955@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812060612.mB66COVb084955@svn.freebsd.org> X-Google-Sender-Auth: 1bfb078a58ebc179 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185674 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 05:47:25 -0000 On Sat, Dec 6, 2008 at 3:12 PM, Tim Kientzle wrote: > Author: kientzle > Date: Sat Dec 6 06:12:24 2008 > New Revision: 185674 > URL: http://svn.freebsd.org/changeset/base/185674 > > Log: > A couple of portability fixes from Joerg Sonnenberger > > Modified: > head/lib/libarchive/archive_endian.h > > Modified: head/lib/libarchive/archive_endian.h > ============================================================================== > --- head/lib/libarchive/archive_endian.h Sat Dec 6 06:08:12 2008 (r185673) > +++ head/lib/libarchive/archive_endian.h Sat Dec 6 06:12:24 2008 (r185674) > @@ -35,14 +35,14 @@ > #define ARCHIVE_ENDIAN_H_INCLUDED > > > -/* Watcom C++ doesn't support 'inline' in C code. (For any version?) */ > -#if defined( __WATCOMC__ ) > - #define inline > -#endif > - > -/* Visual C++ 6.0 doesn't support 'inline' in C code. (Does VC7? VC8?) */ > -#if defined(_MSC_VER) > - #define inline > +/* > + * Disabling inline keyword for compilers known to choke on it: > + * - Watcom C++ in C code. (For any version?) > + * - SGI MIPSpro > + * - Microsoft Visual C++ 6.0 (supposedly newer versions too) > + */ > +#if defined(__WATCOMC__) || defined(__sgi) || defined(_MSC_VER) > +#define inline > #endif MSC actually supports inline functions as '__inline' keyword in C mode. The above should be written as follows: #if defined(__WATCOMC__) || defined(__sgi) #define inline #elif defined(_MSC_VER) #define inline __inline #endif See http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx http://msdn.microsoft.com/en-us/library/aa260842.aspx for details. junyoung From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 11:04:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641D71065675; Mon, 8 Dec 2008 11:04:17 +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 4CB918FC13; Mon, 8 Dec 2008 11:04:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8B4Hc3058123; Mon, 8 Dec 2008 11:04:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8B4HwA058122; Mon, 8 Dec 2008 11:04:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812081104.mB8B4HwA058122@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Dec 2008 11:04: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: r185761 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 11:04:17 -0000 Author: kib Date: Mon Dec 8 11:04:17 2008 New Revision: 185761 URL: http://svn.freebsd.org/changeset/base/185761 Log: The dqrele() function syncs the dq, then acquires the dqh lock, and then does final drop of the the dq reference to put it onto the free list. There is a possibility that the dq would be found by another thread after sync and before the dqh lock is acquired. If that other thread drops the dq before we have taken the dqh lock, the dirty dq is put on the free list. Recheck the DQ_MOD after the dqh lock is relocked. Repeat dqsync() if the dq is dirty. This ensures that up to date dq is written in the quota file and fixes assertion in dqget(). Reported and tested by: Frode Nordahl MFC after: 3 days Modified: head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Mon Dec 8 06:54:24 2008 (r185760) +++ head/sys/ufs/ufs/ufs_quota.c Mon Dec 8 11:04:17 2008 (r185761) @@ -1262,7 +1262,7 @@ dqrele(struct vnode *vp, struct dquot *d return; } DQH_UNLOCK(); - +sync: (void) dqsync(vp, dq); DQH_LOCK(); @@ -1271,6 +1271,18 @@ dqrele(struct vnode *vp, struct dquot *d DQH_UNLOCK(); return; } + + /* + * The dq may become dirty after it is synced but before it is + * put to the free list. Checking the DQ_MOD there without + * locking dq should be safe since no other references to the + * dq exist. + */ + if ((dq->dq_flags & DQ_MOD) != 0) { + dq->dq_cnt++; + DQH_UNLOCK(); + goto sync; + } TAILQ_INSERT_TAIL(&dqfreelist, dq, dq_freelist); DQH_UNLOCK(); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 12:28:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008AF1065672; Mon, 8 Dec 2008 12:28:49 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E372B8FC19; Mon, 8 Dec 2008 12:28:48 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8CSmIY059942; Mon, 8 Dec 2008 12:28:48 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8CSm4o059941; Mon, 8 Dec 2008 12:28:48 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200812081228.mB8CSm4o059941@svn.freebsd.org> From: Joseph Koshy Date: Mon, 8 Dec 2008 12:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185763 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 12:28:49 -0000 Author: jkoshy Date: Mon Dec 8 12:28:48 2008 New Revision: 185763 URL: http://svn.freebsd.org/changeset/base/185763 Log: Document processor errata that affect performance measurement. Modified: head/lib/libpmc/pmc.core.3 Modified: head/lib/libpmc/pmc.core.3 ============================================================================== --- head/lib/libpmc/pmc.core.3 Mon Dec 8 12:04:00 2008 (r185762) +++ head/lib/libpmc/pmc.core.3 Mon Dec 8 12:28:48 2008 (r185763) @@ -730,6 +730,58 @@ and the underlying hardware events used. .It Li interrupts Ta Li HW_Int_Rx .It Li unhalted-cycles Ta (unsupported) .El +.Sh PROCESSOR ERRATA +The following errata affect performance measurement on these +processors. +These errata are documented in +.Rs +.%T "Intel® CoreTM Duo Processor and Intel® CoreTM Solo Processor on 65 nm Process" +.%B "Specification Update" +.%N "Order Number 309222-017" +.%D July 2008 +.%Q "Intel Corporation" +.Re +.Bl -tag -width indent -compact +.It AE19 +Data prefetch performance monitoring events can only be enabled +on a single core. +.It AE25 +Performance monitoring counters that count external bus events +may report incorrect values after processor power state transitions. +.It AE28 +Performance monitoring events for retired floating point operations +(C1H) may not be accurate. +.It AE29 +DR3 address match on MOVD/MOVQ/MOVNTQ memory store +instruction may incorrectly increment performance monitoring count +for saturating simd instructions retired (Event CFH). +.It AE33 +Hardware prefetch performance monitoring events may be counted +inaccurately. +.It AE36 +The +.Li CPU_CLK_UNHALTED +performance monitoring event (Event 3CH) counts +clocks when the processor is in the C1/C2 processor power states. +.It AE39 +Certain performance monitoring counters related to bus, L2 cache +and power management are inaccurate. +.It AE51 +Performance monitoring events for retired instructions (Event C0H) may +not be accurate. +.It AE67 +Performance monitoring event +.Li FP_ASSIST +may not be accurate. +.It AE78 +Performance monitoring event for hardware prefetch requests (Event +4EH) and hardware prefetch request cache misses (Event 4FH) may not be +accurate. +.It AE82 +Performance monitoring event +.Li FP_MMX_TRANS_TO_MMX +may not count some transitions. +.El .Sh SEE ALSO .Xr pmc 3 , .Xr pmc.atom 3 , From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 12:29:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A87AC1065675; Mon, 8 Dec 2008 12:29:30 +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 978908FC1B; Mon, 8 Dec 2008 12:29:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8CTUCg060006; Mon, 8 Dec 2008 12:29:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8CTU1E060005; Mon, 8 Dec 2008 12:29:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812081229.mB8CTU1E060005@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Dec 2008 12:29: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: r185764 - 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: Mon, 08 Dec 2008 12:29:30 -0000 Author: kib Date: Mon Dec 8 12:29:30 2008 New Revision: 185764 URL: http://svn.freebsd.org/changeset/base/185764 Log: Do drop vm map lock earlier in the sysctl_kern_proc_vmmap(), to avoid locking a vnode while having vm map locked. Reported and tested by: pho MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Dec 8 12:28:48 2008 (r185763) +++ head/sys/kern/kern_proc.c Mon Dec 8 12:29:30 2008 (r185764) @@ -1412,13 +1412,32 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A lobj = tobj; } + kve->kve_start = (void*)entry->start; + kve->kve_end = (void*)entry->end; + kve->kve_offset = (off_t)entry->offset; + + if (entry->protection & VM_PROT_READ) + kve->kve_protection |= KVME_PROT_READ; + if (entry->protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_PROT_WRITE; + if (entry->protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_PROT_EXEC; + + if (entry->eflags & MAP_ENTRY_COW) + kve->kve_flags |= KVME_FLAG_COW; + if (entry->eflags & MAP_ENTRY_NEEDS_COPY) + kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + kve->kve_fileid = 0; kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { vp = NULL; - switch(lobj->type) { + switch (lobj->type) { case OBJT_DEFAULT: kve->kve_type = KVME_TYPE_DEFAULT; break; @@ -1468,28 +1487,10 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_shadow_count = 0; } - kve->kve_start = (void*)entry->start; - kve->kve_end = (void*)entry->end; - kve->kve_offset = (off_t)entry->offset; - - if (entry->protection & VM_PROT_READ) - kve->kve_protection |= KVME_PROT_READ; - if (entry->protection & VM_PROT_WRITE) - kve->kve_protection |= KVME_PROT_WRITE; - if (entry->protection & VM_PROT_EXECUTE) - kve->kve_protection |= KVME_PROT_EXEC; - - if (entry->eflags & MAP_ENTRY_COW) - kve->kve_flags |= KVME_FLAG_COW; - if (entry->eflags & MAP_ENTRY_NEEDS_COPY) - kve->kve_flags |= KVME_FLAG_NEEDS_COPY; - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); if (freepath != NULL) free(freepath, M_TEMP); - last_timestamp = map->timestamp; - vm_map_unlock_read(map); error = SYSCTL_OUT(req, kve, sizeof(*kve)); vm_map_lock_read(map); if (error) @@ -1577,13 +1578,32 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR lobj = tobj; } + kve->kve_start = entry->start; + kve->kve_end = entry->end; + kve->kve_offset = entry->offset; + + if (entry->protection & VM_PROT_READ) + kve->kve_protection |= KVME_PROT_READ; + if (entry->protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_PROT_WRITE; + if (entry->protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_PROT_EXEC; + + if (entry->eflags & MAP_ENTRY_COW) + kve->kve_flags |= KVME_FLAG_COW; + if (entry->eflags & MAP_ENTRY_NEEDS_COPY) + kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + kve->kve_fileid = 0; kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { vp = NULL; - switch(lobj->type) { + switch (lobj->type) { case OBJT_DEFAULT: kve->kve_type = KVME_TYPE_DEFAULT; break; @@ -1633,28 +1653,10 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_shadow_count = 0; } - kve->kve_start = entry->start; - kve->kve_end = entry->end; - kve->kve_offset = entry->offset; - - if (entry->protection & VM_PROT_READ) - kve->kve_protection |= KVME_PROT_READ; - if (entry->protection & VM_PROT_WRITE) - kve->kve_protection |= KVME_PROT_WRITE; - if (entry->protection & VM_PROT_EXECUTE) - kve->kve_protection |= KVME_PROT_EXEC; - - if (entry->eflags & MAP_ENTRY_COW) - kve->kve_flags |= KVME_FLAG_COW; - if (entry->eflags & MAP_ENTRY_NEEDS_COPY) - kve->kve_flags |= KVME_FLAG_NEEDS_COPY; - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); if (freepath != NULL) free(freepath, M_TEMP); - last_timestamp = map->timestamp; - vm_map_unlock_read(map); /* Pack record size down */ kve->kve_structsize = offsetof(struct kinfo_vmentry, kve_path) + strlen(kve->kve_path) + 1; From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 12:34:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B5E9106564A; Mon, 8 Dec 2008 12:34:52 +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 896BB8FC08; Mon, 8 Dec 2008 12:34:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8CYqMG060150; Mon, 8 Dec 2008 12:34:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8CYqr0060148; Mon, 8 Dec 2008 12:34:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812081234.mB8CYqr0060148@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Dec 2008 12:34: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: r185765 - in head/sys: compat/linprocfs fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 12:34:52 -0000 Author: kib Date: Mon Dec 8 12:34:52 2008 New Revision: 185765 URL: http://svn.freebsd.org/changeset/base/185765 Log: Change the linprocfs /maps and procfs /map handlers to use sbuf instead of doing uiomove. This allows for reads from non-zero offsets to work. Patch is forward-ported des@' one, and was adopted to current code by dchagin@ and me. Reviewed by: des (linprocfs part) PR: kern/101453 MFC after: 1 week Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_map.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Dec 8 12:29:30 2008 (r185764) +++ head/sys/compat/linprocfs/linprocfs.c Mon Dec 8 12:34:52 2008 (r185765) @@ -876,10 +876,12 @@ static int linprocfs_doprocmaps(PFS_FILL_ARGS) { vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; - vm_offset_t saved_end; + vm_offset_t e_start, e_end; vm_ooffset_t off = 0; + vm_prot_t e_prot; + unsigned int last_timestamp; char *name = "", *freename = NULL; ino_t ino; int ref_count, shadow_count, flags; @@ -905,7 +907,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) freename = NULL; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - saved_end = entry->end; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { VM_OBJECT_LOCK(tobj); @@ -913,6 +917,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); ino = 0; if (lobj) { off = IDX_TO_OFF(lobj->size); @@ -950,10 +956,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", - (u_long)entry->start, (u_long)entry->end, - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (u_long)e_start, (u_long)e_end, + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", "p", (u_long)off, 0, @@ -968,6 +974,16 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) error = 0; break; } + vm_map_lock_read(map); + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Mon Dec 8 12:29:30 2008 (r185764) +++ head/sys/fs/procfs/procfs_map.c Mon Dec 8 12:34:52 2008 (r185765) @@ -84,9 +84,10 @@ procfs_doprocmap(PFS_FILL_ARGS) { int error, vfslocked; vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; + unsigned int last_timestamp; #ifdef COMPAT_IA32 int wrap32 = 0; #endif @@ -113,13 +114,19 @@ procfs_doprocmap(PFS_FILL_ARGS) entry = entry->next) { vm_object_t obj, tobj, lobj; int ref_count, shadow_count, flags; - vm_offset_t addr; + vm_offset_t e_start, e_end, addr; int resident, privateresident; char *type; + vm_eflags_t e_eflags; + vm_prot_t e_prot; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; + e_eflags = entry->eflags; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; privateresident = 0; obj = entry->object.vm_object; if (obj != NULL) { @@ -143,11 +150,13 @@ procfs_doprocmap(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); freepath = NULL; fullpath = "-"; if (lobj) { - switch(lobj->type) { + switch (lobj->type) { default: case OBJT_DEFAULT: type = "default"; @@ -193,19 +202,19 @@ procfs_doprocmap(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n", - (u_long)entry->start, (u_long)entry->end, + (u_long)e_start, (u_long)e_end, resident, privateresident, #ifdef COMPAT_IA32 wrap32 ? NULL : obj, /* Hide 64 bit value */ #else obj, #endif - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", ref_count, shadow_count, flags, - (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW", - (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", + (e_eflags & MAP_ENTRY_COW)?"COW":"NCOW", + (e_eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", type, fullpath); if (freepath != NULL) @@ -215,6 +224,16 @@ procfs_doprocmap(PFS_FILL_ARGS) error = 0; break; } + vm_map_lock_read(map); + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); return (error); From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 13:01:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FCFC106567E; Mon, 8 Dec 2008 13:01:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA948FC08; Mon, 8 Dec 2008 13:01:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L9fkD-000GPI-F8; Mon, 08 Dec 2008 15:01:49 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mB8D1i5X035235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Dec 2008 15:01:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mB8D1iWl067053; Mon, 8 Dec 2008 15:01:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mB8D1iOU067052; Mon, 8 Dec 2008 15:01:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 8 Dec 2008 15:01:44 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20081208130144.GU2038@deviant.kiev.zoral.com.ua> References: <200812081234.mB8CYqr0060148@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w5nY8nmEklXMR7Cj" Content-Disposition: inline In-Reply-To: <200812081234.mB8CYqr0060148@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L9fkD-000GPI-F8 e96cf10ae2a472d33bda9789f4a9430d X-Terabit: YES Cc: rdivacky@freebsd.org Subject: Re: svn commit: r185765 - in head/sys: compat/linprocfs fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 13:01:51 -0000 --w5nY8nmEklXMR7Cj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 08, 2008 at 12:34:52PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 8 12:34:52 2008 > New Revision: 185765 > URL: http://svn.freebsd.org/changeset/base/185765 >=20 > Log: > Change the linprocfs /maps and procfs /map handlers to use > sbuf instead of doing uiomove. This allows for reads from non-zero > offsets to work. > =20 > Patch is forward-ported des@' one, and was adopted to current code > by dchagin@ and me. > =20 > Reviewed by: des (linprocfs part) > PR: kern/101453 > MFC after: 1 week >=20 > Modified: > head/sys/compat/linprocfs/linprocfs.c > head/sys/fs/procfs/procfs_map.c Thanks for Roman Divacky for pointing this out, commit message is wrong. I specified wrong log file to the svn ci -F switch. The right commit message is below. In procfs map handler, and in linprocfs maps handler, do not call vn_fullpath() while having vm map locked. This is done in anticipation of the vop_vptocnp commit, that would make vn_fullpath sometime acquire vnode lock. Also, in linprocfs, maps handler already acquires vnode lock. No objections from: des MFC after: 2 week >=20 > Modified: head/sys/compat/linprocfs/linprocfs.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/compat/linprocfs/linprocfs.c Mon Dec 8 12:29:30 2008 (r1857= 64) > +++ head/sys/compat/linprocfs/linprocfs.c Mon Dec 8 12:34:52 2008 (r1857= 65) > @@ -876,10 +876,12 @@ static int > linprocfs_doprocmaps(PFS_FILL_ARGS) > { > vm_map_t map =3D &p->p_vmspace->vm_map; > - vm_map_entry_t entry; > + vm_map_entry_t entry, tmp_entry; > vm_object_t obj, tobj, lobj; > - vm_offset_t saved_end; > + vm_offset_t e_start, e_end; > vm_ooffset_t off =3D 0; > + vm_prot_t e_prot; > + unsigned int last_timestamp; > char *name =3D "", *freename =3D NULL; > ino_t ino; > int ref_count, shadow_count, flags; > @@ -905,7 +907,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) > freename =3D NULL; > if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) > continue; > - saved_end =3D entry->end; > + e_prot =3D entry->protection; > + e_start =3D entry->start; > + e_end =3D entry->end; > obj =3D entry->object.vm_object; > for (lobj =3D tobj =3D obj; tobj; tobj =3D tobj->backing_object) { > VM_OBJECT_LOCK(tobj); > @@ -913,6 +917,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) > VM_OBJECT_UNLOCK(lobj); > lobj =3D tobj; > } > + last_timestamp =3D map->timestamp; > + vm_map_unlock_read(map); > ino =3D 0; > if (lobj) { > off =3D IDX_TO_OFF(lobj->size); > @@ -950,10 +956,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) > */ > error =3D sbuf_printf(sb, > "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", > - (u_long)entry->start, (u_long)entry->end, > - (entry->protection & VM_PROT_READ)?"r":"-", > - (entry->protection & VM_PROT_WRITE)?"w":"-", > - (entry->protection & VM_PROT_EXECUTE)?"x":"-", > + (u_long)e_start, (u_long)e_end, > + (e_prot & VM_PROT_READ)?"r":"-", > + (e_prot & VM_PROT_WRITE)?"w":"-", > + (e_prot & VM_PROT_EXECUTE)?"x":"-", > "p", > (u_long)off, > 0, > @@ -968,6 +974,16 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) > error =3D 0; > break; > } > + vm_map_lock_read(map); > + if (last_timestamp + 1 !=3D map->timestamp) { > + /* > + * Look again for the entry because the map was > + * modified while it was unlocked. Specifically, > + * the entry may have been clipped, merged, or deleted. > + */ > + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); > + entry =3D tmp_entry; > + } > } > vm_map_unlock_read(map); > =20 >=20 > Modified: head/sys/fs/procfs/procfs_map.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/fs/procfs/procfs_map.c Mon Dec 8 12:29:30 2008 (r185764) > +++ head/sys/fs/procfs/procfs_map.c Mon Dec 8 12:34:52 2008 (r185765) > @@ -84,9 +84,10 @@ procfs_doprocmap(PFS_FILL_ARGS) > { > int error, vfslocked; > vm_map_t map =3D &p->p_vmspace->vm_map; > - vm_map_entry_t entry; > + vm_map_entry_t entry, tmp_entry; > struct vnode *vp; > char *fullpath, *freepath; > + unsigned int last_timestamp; > #ifdef COMPAT_IA32 > int wrap32 =3D 0; > #endif > @@ -113,13 +114,19 @@ procfs_doprocmap(PFS_FILL_ARGS) > entry =3D entry->next) { > vm_object_t obj, tobj, lobj; > int ref_count, shadow_count, flags; > - vm_offset_t addr; > + vm_offset_t e_start, e_end, addr; > int resident, privateresident; > char *type; > + vm_eflags_t e_eflags; > + vm_prot_t e_prot; > =20 > if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) > continue; > =20 > + e_eflags =3D entry->eflags; > + e_prot =3D entry->protection; > + e_start =3D entry->start; > + e_end =3D entry->end; > privateresident =3D 0; > obj =3D entry->object.vm_object; > if (obj !=3D NULL) { > @@ -143,11 +150,13 @@ procfs_doprocmap(PFS_FILL_ARGS) > VM_OBJECT_UNLOCK(lobj); > lobj =3D tobj; > } > + last_timestamp =3D map->timestamp; > + vm_map_unlock_read(map); > =20 > freepath =3D NULL; > fullpath =3D "-"; > if (lobj) { > - switch(lobj->type) { > + switch (lobj->type) { > default: > case OBJT_DEFAULT: > type =3D "default"; > @@ -193,19 +202,19 @@ procfs_doprocmap(PFS_FILL_ARGS) > */ > error =3D sbuf_printf(sb, > "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n", > - (u_long)entry->start, (u_long)entry->end, > + (u_long)e_start, (u_long)e_end, > resident, privateresident, > #ifdef COMPAT_IA32 > wrap32 ? NULL : obj, /* Hide 64 bit value */ > #else > obj, > #endif > - (entry->protection & VM_PROT_READ)?"r":"-", > - (entry->protection & VM_PROT_WRITE)?"w":"-", > - (entry->protection & VM_PROT_EXECUTE)?"x":"-", > + (e_prot & VM_PROT_READ)?"r":"-", > + (e_prot & VM_PROT_WRITE)?"w":"-", > + (e_prot & VM_PROT_EXECUTE)?"x":"-", > ref_count, shadow_count, flags, > - (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW", > - (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", > + (e_eflags & MAP_ENTRY_COW)?"COW":"NCOW", > + (e_eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", > type, fullpath); > =20 > if (freepath !=3D NULL) > @@ -215,6 +224,16 @@ procfs_doprocmap(PFS_FILL_ARGS) > error =3D 0; > break; > } > + vm_map_lock_read(map); > + if (last_timestamp + 1 !=3D map->timestamp) { > + /* > + * Look again for the entry because the map was > + * modified while it was unlocked. Specifically, > + * the entry may have been clipped, merged, or deleted. > + */ > + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); > + entry =3D tmp_entry; > + } > } > vm_map_unlock_read(map); > return (error); --w5nY8nmEklXMR7Cj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkk9GrcACgkQC3+MBN1Mb4h76gCg9MxYoQcoxC3fIXy1dNnhpm6n HdAAn2o0XBcNhBDKk5KSjLsTdMMzEQis =GYHS -----END PGP SIGNATURE----- --w5nY8nmEklXMR7Cj-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 13:08:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 751E31065670; Mon, 8 Dec 2008 13:08:42 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 32E938FC14; Mon, 8 Dec 2008 13:08:42 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 397B56D43F; Mon, 8 Dec 2008 13:08:41 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1ABFE844DD; Mon, 8 Dec 2008 14:08:41 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kostik Belousov References: <200812081234.mB8CYqr0060148@svn.freebsd.org> <20081208130144.GU2038@deviant.kiev.zoral.com.ua> Date: Mon, 08 Dec 2008 14:08:40 +0100 In-Reply-To: <20081208130144.GU2038@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Mon, 8 Dec 2008 15:01:44 +0200") Message-ID: <86prk2zuef.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rdivacky@freebsd.org Subject: Re: svn commit: r185765 - in head/sys: compat/linprocfs fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 13:08:42 -0000 Kostik Belousov writes: > Thanks for Roman Divacky for pointing this out, commit message is > wrong. I specified wrong log file to the svn ci -F switch. The right > commit message is below. Can you please make a forced commit to document this? Just add or remove a blank line somewhere (or unwrap line 276 for instance). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 13:15:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD81F106574F; Mon, 8 Dec 2008 13:15:31 +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 BBFBE8FC13; Mon, 8 Dec 2008 13:15:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8DFVSG061025; Mon, 8 Dec 2008 13:15:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8DFVMk061023; Mon, 8 Dec 2008 13:15:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812081315.mB8DFVMk061023@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Dec 2008 13:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185766 - in head/sys: compat/linprocfs fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 13:15:31 -0000 Author: kib Date: Mon Dec 8 13:15:31 2008 New Revision: 185766 URL: http://svn.freebsd.org/changeset/base/185766 Log: Make two style changes to create new commit and document proper commit message for r185765. Noted by: rdivacky Requested by: des Commit message for r185765 should be: In procfs map handler, and in linprocfs maps handler, do not call vn_fullpath() while having vm map locked. This is done in anticipation of the vop_vptocnp commit, that would make vn_fullpath sometime acquire vnode lock. Also, in linprocfs, maps handler already acquires vnode lock. No objections from: des MFC after: 2 week Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_map.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Dec 8 12:34:52 2008 (r185765) +++ head/sys/compat/linprocfs/linprocfs.c Mon Dec 8 13:15:31 2008 (r185766) @@ -273,8 +273,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) /* XXX per-cpu vendor / class / model / id? */ } - sbuf_cat(sb, - "flags\t\t:"); + sbuf_cat(sb, "flags\t\t:"); if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { flags[16] = "fcmov"; Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Mon Dec 8 12:34:52 2008 (r185765) +++ head/sys/fs/procfs/procfs_map.c Mon Dec 8 13:15:31 2008 (r185766) @@ -82,11 +82,11 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - int error, vfslocked; vm_map_t map = &p->p_vmspace->vm_map; vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; + int error, vfslocked; unsigned int last_timestamp; #ifdef COMPAT_IA32 int wrap32 = 0; From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 17:09:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6901065676; Mon, 8 Dec 2008 17:09:02 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5AF8FC19; Mon, 8 Dec 2008 17:09:02 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8H92eZ065760; Mon, 8 Dec 2008 17:09:02 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8H92Qe065759; Mon, 8 Dec 2008 17:09:02 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200812081709.mB8H92Qe065759@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 8 Dec 2008 17: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: r185768 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 17:09:02 -0000 Author: lulf Date: Mon Dec 8 17:09:02 2008 New Revision: 185768 URL: http://svn.freebsd.org/changeset/base/185768 Log: - Add missing word in comment. Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon Dec 8 17:01:05 2008 (r185767) +++ head/sys/geom/geom_subr.c Mon Dec 8 17:09:02 2008 (r185768) @@ -370,7 +370,7 @@ g_destroy_geom(struct g_geom *gp) } /* - * This function is called (repeatedly) until the has withered away. + * This function is called (repeatedly) until the geom has withered away. */ void g_wither_geom(struct g_geom *gp, int error) From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 17:12:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 992B1106564A; Mon, 8 Dec 2008 17:12:40 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0858FC13; Mon, 8 Dec 2008 17:12:40 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8HCeE0065883; Mon, 8 Dec 2008 17:12:40 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8HCeod065882; Mon, 8 Dec 2008 17:12:40 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <200812081712.mB8HCeod065882@svn.freebsd.org> From: Jens Schweikhardt Date: Mon, 8 Dec 2008 17:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185769 - 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: Mon, 08 Dec 2008 17:12:40 -0000 Author: schweikh Date: Mon Dec 8 17:12:40 2008 New Revision: 185769 URL: http://svn.freebsd.org/changeset/base/185769 Log: White space only: Tabify; white space at EOL removed. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Dec 8 17:09:02 2008 (r185768) +++ head/UPDATING Mon Dec 8 17:12:40 2008 (r185769) @@ -38,11 +38,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. and thereby the code size); consult ath_hal(4) for details. 20081121: - __FreeBSD_version 800054 adds memory barriers to - , new interfaces to ifnet to facilitate + __FreeBSD_version 800054 adds memory barriers to + , new interfaces to ifnet to facilitate multiple hardware transmit queues for cards that support them, and a lock-less ring-buffer implementation to - enable drivers to more efficiently manage queueing of + enable drivers to more efficiently manage queueing of packets. 20081117: @@ -287,11 +287,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. be recompiled; this includes the hal and xorg-server ports. 20070928: - The caching daemon (cached) was renamed to nscd. nscd.conf - configuration file should be used instead of cached.conf and - nscd_enable, nscd_pidfile and nscd_flags options should be used - instead of cached_enable, cached_pidfile and cached_flags in - rc.conf. + The caching daemon (cached) was renamed to nscd. nscd.conf + configuration file should be used instead of cached.conf and + nscd_enable, nscd_pidfile and nscd_flags options should be used + instead of cached_enable, cached_pidfile and cached_flags in + rc.conf. 20070921: The getfacl(1) utility now prints owning user and group name @@ -299,7 +299,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. This is the same behavior as getfacl(1) on Solaris and Linux. 20070704: - The new IPsec code is now compiled in using the IPSEC option. The + The new IPsec code is now compiled in using the IPSEC option. The IPSEC option now requires "device crypto" be defined in your kernel configuration. The FAST_IPSEC kernel option is now deprecated. @@ -602,10 +602,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. If you have such a file, you need old utility to decrypt it. 20060709: - The interface version of the i4b kernel part has changed. So - after updating the kernel sources and compiling a new kernel, - the i4b user space tools in "/usr/src/usr.sbin/i4b" must also - be rebuilt, and vice versa. + The interface version of the i4b kernel part has changed. So + after updating the kernel sources and compiling a new kernel, + the i4b user space tools in "/usr/src/usr.sbin/i4b" must also + be rebuilt, and vice versa. 20060627: The XBOX kernel now defaults to the nfe(4) driver instead of @@ -1071,7 +1071,7 @@ COMMON ITEMS: - + To upgrade in-place from 5.x-stable to current From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 17:22:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03CCF1065675; Mon, 8 Dec 2008 17:22:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0A28FC12; Mon, 8 Dec 2008 17:22:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mB8HMIXO002722; Mon, 8 Dec 2008 12:22:19 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Konstantin Belousov Date: Mon, 8 Dec 2008 11:41:39 -0500 User-Agent: KMail/1.9.7 References: <200812071325.mB7DP64P026630@svn.freebsd.org> In-Reply-To: <200812071325.mB7DP64P026630@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812081141.39800.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 08 Dec 2008 12:22:19 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185739 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 17:22:26 -0000 On Sunday 07 December 2008 08:25:06 am Konstantin Belousov wrote: > Author: kib > Date: Sun Dec 7 13:25:06 2008 > New Revision: 185739 > URL: http://svn.freebsd.org/changeset/base/185739 > > Log: > Improve usefulness of the panic by printing the pointer to the problematic > dquot. In-tree gdb is often unable to get the dq value, so supply it in > panic message. Even in userland I find gdb to be an epic fail for handling local variables if inlined functions are involved. I haven't tried a newer gdb from ports to see if it fares better in that case. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 17:22:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E3CC106574C; Mon, 8 Dec 2008 17:22:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3FCD18FC16; Mon, 8 Dec 2008 17:22:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mB8HMIXP002722; Mon, 8 Dec 2008 12:22:25 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Tim Kientzle Date: Mon, 8 Dec 2008 11:48:00 -0500 User-Agent: KMail/1.9.7 References: <200812060657.mB66vjXM086176@svn.freebsd.org> In-Reply-To: <200812060657.mB66vjXM086176@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812081148.00728.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 08 Dec 2008 12:22:25 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185682 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 17:22:33 -0000 On Saturday 06 December 2008 01:57:45 am Tim Kientzle wrote: > Author: kientzle > Date: Sat Dec 6 06:57:45 2008 > New Revision: 185682 > URL: http://svn.freebsd.org/changeset/base/185682 > > Log: > Strip ";1" and trailing "." from ISO9660 entries. > This seems a better match for people's expectations. Err, maybe strip whatever version is present? The '1' is a version number and in theory you can have newer versions. I think the intention was to allow replacing files by growing an ISO fs with version '2' files "replacing" version '1', etc. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 17:22:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DB071065715; Mon, 8 Dec 2008 17:22:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0E83D8FC18; Mon, 8 Dec 2008 17:22:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mB8HMIXQ002722; Mon, 8 Dec 2008 12:22:30 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Roman Divacky Date: Mon, 8 Dec 2008 11:50:51 -0500 User-Agent: KMail/1.9.7 References: <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org> In-Reply-To: <20081205224600.GA16948@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812081150.52312.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 08 Dec 2008 12:22:31 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r185647 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 17:22:37 -0000 On Friday 05 December 2008 05:46:00 pm Roman Divacky wrote: > On Fri, Dec 05, 2008 at 08:50:24PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Dec 5 20:50:24 2008 > > New Revision: 185647 > > URL: http://svn.freebsd.org/changeset/base/185647 > > > > Log: > > Several threads in a process may do vfork() simultaneously. Then, all > > parent threads sleep on the parent' struct proc until corresponding > > child releases the vmspace. Each sleep is interlocked with proc mutex of > > the child, that triggers assertion in the sleepq_add(). The assertion > > requires that at any time, all simultaneous sleepers for the channel use > > the same interlock. > > > > Silent the assertion by using conditional variable allocated in the > > child. Broadcast the variable event on exec() and exit(). > > > > Since struct proc * sleep wait channel is overloaded for several > > unrelated events, I was unable to remove wakeups from the places where > > cv_broadcast() is added, except exec(). > > are there any differences (performance etc.) in using condition variables > instead of sleep/wakeup? They are both just wrappers around sleepq_*. cv does have a minor optimization where it attempts to avoid calling the sleepq_* code directly during a broadcast/signal if there are zero waiters. wakeup/wakeup_one always look in the hash table and walk the hash bucket via sleepq_*. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 17:22:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B949A106578E; Mon, 8 Dec 2008 17:22:44 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6CCF8FC1C; Mon, 8 Dec 2008 17:22:44 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8HMi0b066188; Mon, 8 Dec 2008 17:22:44 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8HMicp066187; Mon, 8 Dec 2008 17:22:44 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200812081722.mB8HMicp066187@svn.freebsd.org> From: Tim Kientzle Date: Mon, 8 Dec 2008 17:22: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: r185771 - head/lib/libarchive/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 17:22:45 -0000 Author: kientzle Date: Mon Dec 8 17:22:44 2008 New Revision: 185771 URL: http://svn.freebsd.org/changeset/base/185771 Log: Obey the TMPDIR, TMP, TEMP, or TEMPDIR environment variables when choosing a scratch directory for the tests. Fallback to "/tmp", of course. Modified: head/lib/libarchive/test/main.c Modified: head/lib/libarchive/test/main.c ============================================================================== --- head/lib/libarchive/test/main.c Mon Dec 8 17:18:37 2008 (r185770) +++ head/lib/libarchive/test/main.c Mon Dec 8 17:22:44 2008 (r185771) @@ -897,6 +897,7 @@ int main(int argc, char **argv) time_t now; char *refdir_alloc = NULL; char *progname, *p; + char *tmp; char tmpdir[256]; char tmpdir_timestamp[256]; @@ -916,6 +917,17 @@ int main(int argc, char **argv) testprog = getenv(ENVBASE); #endif + if (getenv("TMPDIR") != NULL) + tmp = getenv("TMPDIR"); + else if (getenv("TMP") != NULL) + tmp = getenv("TMP"); + else if (getenv("TEMP") != NULL) + tmp = getenv("TEMP"); + else if (getenv("TEMPDIR") != NULL) + tmp = getenv("TEMPDIR"); + else + tmp = "/tmp"; + /* Allow -d to be controlled through the environment. */ if (getenv(ENVBASE "_DEBUG") != NULL) dump_on_failure = 1; @@ -976,7 +988,8 @@ int main(int argc, char **argv) strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp), "%Y-%m-%dT%H.%M.%S", localtime(&now)); - sprintf(tmpdir, "/tmp/%s.%s-%03d", progname, tmpdir_timestamp, i); + sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname, + tmpdir_timestamp, i); if (mkdir(tmpdir,0755) == 0) break; if (errno == EEXIST) From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 18:40:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 053ED1065670; Mon, 8 Dec 2008 18:40:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7DB28FC1D; Mon, 8 Dec 2008 18:39:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8Idx0m067658; Mon, 8 Dec 2008 18:39:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8IdxbT067657; Mon, 8 Dec 2008 18:39:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200812081839.mB8IdxbT067657@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Dec 2008 18:39: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: r185772 - 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: Mon, 08 Dec 2008 18:40:00 -0000 Author: jkim Date: Mon Dec 8 18:39:59 2008 New Revision: 185772 URL: http://svn.freebsd.org/changeset/base/185772 Log: - Detect Bochs BIOS variants and use HZ_VM as well. - Free kernel environment variable after its use. - Fix style(9) nits. Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Mon Dec 8 17:22:44 2008 (r185771) +++ head/sys/kern/subr_param.c Mon Dec 8 18:39:59 2008 (r185772) @@ -118,6 +118,13 @@ SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, */ struct buf *swbuf; +static const char *const vm_bnames[] = { + "QEMU", /* QEMU */ + "Plex86", /* Plex86 */ + "Bochs", /* Bochs */ + NULL +}; + static const char *const vm_pnames[] = { "VMware Virtual Platform", /* VMWare VM */ "Virtual Machine", /* Microsoft VirtualPC */ @@ -132,14 +139,25 @@ detect_virtual(void) char *sysenv; int i; + sysenv = getenv("smbios.bios.vendor"); + if (sysenv != NULL) { + for (i = 0; vm_bnames[i] != NULL; i++) + if (strcmp(sysenv, vm_bnames[i]) == 0) { + freeenv(sysenv); + return (1); + } + freeenv(sysenv); + } sysenv = getenv("smbios.system.product"); if (sysenv != NULL) { - for (i = 0; vm_pnames[i] != NULL; i++) { - if (strcmp(sysenv, vm_pnames[i]) == 0) - return 1; - } + for (i = 0; vm_pnames[i] != NULL; i++) + if (strcmp(sysenv, vm_pnames[i]) == 0) { + freeenv(sysenv); + return (1); + } + freeenv(sysenv); } - return 0; + return (0); } /* @@ -151,13 +169,8 @@ init_param1(void) hz = -1; TUNABLE_INT_FETCH("kern.hz", &hz); - if (hz == -1) { - if (detect_virtual()) { - hz = HZ_VM; - } else { - hz = HZ; - } - } + if (hz == -1) + hz = detect_virtual() ? HZ_VM : HZ; tick = 1000000 / hz; #ifdef VM_SWZONE_SIZE_MAX From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 19:01:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46C3C106564A for ; Mon, 8 Dec 2008 19:01:16 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id BEBBF8FC0C for ; Mon, 8 Dec 2008 19:01:15 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1514136fgb.35 for ; Mon, 08 Dec 2008 11:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UPxrJXe8z0/TeHRi8kyFcygUjS93DjjjQRWAKEoh14M=; b=Xnf97s4oxaX4fUk4rARNYuqekyXc6H1vl7KiGMFSBsXQqrlVxYS7zl+08vx1cllxhW 1TdFQxMU2EcC9KFoHY+mNmDyZc6oC+zsPwAiU2i/+84r7MGgMY6Pzr1Cr4Cmjxgn1njz 8cygCdk0bMM171ZDOYL+s+2sUv2jmVML/IG9M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=WkyEnChVrVZutZ0ZnR4AziQWtOg1uAVV0c5xI5Y44n+7/wEeoW2jazbw+ZKzKTnInH Q+E3mx5SDJ0xFJHL137pfZzZkUTci6OI4X01RoywCnSN2KY+BIihMsg3hkKYU3YLrWqK Wft/+lmkOrriMlZ4QNJYbQF5gBxya1lU7SL8k= Received: by 10.181.226.2 with SMTP id d2mr1318143bkr.204.1228762874440; Mon, 08 Dec 2008 11:01:14 -0800 (PST) Received: by 10.181.229.16 with HTTP; Mon, 8 Dec 2008 11:01:14 -0800 (PST) Message-ID: <9bbcef730812081101o52905c4ak56acfb784bd58d16@mail.gmail.com> Date: Mon, 8 Dec 2008 20:01:14 +0100 From: "Ivan Voras" To: "Jung-uk Kim" In-Reply-To: <200812081839.mB8IdxbT067657@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812081839.mB8IdxbT067657@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185772 - 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: Mon, 08 Dec 2008 19:01:16 -0000 Hi, How about introducing a read-only sysctl, something like kern.in_vm that would be 0 : none detected / as far as we can tell we're on bare metal 1 : if detect_virtual() returns 1 2 : Xen dom-U 3, etc... for future use, like VMWare VMI, etc. ? (of course, for symmetry, if we ever support any hosting for full virtualization, another sysctl might be introduced as a bitmap :) ). 2008/12/8 Jung-uk Kim : > Author: jkim > Date: Mon Dec 8 18:39:59 2008 > New Revision: 185772 > URL: http://svn.freebsd.org/changeset/base/185772 > > Log: > - Detect Bochs BIOS variants and use HZ_VM as well. > - Free kernel environment variable after its use. > - Fix style(9) nits. > > Modified: > head/sys/kern/subr_param.c > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Mon Dec 8 17:22:44 2008 (r185771) > +++ head/sys/kern/subr_param.c Mon Dec 8 18:39:59 2008 (r185772) > @@ -118,6 +118,13 @@ SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, > */ > struct buf *swbuf; > > +static const char *const vm_bnames[] = { > + "QEMU", /* QEMU */ > + "Plex86", /* Plex86 */ > + "Bochs", /* Bochs */ > + NULL > +}; > + > static const char *const vm_pnames[] = { > "VMware Virtual Platform", /* VMWare VM */ > "Virtual Machine", /* Microsoft VirtualPC */ > @@ -132,14 +139,25 @@ detect_virtual(void) > char *sysenv; > int i; > > + sysenv = getenv("smbios.bios.vendor"); > + if (sysenv != NULL) { > + for (i = 0; vm_bnames[i] != NULL; i++) > + if (strcmp(sysenv, vm_bnames[i]) == 0) { > + freeenv(sysenv); > + return (1); > + } > + freeenv(sysenv); > + } > sysenv = getenv("smbios.system.product"); > if (sysenv != NULL) { > - for (i = 0; vm_pnames[i] != NULL; i++) { > - if (strcmp(sysenv, vm_pnames[i]) == 0) > - return 1; > - } > + for (i = 0; vm_pnames[i] != NULL; i++) > + if (strcmp(sysenv, vm_pnames[i]) == 0) { > + freeenv(sysenv); > + return (1); > + } > + freeenv(sysenv); > } > - return 0; > + return (0); > } > > /* > @@ -151,13 +169,8 @@ init_param1(void) > > hz = -1; > TUNABLE_INT_FETCH("kern.hz", &hz); > - if (hz == -1) { > - if (detect_virtual()) { > - hz = HZ_VM; > - } else { > - hz = HZ; > - } > - } > + if (hz == -1) > + hz = detect_virtual() ? HZ_VM : HZ; > tick = 1000000 / hz; > > #ifdef VM_SWZONE_SIZE_MAX > From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 19:06:16 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id BFA321065676; Mon, 8 Dec 2008 19:06:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 8 Dec 2008 14:06:00 -0500 User-Agent: KMail/1.6.2 References: <200812081839.mB8IdxbT067657@svn.freebsd.org> In-Reply-To: <200812081839.mB8IdxbT067657@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200812081406.02370.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r185772 - 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: Mon, 08 Dec 2008 19:06:16 -0000 On Monday 08 December 2008 01:39 pm, Jung-uk Kim wrote: > Author: jkim > Date: Mon Dec 8 18:39:59 2008 > New Revision: 185772 > URL: http://svn.freebsd.org/changeset/base/185772 > > Log: > - Detect Bochs BIOS variants and use HZ_VM as well. > - Free kernel environment variable after its use. > - Fix style(9) nits. > > Modified: > head/sys/kern/subr_param.c Recently QEMU added "firmware configuration" backdoor port to identify itself to host OS: http://lists.gnu.org/archive/html/qemu-devel/2008-08/msg01231.html We can add other guest architectures with it later. FYI... Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 19:22:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C03D1065673 for ; Mon, 8 Dec 2008 19:22:19 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 896388FC1F for ; Mon, 8 Dec 2008 19:22:18 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1521605fgb.35 for ; Mon, 08 Dec 2008 11:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=pdiWbDCkQQohSgKxUyPeT7BlYpDR8+ot3fZrUHgPZaQ=; b=NFX+pKfnIHr/cCugndKu8lE2g0zXIMyQ51arit7G9lZRjo3xqFwNN+jkJ+U8zaaOPI aZvbmV/Xwia7x3aSUZYGKyaFNQO0AlscrCYzuaEgh9qGBz5izNFQ1Hm5YNIwn6VFnrue kvc/eYWIPsrMmokbZnupEL11suf2DaPHoQQzM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=m18mTaNJoev7h7BOidOy2KhxcVeDrBToTNyOp3/eI5NNthCeipg9yn1htDAy6KmfRA TfESFPVbZ2Je/IZaUpGeEJCciccjXQaG4WZSHK9YReImdTj3dPkeprEPbSlNgqby7uue ZeqsIutuKQUq92aOJb20KzW/yBDxg3HlzQZqw= Received: by 10.180.213.14 with SMTP id l14mr1336564bkg.107.1228764136818; Mon, 08 Dec 2008 11:22:16 -0800 (PST) Received: by 10.181.229.16 with HTTP; Mon, 8 Dec 2008 11:22:16 -0800 (PST) Message-ID: <9bbcef730812081122r2b1fb938s6201aeee7756b884@mail.gmail.com> Date: Mon, 8 Dec 2008 20:22:16 +0100 From: "Ivan Voras" To: "Jung-uk Kim" In-Reply-To: <9bbcef730812081101o52905c4ak56acfb784bd58d16@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812081839.mB8IdxbT067657@svn.freebsd.org> <9bbcef730812081101o52905c4ak56acfb784bd58d16@mail.gmail.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185772 - 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: Mon, 08 Dec 2008 19:22:19 -0000 2008/12/8 Ivan Voras : > Hi, > > How about introducing a read-only sysctl, something like kern.in_vm > that would be > > 0 : none detected / as far as we can tell we're on bare metal > 1 : if detect_virtual() returns 1 > 2 : Xen dom-U > 3, etc... for future use, like VMWare VMI, etc. > > ? > > (of course, for symmetry, if we ever support any hosting for full > virtualization, another sysctl might be introduced as a bitmap :) ). Patch suggested: http://people.freebsd.org/~ivoras/diffs/subr_param.c.diff.txt From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 19:42:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC7F61065673; Mon, 8 Dec 2008 19:42:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6A28FC18; Mon, 8 Dec 2008 19:42:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L9m01-0004Bc-B9; Mon, 08 Dec 2008 21:42:33 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mB8JgUKR072357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Dec 2008 21:42:30 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mB8JgTEw097439; Mon, 8 Dec 2008 21:42:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mB8JgT79097438; Mon, 8 Dec 2008 21:42:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 8 Dec 2008 21:42:29 +0200 From: Kostik Belousov To: John Baldwin Message-ID: <20081208194229.GX2038@deviant.kiev.zoral.com.ua> References: <200812071325.mB7DP64P026630@svn.freebsd.org> <200812081141.39800.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rVbcdceMkFY6fDyG" Content-Disposition: inline In-Reply-To: <200812081141.39800.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L9m01-0004Bc-B9 4409df330c321681a1e6269f50f659f3 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185739 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 19:42:35 -0000 --rVbcdceMkFY6fDyG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 08, 2008 at 11:41:39AM -0500, John Baldwin wrote: > On Sunday 07 December 2008 08:25:06 am Konstantin Belousov wrote: > > Author: kib > > Date: Sun Dec 7 13:25:06 2008 > > New Revision: 185739 > > URL: http://svn.freebsd.org/changeset/base/185739 > >=20 > > Log: > > Improve usefulness of the panic by printing the pointer to the proble= matic > > dquot. In-tree gdb is often unable to get the dq value, so supply it = in > > panic message. >=20 > Even in userland I find gdb to be an epic fail for handling local > variables if inlined functions are involved. I haven't tried a newer > gdb from ports to see if it fares better in that case. I have locally built 6.8 exactly for this purposes, made by configure;make. I can confirm that its dwarf handling is _much_ better then in-tree gdb. --rVbcdceMkFY6fDyG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkk9eKUACgkQC3+MBN1Mb4iaOwCcCeF+AvL31xTo7OI9/xQg+7a1 AsAAoKdEJQ+HiYBDKU+Bf3Yrk3Zy1A8Y =ufS+ -----END PGP SIGNATURE----- --rVbcdceMkFY6fDyG-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 19:44:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 7FCAD1065673; Mon, 8 Dec 2008 19:44:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "Ivan Voras" Date: Mon, 8 Dec 2008 14:44:19 -0500 User-Agent: KMail/1.6.2 References: <200812081839.mB8IdxbT067657@svn.freebsd.org> <9bbcef730812081101o52905c4ak56acfb784bd58d16@mail.gmail.com> <9bbcef730812081122r2b1fb938s6201aeee7756b884@mail.gmail.com> In-Reply-To: <9bbcef730812081122r2b1fb938s6201aeee7756b884@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200812081444.25575.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185772 - 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: Mon, 08 Dec 2008 19:44:40 -0000 On Monday 08 December 2008 02:22 pm, Ivan Voras wrote: > 2008/12/8 Ivan Voras : > > Hi, > > > > How about introducing a read-only sysctl, something like > > kern.in_vm that would be > > > > 0 : none detected / as far as we can tell we're on bare metal > > 1 : if detect_virtual() returns 1 > > 2 : Xen dom-U > > 3, etc... for future use, like VMWare VMI, etc. > > > > ? > > > > (of course, for symmetry, if we ever support any hosting for full > > virtualization, another sysctl might be introduced as a bitmap :) > > ). > > Patch suggested: > http://people.freebsd.org/~ivoras/diffs/subr_param.c.diff.txt Personally I have no preference but I think you should move this discussion to freebsd-emulation@ and freebsd-virtualization@. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 19:49:53 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 17E021065672; Mon, 8 Dec 2008 19:49:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 8 Dec 2008 14:49:39 -0500 User-Agent: KMail/1.6.2 References: <200812081839.mB8IdxbT067657@svn.freebsd.org> <200812081406.02370.jkim@FreeBSD.org> In-Reply-To: <200812081406.02370.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200812081449.41300.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r185772 - 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: Mon, 08 Dec 2008 19:49:53 -0000 On Monday 08 December 2008 02:06 pm, Jung-uk Kim wrote: > On Monday 08 December 2008 01:39 pm, Jung-uk Kim wrote: > > Author: jkim > > Date: Mon Dec 8 18:39:59 2008 > > New Revision: 185772 > > URL: http://svn.freebsd.org/changeset/base/185772 > > > > Log: > > - Detect Bochs BIOS variants and use HZ_VM as well. > > - Free kernel environment variable after its use. > > - Fix style(9) nits. > > > > Modified: > > head/sys/kern/subr_param.c > > Recently QEMU added "firmware configuration" backdoor port to > identify itself to host OS: ^^^^ guest > http://lists.gnu.org/archive/html/qemu-devel/2008-08/msg01231.html > > We can add other guest architectures with it later. > > FYI... > > Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 20:18:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB21B1065670; Mon, 8 Dec 2008 20:18:50 +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 A84CA8FC08; Mon, 8 Dec 2008 20:18:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8KIolY069622; Mon, 8 Dec 2008 20:18:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8KIofH069620; Mon, 8 Dec 2008 20:18:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812082018.mB8KIofH069620@svn.freebsd.org> From: Robert Watson Date: Mon, 8 Dec 2008 20:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185773 - 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, 08 Dec 2008 20:18:50 -0000 Author: rwatson Date: Mon Dec 8 20:18:50 2008 New Revision: 185773 URL: http://svn.freebsd.org/changeset/base/185773 Log: Add a reference count to struct inpcb, which may be explicitly incremented using in_pcbref(), and decremented using in_pcbfree() or inpcbrele(). Protocols using only current in_pcballoc() and in_pcbfree() calls will see the same semantics, but it is now possible for TCP to call in_pcbref() and in_pcbrele() to prevent an inpcb from being freed when both tcbinfo and per-inpcb locks are released. This makes it possible to safely transition from holding only the inpcb lock to both tcbinfo and inpcb lock without re-looking up a connection in the input path, timer path, etc. Notice that in_pcbrele() does not unlock the connection after decrementing the refcount, if the connection remains, so that the caller can continue to use it; in_pcbrele() returns a flag indicating whether or not the inpcb pointer is still valid, and in_pcbfee() is now a simple wrapper around in_pcbrele(). MFC after: 1 month Discussed with: bz, kmacy Reviewed by: bz, gnn, kmacy Tested by: kmacy Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Dec 8 18:39:59 2008 (r185772) +++ head/sys/netinet/in_pcb.c Mon Dec 8 20:18:50 2008 (r185773) @@ -1,7 +1,7 @@ /*- * Copyright (c) 1982, 1986, 1991, 1993, 1995 * The Regents of the University of California. - * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2007-2008 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -238,6 +238,7 @@ in_pcballoc(struct socket *so, struct in #endif INP_WLOCK(inp); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; + inp->inp_refcount = 1; /* Reference from the inpcbinfo */ #if defined(IPSEC) || defined(MAC) out: @@ -872,14 +873,10 @@ in_pcbdisconnect(struct inpcb *inp) } /* - * Historically, in_pcbdetach() included the functionality now found in - * in_pcbfree() and in_pcbdrop(). They are now broken out to reflect the - * more complex life cycle of TCP. - * - * in_pcbdetach() is responsibe for disconnecting the socket from an inpcb. + * in_pcbdetach() is responsibe for disassociating a socket from an inpcb. * For most protocols, this will be invoked immediately prior to calling - * in_pcbfree(). However, for TCP the inpcb may significantly outlive the - * socket, in which case in_pcbfree() may be deferred. + * in_pcbfree(). However, with TCP the inpcb may significantly outlive the + * socket, in which case in_pcbfree() is deferred. */ void in_pcbdetach(struct inpcb *inp) @@ -892,15 +889,17 @@ in_pcbdetach(struct inpcb *inp) } /* - * in_pcbfree() is responsible for freeing an already-detached inpcb, as well - * as removing it from any global inpcb lists it might be on. + * in_pcbfree_internal() frees an inpcb that has been detached from its + * socket, and whose reference count has reached 0. It will also remove the + * inpcb from any global lists it might remain on. */ -void -in_pcbfree(struct inpcb *inp) +static void +in_pcbfree_internal(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + KASSERT(inp->inp_refcount == 0, ("%s: refcount !0", __func__)); INP_INFO_WLOCK_ASSERT(ipi); INP_WLOCK_ASSERT(inp); @@ -932,6 +931,77 @@ in_pcbfree(struct inpcb *inp) } /* + * in_pcbref() bumps the reference count on an inpcb in order to maintain + * stability of an inpcb pointer despite the inpcb lock being released. This + * is used in TCP when the inpcbinfo lock needs to be acquired or upgraded, + * but where the inpcb lock is already held. + * + * While the inpcb will not be freed, releasing the inpcb lock means that the + * connection's state may change, so the caller should be careful to + * revalidate any cached state on reacquiring the lock. Drop the reference + * using in_pcbrele(). + */ +void +in_pcbref(struct inpcb *inp) +{ + + INP_WLOCK_ASSERT(inp); + + KASSERT(inp->inp_refcount > 0, ("%s: refcount 0", __func__)); + + inp->inp_refcount++; +} + +/* + * Drop a refcount on an inpcb elevated using in_pcbref(); because a call to + * in_pcbfree() may have been made between in_pcbref() and in_pcbrele(), we + * return a flag indicating whether or not the inpcb remains valid. If it is + * valid, we return with the inpcb lock held. + */ +int +in_pcbrele(struct inpcb *inp) +{ +#ifdef INVARIANTS + struct inpcbinfo *ipi = inp->inp_pcbinfo; +#endif + + KASSERT(inp->inp_refcount > 0, ("%s: refcount 0", __func__)); + + INP_INFO_WLOCK_ASSERT(ipi); + INP_WLOCK_ASSERT(inp); + + inp->inp_refcount--; + if (inp->inp_refcount > 0) + return (0); + in_pcbfree_internal(inp); + return (1); +} + +/* + * Unconditionally schedule an inpcb to be freed by decrementing its + * reference count, which should occur only after the inpcb has been detached + * from its socket. If another thread holds a temporary reference (acquired + * using in_pcbref()) then the free is deferred until that reference is + * released using in_pcbrele(), but the inpcb is still unlocked. + */ +void +in_pcbfree(struct inpcb *inp) +{ +#ifdef INVARIANTS + struct inpcbinfo *ipi = inp->inp_pcbinfo; +#endif + + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", + __func__)); + + INP_INFO_WLOCK_ASSERT(ipi); + INP_WLOCK_ASSERT(inp); + + if (!in_pcbrele(inp)) + INP_WUNLOCK(inp); +} + +/* * in_pcbdrop() removes an inpcb from hashed lists, releasing its address and * port reservation, and preventing it from being returned by inpcb lookups. * Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Dec 8 18:39:59 2008 (r185772) +++ head/sys/netinet/in_pcb.h Mon Dec 8 20:18:50 2008 (r185773) @@ -170,6 +170,7 @@ struct inpcb { u_char inp_ip_p; /* (c) protocol proto */ u_char inp_ip_minttl; /* (i) minimum TTL or drop */ uint32_t inp_ispare1; /* (x) connection id / queue id */ + u_int inp_refcount; /* (i) refcount */ void *inp_pspare[2]; /* (x) rtentry / general use */ /* Local and foreign ports, local and foreign addr. */ @@ -478,7 +479,9 @@ struct inpcb * struct in_addr, u_int, int, struct ifnet *); void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr, int, struct inpcb *(*)(struct inpcb *, int)); +void in_pcbref(struct inpcb *); void in_pcbrehash(struct inpcb *); +int in_pcbrele(struct inpcb *); void in_pcbsetsolabel(struct socket *so); int in_getpeeraddr(struct socket *so, struct sockaddr **nam); int in_getsockaddr(struct socket *so, struct sockaddr **nam); From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 20:21:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6EF1065675; Mon, 8 Dec 2008 20:21:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0228FC16; Mon, 8 Dec 2008 20:21:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8KLvoS069708; Mon, 8 Dec 2008 20:21:57 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8KLvkr069707; Mon, 8 Dec 2008 20:21:57 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812082021.mB8KLvkr069707@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Dec 2008 20:21: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: r185774 - 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: Mon, 08 Dec 2008 20:21:58 -0000 Author: kmacy Date: Mon Dec 8 20:21:57 2008 New Revision: 185774 URL: http://svn.freebsd.org/changeset/base/185774 Log: - avoid recursively locking the radix node head lock - assert that it is held if RTF_RNH_LOCKED is not passed Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Dec 8 20:18:50 2008 (r185773) +++ head/sys/net/route.c Mon Dec 8 20:21:57 2008 (r185774) @@ -866,7 +866,7 @@ rtexpunge(struct rtentry *rt) * Now search what's left of the subtree for any cloned * routes which might have been formed from this node. */ - if ((rt->rt_flags & RTF_CLONING) && rt_mask(rt)) + if ((rt->rt_flags & RTF_CLONING) && rt_mask(rt)) rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), rt_fixdelete, rt); @@ -935,6 +935,8 @@ rtrequest1_fib(int req, struct rt_addrin flags &= ~RTF_RNH_LOCKED; if (needlock) RADIX_NODE_HEAD_LOCK(rnh); + else + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); /* * If we are adding a host route then we don't want to put * a netmask in the tree, nor do we want to clone it. @@ -1277,7 +1279,7 @@ rt_fixdelete(struct radix_node *rn, void if (rt->rt_parent == rt0 && !(rt->rt_flags & (RTF_PINNED | RTF_CLONING))) { return rtrequest_fib(RTM_DELETE, rt_key(rt), NULL, rt_mask(rt), - rt->rt_flags, NULL, rt->rt_fibnum); + rt->rt_flags|RTF_RNH_LOCKED, NULL, rt->rt_fibnum); } return 0; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 20:27:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6BB0106564A; Mon, 8 Dec 2008 20:27:00 +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 B36CD8FC12; Mon, 8 Dec 2008 20:27:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8KR0pS069832; Mon, 8 Dec 2008 20:27:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8KR0Vt069831; Mon, 8 Dec 2008 20:27:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812082027.mB8KR0Vt069831@svn.freebsd.org> From: Robert Watson Date: Mon, 8 Dec 2008 20:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185775 - 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, 08 Dec 2008 20:27:00 -0000 Author: rwatson Date: Mon Dec 8 20:27:00 2008 New Revision: 185775 URL: http://svn.freebsd.org/changeset/base/185775 Log: Move from solely write-locking the global tcbinfo in tcp_input() to read-locking in the TCP input path, allowing greater TCP input parallelism where multiple ithreads or ithread and netisr are able to run in parallel. Previously, most TCP input paths held a write lock on the global tcbinfo lock, effectively serializing TCP input. Before looking up the connection, acquire a write lock if a potentially state-changing flag is set on the TCP segment header (FIN, RST, SYN), and otherwise a read lock. We may later have to upgrade to a write lock in certain cases (ACKs received by the syncache or during TIMEWAIT) in order to support global state transitions, but this is never required for steady-state packets. Upgrading from a write lock to a read lock must be done as a trylock operation to avoid deadlocks, and actually violates the lock order as the tcbinfo lock preceeds the inpcb lock held at the time of upgrade. If the trylock fails, we bump the refcount on the inpcb, drop both locks, and re-acquire in-order. If another thread has freed the connection while the locks are dropped, we free the inpcb and repeat the lookup (this should hardly ever or never happen in practice). For now, maintain a number of new counters measuring how many times various cases execute, and in particular whether various optimistic assumptions about when read locks can be used, whether upgrades are done using the fast path, and whether connections close in practice in the above-described race, actually occur. MFC after: 6 weeks Discussed with: kmacy Reviewed by: bz, gnn, kmacy Tested by: kmacy Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Dec 8 20:21:57 2008 (r185774) +++ head/sys/netinet/tcp_input.c Mon Dec 8 20:27:00 2008 (r185775) @@ -166,6 +166,30 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet CTLFLAG_RW, tcp_autorcvbuf_max, 0, "Max size of automatic receive buffer"); +int tcp_read_locking = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, read_locking, CTLFLAG_RW, + &tcp_read_locking, 0, "Enable read locking strategy"); + +int tcp_rlock_atfirst; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rlock_atfirst, CTLFLAG_RD, + &tcp_rlock_atfirst, 0, ""); + +int tcp_wlock_atfirst; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_wlock_atfirst, CTLFLAG_RD, + &tcp_wlock_atfirst, 0, ""); + +int tcp_wlock_upgraded; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_upgraded, CTLFLAG_RD, + &tcp_wlock_upgraded, 0, ""); + +int tcp_wlock_relocked; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_relocked, CTLFLAG_RD, + &tcp_wlock_relocked, 0, ""); + +int tcp_wlock_looped; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_looped, CTLFLAG_RD, + &tcp_wlock_looped, 0, ""); + #ifdef VIMAGE_GLOBALS struct inpcbhead tcb; struct inpcbinfo tcbinfo; @@ -174,7 +198,8 @@ struct inpcbinfo tcbinfo; static void tcp_dooptions(struct tcpopt *, u_char *, int, int); static void tcp_do_segment(struct mbuf *, struct tcphdr *, - struct socket *, struct tcpcb *, int, int, uint8_t); + struct socket *, struct tcpcb *, int, int, uint8_t, + int); static void tcp_dropwithreset(struct mbuf *, struct tcphdr *, struct tcpcb *, int, int); static void tcp_pulloutofband(struct socket *, @@ -298,6 +323,10 @@ tcp_input(struct mbuf *m, int off0) #endif struct tcpopt to; /* options in this segment */ char *s = NULL; /* address and port logging */ + int ti_locked; +#define TI_UNLOCKED 1 +#define TI_RLOCKED 2 +#define TI_WLOCKED 3 #ifdef TCPDEBUG /* @@ -450,11 +479,34 @@ tcp_input(struct mbuf *m, int off0) drop_hdrlen = off0 + off; /* - * Locate pcb for segment. - */ - INP_INFO_WLOCK(&V_tcbinfo); + * Locate pcb for segment, which requires a lock on tcbinfo. + * Optimisticaly acquire a global read lock unless header flags + * necessarily imply a state change. There are two cases where we + * might discover later we need a write lock despite the flags: ACKs + * moving a connection out of the syncache, and ACK relating to a + * connection in TIMEWAIT. + */ + if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || + tcp_read_locking == 0) { + INP_INFO_WLOCK(&V_tcbinfo); + ti_locked = TI_WLOCKED; + tcp_wlock_atfirst++; + } else { + INP_INFO_RLOCK(&V_tcbinfo); + ti_locked = TI_RLOCKED; + tcp_rlock_atfirst++; + } + findpcb: - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); +#ifdef INVARIANTS + if (ti_locked == TI_RLOCKED) + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + else + panic("%s: findpcb ti_locked %d\n", __func__, ti_locked); +#endif + #ifdef IPFIREWALL_FORWARD /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. @@ -561,12 +613,44 @@ findpcb: } /* - * A previous connection in TIMEWAIT state is supposed to catch - * stray or duplicate segments arriving late. If this segment - * was a legitimate new connection attempt the old INPCB gets - * removed and we can try again to find a listening socket. + * A previous connection in TIMEWAIT state is supposed to catch stray + * or duplicate segments arriving late. If this segment was a + * legitimate new connection attempt the old INPCB gets removed and + * we can try again to find a listening socket. + * + * At this point, due to earlier optimism, we may hold a read lock on + * the inpcbinfo, rather than a write lock. If so, we need to + * upgrade, or if that fails, acquire a reference on the inpcb, drop + * all locks, acquire a global write lock, and then re-acquire the + * inpcb lock. We may at that point discover that another thread has + * tried to free the inpcb, in which case we need to loop back and + * try to find a new inpcb to deliver to. */ if (inp->inp_vflag & INP_TIMEWAIT) { + KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, + ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked)); + + if (ti_locked == TI_RLOCKED) { + if (rw_try_upgrade(&V_tcbinfo.ipi_lock) == 0) { + in_pcbref(inp); + INP_WUNLOCK(inp); + INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_WLOCK(&V_tcbinfo); + ti_locked = TI_WLOCKED; + INP_WLOCK(inp); + if (in_pcbrele(inp)) { + tcp_wlock_looped++; + inp = NULL; + goto findpcb; + } + tcp_wlock_relocked++; + } else { + ti_locked = TI_WLOCKED; + tcp_wlock_upgraded++; + } + } + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + if (thflags & TH_SYN) tcp_dooptions(&to, optp, optlen, TO_SYN); /* @@ -588,6 +672,40 @@ findpcb: goto dropwithreset; } + /* + * We've identified a valid inpcb, but it could be that we need an + * inpcbinfo write lock and have only a read lock. In this case, + * attempt to upgrade/relock using the same strategy as the TIMEWAIT + * case above. + */ + if (tp->t_state != TCPS_ESTABLISHED || + (thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || + tcp_read_locking == 0) { + KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, + ("%s: upgrade check ti_locked %d", __func__, ti_locked)); + + if (ti_locked == TI_RLOCKED) { + if (rw_try_upgrade(&V_tcbinfo.ipi_lock) == 0) { + in_pcbref(inp); + INP_WUNLOCK(inp); + INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_WLOCK(&V_tcbinfo); + ti_locked = TI_WLOCKED; + INP_WLOCK(inp); + if (in_pcbrele(inp)) { + tcp_wlock_looped++; + inp = NULL; + goto findpcb; + } + tcp_wlock_relocked++; + } else { + ti_locked = TI_WLOCKED; + tcp_wlock_upgraded++; + } + } + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + } + #ifdef MAC INP_WLOCK_ASSERT(inp); if (mac_inpcb_check_deliver(inp, m)) @@ -700,7 +818,7 @@ findpcb: * the mbuf chain and unlocks the inpcb. */ tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, - iptos); + iptos, ti_locked); INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return; } @@ -900,13 +1018,18 @@ findpcb: * state. tcp_do_segment() always consumes the mbuf chain, unlocks * the inpcb, and unlocks pcbinfo. */ - tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos); + tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos, ti_locked); INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return; dropwithreset: - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: dropwithreset ti_locked %d", __func__, ti_locked); + ti_locked = TI_UNLOCKED; if (inp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); @@ -917,10 +1040,16 @@ dropwithreset: goto drop; dropunlock: - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: dropunlock ti_locked %d", __func__, ti_locked); + ti_locked = TI_UNLOCKED; + if (inp != NULL) INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); drop: INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); @@ -932,11 +1061,11 @@ drop: static void tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, - struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos) + struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, + int ti_locked) { INIT_VNET_INET(tp->t_vnet); int thflags, acked, ourfinisacked, needoutput = 0; - int headlocked = 1; int rstreason, todrop, win; u_long tiwin; struct tcpopt to; @@ -952,7 +1081,35 @@ tcp_do_segment(struct mbuf *m, struct tc #endif thflags = th->th_flags; - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + /* + * If this is either a state-changing packet or current state isn't + * established, we require a write lock on tcbinfo. Otherwise, we + * allow either a read lock or a write lock, as we may have acquired + * a write lock due to a race. + * + * Require a global write lock for SYN/SIN/RST segments or + * non-established connections; otherwise accept either a read or + * write lock, as we may have conservatively acquired a write lock in + * certain cases in tcp_input() (is this still true?). Currently we + * will never enter with no lock, so we try to drop it quickly in the + * common pure ack/pure data cases. + */ + if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || + tp->t_state != TCPS_ESTABLISHED) { + KASSERT(ti_locked == TI_WLOCKED, ("%s ti_locked %d for " + "SYN/FIN/RST/!EST", __func__, ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + } else { +#ifdef INVARIANTS + if (ti_locked == TI_RLOCKED) + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + else + panic("%s: ti_locked %d for EST", __func__, + ti_locked); +#endif + } INP_WLOCK_ASSERT(tp->t_inpcb); KASSERT(tp->t_state > TCPS_LISTEN, ("%s: TCPS_LISTEN", __func__)); @@ -1106,14 +1263,20 @@ tcp_do_segment(struct mbuf *m, struct tc !IN_FASTRECOVERY(tp) && (to.to_flags & TOF_SACK) == 0 && TAILQ_EMPTY(&tp->snd_holes)))) { - KASSERT(headlocked, - ("%s: headlocked", __func__)); - INP_INFO_WUNLOCK(&V_tcbinfo); - headlocked = 0; /* * This is a pure ack for outstanding data. */ + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: ti_locked %d on pure ACK", + __func__, ti_locked); + ti_locked = TI_UNLOCKED; + ++V_tcpstat.tcps_predack; + /* * "bad retransmit" recovery. */ @@ -1200,14 +1363,20 @@ tcp_do_segment(struct mbuf *m, struct tc tlen <= sbspace(&so->so_rcv)) { int newsize = 0; /* automatic sockbuf scaling */ - KASSERT(headlocked, ("%s: headlocked", __func__)); - INP_INFO_WUNLOCK(&V_tcbinfo); - headlocked = 0; /* - * This is a pure, in-sequence data packet - * with nothing on the reassembly queue and - * we have enough buffer space to take it. - */ + * This is a pure, in-sequence data packet with + * nothing on the reassembly queue and we have enough + * buffer space to take it. + */ + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: ti_locked %d on pure data " + "segment", __func__, ti_locked); + ti_locked = TI_UNLOCKED; + /* Clean receiver SACK report if present */ if ((tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks) tcp_clean_sackreport(tp); @@ -1434,8 +1603,9 @@ tcp_do_segment(struct mbuf *m, struct tc tp->t_state = TCPS_SYN_RECEIVED; } - KASSERT(headlocked, ("%s: trimthenstep6: head not locked", - __func__)); + KASSERT(ti_locked == TI_WLOCKED, ("%s: trimthenstep6: " + "ti_locked %d", __func__, ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); /* @@ -1563,17 +1733,23 @@ tcp_do_segment(struct mbuf *m, struct tc case TCPS_CLOSE_WAIT: so->so_error = ECONNRESET; close: + KASSERT(ti_locked == TI_WLOCKED, + ("tcp_do_segment: TH_RST 1 ti_locked %d", + ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + tp->t_state = TCPS_CLOSED; V_tcpstat.tcps_drops++; - KASSERT(headlocked, ("%s: trimthenstep6: " - "tcp_close: head not locked", __func__)); tp = tcp_close(tp); break; case TCPS_CLOSING: case TCPS_LAST_ACK: - KASSERT(headlocked, ("%s: trimthenstep6: " - "tcp_close.2: head not locked", __func__)); + KASSERT(ti_locked == TI_WLOCKED, + ("tcp_do_segment: TH_RST 2 ti_locked %d", + ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + tp = tcp_close(tp); break; } @@ -1678,8 +1854,10 @@ tcp_do_segment(struct mbuf *m, struct tc tp->t_state > TCPS_CLOSE_WAIT && tlen) { char *s; - KASSERT(headlocked, ("%s: trimthenstep6: tcp_close.3: head " - "not locked", __func__)); + KASSERT(ti_locked == TI_WLOCKED, ("%s: SS_NOFDEREF && " + "CLOSE_WAIT && tlen ti_locked %d", __func__, ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: %s: Received %d bytes of data after socket " "was closed, sending RST and removing tcpcb\n", @@ -1751,8 +1929,10 @@ tcp_do_segment(struct mbuf *m, struct tc * error and we send an RST and drop the connection. */ if (thflags & TH_SYN) { - KASSERT(headlocked, ("%s: tcp_drop: trimthenstep6: " - "head not locked", __func__)); + KASSERT(ti_locked == TI_WLOCKED, + ("tcp_do_segment: TH_SYN ti_locked %d", ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + tp = tcp_drop(tp, ECONNRESET); rstreason = BANDLIM_UNLIMITED; goto drop; @@ -2039,8 +2219,9 @@ tcp_do_segment(struct mbuf *m, struct tc } process_ACK: - KASSERT(headlocked, ("%s: process_ACK: head not locked", - __func__)); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); + KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, + ("tcp_input: process_ACK ti_locked %d", ti_locked)); INP_WLOCK_ASSERT(tp->t_inpcb); acked = th->th_ack - tp->snd_una; @@ -2197,11 +2378,9 @@ process_ACK: */ case TCPS_CLOSING: if (ourfinisacked) { - KASSERT(headlocked, ("%s: process_ACK: " - "head not locked", __func__)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); tcp_twstart(tp); INP_INFO_WUNLOCK(&V_tcbinfo); - headlocked = 0; m_freem(m); return; } @@ -2215,8 +2394,7 @@ process_ACK: */ case TCPS_LAST_ACK: if (ourfinisacked) { - KASSERT(headlocked, ("%s: process_ACK: " - "tcp_close: head not locked", __func__)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); tp = tcp_close(tp); goto drop; } @@ -2225,7 +2403,9 @@ process_ACK: } step6: - KASSERT(headlocked, ("%s: step6: head not locked", __func__)); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); + KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, + ("tcp_do_segment: step6 ti_locked %d", ti_locked)); INP_WLOCK_ASSERT(tp->t_inpcb); /* @@ -2311,7 +2491,9 @@ step6: tp->rcv_up = tp->rcv_nxt; } dodata: /* XXX */ - KASSERT(headlocked, ("%s: dodata: head not locked", __func__)); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); + KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, + ("tcp_do_segment: dodata ti_locked %d", ti_locked)); INP_WLOCK_ASSERT(tp->t_inpcb); /* @@ -2430,15 +2612,25 @@ dodata: /* XXX */ * standard timers. */ case TCPS_FIN_WAIT_2: - KASSERT(headlocked == 1, ("%s: dodata: " - "TCP_FIN_WAIT_2: head not locked", __func__)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + KASSERT(ti_locked == TI_WLOCKED, ("%s: dodata " + "TCP_FIN_WAIT_2 ti_locked: %d", __func__, + ti_locked)); + tcp_twstart(tp); INP_INFO_WUNLOCK(&V_tcbinfo); return; } } - INP_INFO_WUNLOCK(&V_tcbinfo); - headlocked = 0; + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: dodata epilogue ti_locked %d", __func__, + ti_locked); + ti_locked = TI_UNLOCKED; + #ifdef TCPDEBUG if (so->so_options & SO_DEBUG) tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, @@ -2452,10 +2644,11 @@ dodata: /* XXX */ (void) tcp_output(tp); check_delack: - KASSERT(headlocked == 0, ("%s: check_delack: head locked", - __func__)); + KASSERT(ti_locked == TI_UNLOCKED, ("%s: check_delack ti_locked %d", + __func__, ti_locked)); INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); + if (tp->t_flags & TF_DELACK) { tp->t_flags &= ~TF_DELACK; tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); @@ -2464,7 +2657,9 @@ check_delack: return; dropafterack: - KASSERT(headlocked, ("%s: dropafterack: head not locked", __func__)); + KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, + ("tcp_do_segment: dropafterack ti_locked %d", ti_locked)); + /* * Generate an ACK dropping incoming segment if it occupies * sequence space, where the ACK reflects our state. @@ -2491,8 +2686,15 @@ dropafterack: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - KASSERT(headlocked, ("%s: headlocked should be 1", __func__)); - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: dropafterack epilogue ti_locked %d", __func__, + ti_locked); + ti_locked = TI_UNLOCKED; + tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); INP_WUNLOCK(tp->t_inpcb); @@ -2500,8 +2702,13 @@ dropafterack: return; dropwithreset: - KASSERT(headlocked, ("%s: dropwithreset: head not locked", __func__)); - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); + else + panic("%s: dropwithreset ti_locked %d", __func__, ti_locked); + ti_locked = TI_UNLOCKED; if (tp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); @@ -2511,6 +2718,16 @@ dropwithreset: return; drop: + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); + else if (ti_locked == TI_WLOCKED) + INP_INFO_WUNLOCK(&V_tcbinfo); +#ifdef INVARIANTS + else + INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); +#endif + ti_locked = TI_UNLOCKED; + /* * Drop space held by incoming segment and return. */ @@ -2521,8 +2738,6 @@ drop: #endif if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); - if (headlocked) - INP_INFO_WUNLOCK(&V_tcbinfo); m_freem(m); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 20:53:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6379E106564A; Mon, 8 Dec 2008 20:53:27 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BA38FC1A; Mon, 8 Dec 2008 20:53:27 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8KrRr0070417; Mon, 8 Dec 2008 20:53:27 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8KrRjX070416; Mon, 8 Dec 2008 20:53:27 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200812082053.mB8KrRjX070416@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 8 Dec 2008 20:53: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: r185776 - head/sys/boot/i386/boot0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 20:53:27 -0000 Author: sobomax Date: Mon Dec 8 20:53:27 2008 New Revision: 185776 URL: http://svn.freebsd.org/changeset/base/185776 Log: Fix typo in the comment %is -> %si. Modified: head/sys/boot/i386/boot0/boot0.S Modified: head/sys/boot/i386/boot0/boot0.S ============================================================================== --- head/sys/boot/i386/boot0/boot0.S Mon Dec 8 20:27:00 2008 (r185775) +++ head/sys/boot/i386/boot0/boot0.S Mon Dec 8 20:53:27 2008 (r185776) @@ -93,7 +93,7 @@ * %si pointer to the partition table from which we were loaded. * Some boot code (e.g. syslinux) use this info to relocate * themselves, so we want to pass a valid one to the next stage. - * NOTE: the use of %is is not a standard. + * NOTE: the use of %si is not a standard. * * This boot block first relocates itself at a different address (0:0x600), * to free the space at 0:0x7c00 for the next stage boot block. From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 21:04:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEAC106564A; Mon, 8 Dec 2008 21:04:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F028B8FC17; Mon, 8 Dec 2008 21:04:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8L4OpU070678; Mon, 8 Dec 2008 21:04:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8L4OW0070671; Mon, 8 Dec 2008 21:04:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812082104.mB8L4OW0070671@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Dec 2008 21:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185777 - in head: gnu/usr.bin/cc/libiberty gnu/usr.bin/sort include kerberos5/include lib/bind/bind lib/libmagic usr.bin/file X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 21:04:25 -0000 Author: kib Date: Mon Dec 8 21:04:24 2008 New Revision: 185777 URL: http://svn.freebsd.org/changeset/base/185777 Log: Add strndup(3) prototype to string.h. This change was erronously ommitted from the r185690, and attempt to simply add the prototype to string.h has revealed that several contributed programs defined local prototypes for strndup(), controlled by autoconfed config.h. So, manually change #undef HAVE_STRNDUP to #define HAVE_STRNDUP 1. Next import of the corresponding program would regenerate config.h, overriding the changes in this commit. No objections from: kan Modified: head/gnu/usr.bin/cc/libiberty/config.h head/gnu/usr.bin/sort/config.h head/include/string.h head/kerberos5/include/config.h head/lib/bind/bind/port_after.h head/lib/libmagic/config.h head/usr.bin/file/config.h Modified: head/gnu/usr.bin/cc/libiberty/config.h ============================================================================== --- head/gnu/usr.bin/cc/libiberty/config.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/gnu/usr.bin/cc/libiberty/config.h Mon Dec 8 21:04:24 2008 (r185777) @@ -235,7 +235,7 @@ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 Modified: head/gnu/usr.bin/sort/config.h ============================================================================== --- head/gnu/usr.bin/sort/config.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/gnu/usr.bin/sort/config.h Mon Dec 8 21:04:24 2008 (r185777) @@ -759,7 +759,7 @@ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strpbrk' function. */ #define HAVE_STRPBRK 1 Modified: head/include/string.h ============================================================================== --- head/include/string.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/include/string.h Mon Dec 8 21:04:24 2008 (r185777) @@ -96,6 +96,7 @@ char *strncat(char * __restrict, const c int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); #if __BSD_VISIBLE +char *strndup(const char *, size_t); char *strnstr(const char *, const char *, size_t) __pure; #endif char *strpbrk(const char *, const char *) __pure; Modified: head/kerberos5/include/config.h ============================================================================== --- head/kerberos5/include/config.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/kerberos5/include/config.h Mon Dec 8 21:04:24 2008 (r185777) @@ -785,7 +785,7 @@ static /**/const char *const rcsid[] = { #define HAVE_STRNCASECMP 1 /* Define if you have the function `strndup'. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define if you have the function `strnlen'. */ /* #undef HAVE_STRNLEN */ Modified: head/lib/bind/bind/port_after.h ============================================================================== --- head/lib/bind/bind/port_after.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/lib/bind/bind/port_after.h Mon Dec 8 21:04:24 2008 (r185777) @@ -30,7 +30,7 @@ #undef HAS_IN_ADDR6 #define HAVE_SOCKADDR_STORAGE 1 #undef NEED_GETTIMEOFDAY -#undef HAVE_STRNDUP +#define HAVE_STRNDUP 1 #undef USE_FIONBIO_IOCTL #undef USE_SYSERROR_LIST #undef INNETGR_ARGS Modified: head/lib/libmagic/config.h ============================================================================== --- head/lib/libmagic/config.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/lib/libmagic/config.h Mon Dec 8 21:04:24 2008 (r185777) @@ -77,7 +77,7 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strtof' function. */ #define HAVE_STRTOF 1 Modified: head/usr.bin/file/config.h ============================================================================== --- head/usr.bin/file/config.h Mon Dec 8 20:53:27 2008 (r185776) +++ head/usr.bin/file/config.h Mon Dec 8 21:04:24 2008 (r185777) @@ -77,7 +77,7 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strtof' function. */ #define HAVE_STRTOF 1 From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 21:46:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FF21065678; Mon, 8 Dec 2008 21:46:56 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 402668FC25; Mon, 8 Dec 2008 21:46:56 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8LkthG071501; Mon, 8 Dec 2008 21:46:55 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8LktPW071499; Mon, 8 Dec 2008 21:46:55 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812082146.mB8LktPW071499@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Dec 2008 21:46: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: r185778 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 21:46:56 -0000 Author: kmacy Date: Mon Dec 8 21:46:55 2008 New Revision: 185778 URL: http://svn.freebsd.org/changeset/base/185778 Log: add RW_SYSINIT_FLAGS macro and rw_sysinit_flags initialization function Modified: head/sys/kern/kern_rwlock.c head/sys/sys/rwlock.h Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Mon Dec 8 21:04:24 2008 (r185777) +++ head/sys/kern/kern_rwlock.c Mon Dec 8 21:46:55 2008 (r185778) @@ -191,6 +191,14 @@ rw_sysinit(void *arg) rw_init(args->ra_rw, args->ra_desc); } +void +rw_sysinit_flags(void *arg) +{ + struct rw_args_flags *args = arg; + + rw_init_flags(args->ra_rw, args->ra_desc, args->ra_flags); +} + int rw_wowned(struct rwlock *rw) { Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Mon Dec 8 21:04:24 2008 (r185777) +++ head/sys/sys/rwlock.h Mon Dec 8 21:46:55 2008 (r185778) @@ -132,6 +132,7 @@ void rw_init_flags(struct rwlock *rw, const char *name, int opts); void rw_destroy(struct rwlock *rw); void rw_sysinit(void *arg); +void rw_sysinit_flags(void *arg); int rw_wowned(struct rwlock *rw); void _rw_wlock(struct rwlock *rw, const char *file, int line); int _rw_try_wlock(struct rwlock *rw, const char *file, int line); @@ -187,6 +188,12 @@ struct rw_args { const char *ra_desc; }; +struct rw_args_flags { + struct rwlock *ra_rw; + const char *ra_desc; + int ra_flags; +}; + #define RW_SYSINIT(name, rw, desc) \ static struct rw_args name##_args = { \ (rw), \ @@ -197,6 +204,18 @@ struct rw_args { SYSUNINIT(name##_rw_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rw_destroy, (rw)) + +#define RW_SYSINIT_FLAGS(name, rw, desc, flags) \ + static struct rw_args_flags name##_args = { \ + (rw), \ + (desc), \ + (flags), \ + }; \ + SYSINIT(name##_rw_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ + rw_sysinit_flags, &name##_args); \ + SYSUNINIT(name##_rw_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ + rw_destroy, (rw)) + /* * Options passed to rw_init_flags(). */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 21:52:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32A7B1065675; Mon, 8 Dec 2008 21:52:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20BFA8FC1F; Mon, 8 Dec 2008 21:52:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8Lq7FK071636; Mon, 8 Dec 2008 21:52:07 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8Lq7Kv071635; Mon, 8 Dec 2008 21:52:07 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200812082152.mB8Lq7Kv071635@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 8 Dec 2008 21:52: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: r185779 - head/sys/boot/i386/btx/btxldr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 21:52:07 -0000 Author: sobomax Date: Mon Dec 8 21:52:06 2008 New Revision: 185779 URL: http://svn.freebsd.org/changeset/base/185779 Log: Respect RBX_MUTE flag from boot[012]. MFC after: 4 weeks Modified: head/sys/boot/i386/btx/btxldr/btxldr.S Modified: head/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- head/sys/boot/i386/btx/btxldr/btxldr.S Mon Dec 8 21:46:55 2008 (r185778) +++ head/sys/boot/i386/btx/btxldr/btxldr.S Mon Dec 8 21:52:06 2008 (r185779) @@ -15,6 +15,9 @@ * $FreeBSD$ */ +#define RBX_MUTE 0x10 /* -m */ +#define OPT_SET(opt) (1 << (opt)) + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. @@ -64,6 +67,11 @@ * BTX program loader for ELF clients. */ start: cld # String ops inc + leal 0x4(%esp,1),%ebx # First argument + testl $OPT_SET(RBX_MUTE),(%ebx) # check for RBX_MUTE + jz nomute + movb $1,muted +nomute: movl $m_logo,%esi # Identify call putstr # ourselves movzwl BDA_MEM,%eax # Get base memory @@ -288,7 +296,10 @@ putstr: lodsb # Load char /* * Output character AL to the console. */ -putchr: pusha # Save +putchr: testb $1,muted + jz putchr_nm + ret +putchr_nm: pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute movl $BDA_POS,%ebx # BDA pointer @@ -390,6 +401,12 @@ m_segs: .asciz "text segment: offset=" .asciz " memsz=\0\n" m_done: .asciz "Loading complete\n" #endif + +/* + * Flags + */ +muted: .byte 0x0 + /* * Uninitialized data area. */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 23:45:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6914E1065672; Mon, 8 Dec 2008 23:45:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57B8C8FC18; Mon, 8 Dec 2008 23:45:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8Njgdj074169; Mon, 8 Dec 2008 23:45:42 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8Njgvf074168; Mon, 8 Dec 2008 23:45:42 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200812082345.mB8Njgvf074168@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 8 Dec 2008 23:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185780 - head/sys/boot/i386/btx/btxldr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Dec 2008 23:45:42 -0000 Author: sobomax Date: Mon Dec 8 23:45:41 2008 New Revision: 185780 URL: http://svn.freebsd.org/changeset/base/185780 Log: Optimiza assembly in the previous r185779, to save whooping 16 bytes. Submitted by: Christoph Mallon MFC after: 4 weeks (including r185779) Modified: head/sys/boot/i386/btx/btxldr/btxldr.S Modified: head/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- head/sys/boot/i386/btx/btxldr/btxldr.S Mon Dec 8 21:52:06 2008 (r185779) +++ head/sys/boot/i386/btx/btxldr/btxldr.S Mon Dec 8 23:45:41 2008 (r185780) @@ -67,11 +67,8 @@ * BTX program loader for ELF clients. */ start: cld # String ops inc - leal 0x4(%esp,1),%ebx # First argument - testl $OPT_SET(RBX_MUTE),(%ebx) # check for RBX_MUTE - jz nomute - movb $1,muted -nomute: + testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument + setnz muted # for RBX_MUTE, set flag movl $m_logo,%esi # Identify call putstr # ourselves movzwl BDA_MEM,%eax # Get base memory @@ -296,9 +293,8 @@ putstr: lodsb # Load char /* * Output character AL to the console. */ -putchr: testb $1,muted - jz putchr_nm - ret +putchr: testb $1,muted # Check muted + jnz putchr.5 # do a nop putchr_nm: pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute @@ -336,7 +332,7 @@ putchr.3: cmpb $SCR_ROW,%dh # Beyond sc movb $SCR_ROW-1,%dh # Bottom line putchr.4: movw %dx,(%ebx) # Update position popa # Restore - ret # To caller +putchr.5: ret # To caller /* * Convert EAX, AX, or AL to hex, saving the result to [EDI]. */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 00:25:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88041065675; Tue, 9 Dec 2008 00:25:57 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B72718FC0C; Tue, 9 Dec 2008 00:25:57 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB90PvGl074921; Tue, 9 Dec 2008 00:25:57 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB90PvD2074920; Tue, 9 Dec 2008 00:25:57 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200812090025.mB90PvD2074920@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 9 Dec 2008 00:25: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: r185781 - head/sys/boot/i386/btx/btxldr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 00:25:57 -0000 Author: sobomax Date: Tue Dec 9 00:25:57 2008 New Revision: 185781 URL: http://svn.freebsd.org/changeset/base/185781 Log: Remove now unused label. Submitted by: Christoph Mallon MFC after: 4 weeks (along with r185779 and r185780) Modified: head/sys/boot/i386/btx/btxldr/btxldr.S Modified: head/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- head/sys/boot/i386/btx/btxldr/btxldr.S Mon Dec 8 23:45:41 2008 (r185780) +++ head/sys/boot/i386/btx/btxldr/btxldr.S Tue Dec 9 00:25:57 2008 (r185781) @@ -295,7 +295,7 @@ putstr: lodsb # Load char */ putchr: testb $1,muted # Check muted jnz putchr.5 # do a nop -putchr_nm: pusha # Save + pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute movl $BDA_POS,%ebx # BDA pointer From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 01:01:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AADE31065677; Tue, 9 Dec 2008 01:01:02 +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 98BAC8FC18; Tue, 9 Dec 2008 01:01:02 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9112gN075631; Tue, 9 Dec 2008 01:01:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9112IL075629; Tue, 9 Dec 2008 01:01:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812090101.mB9112IL075629@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 9 Dec 2008 01:01: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: r185782 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 01:01:02 -0000 Author: nwhitehorn Date: Tue Dec 9 01:01:02 2008 New Revision: 185782 URL: http://svn.freebsd.org/changeset/base/185782 Log: Add the ability to control the sleep LED with led(4). Adding this fairly useless feature gives us a reasonably complete PMU implementation. Modified: head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/pmuvar.h Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Tue Dec 9 00:25:57 2008 (r185781) +++ head/sys/powerpc/powermac/pmu.c Tue Dec 9 01:01:02 2008 (r185782) @@ -11,8 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -41,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -71,6 +70,7 @@ static u_int pmu_adb_send(device_t dev, static u_int pmu_adb_autopoll(device_t dev, uint16_t mask); static void pmu_poll(device_t dev); +static void pmu_set_sleepled(void *xsc, int onoff); static int pmu_server_mode(SYSCTL_HANDLER_ARGS); static int pmu_query_battery(struct pmu_softc *sc, int batt, struct pmu_battstate *info); @@ -333,6 +333,9 @@ pmu_attach(device_t dev) } sc->sc_autopoll = 0; + sc->sc_batteries = 0; + sc->adb_bus = NULL; + sc->sc_leddev = NULL; /* Init PMU */ @@ -439,6 +442,12 @@ pmu_attach(device_t dev) } } + /* + * Set up LED interface + */ + + sc->sc_leddev = led_create(pmu_set_sleepled, sc, "sleepled"); + return (bus_generic_attach(dev)); } @@ -449,6 +458,9 @@ pmu_detach(device_t dev) sc = device_get_softc(dev); + if (sc->sc_leddev != NULL) + led_destroy(sc->sc_leddev); + bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqrid, sc->sc_irq); bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); @@ -711,6 +723,19 @@ pmu_adb_autopoll(device_t dev, uint16_t return 0; } +static void +pmu_set_sleepled(void *xsc, int onoff) +{ + struct pmu_softc *sc = xsc; + uint8_t cmd[] = {4, 0, 0}; + + cmd[2] = onoff; + + mtx_lock(&sc->sc_mutex); + pmu_send(sc, PMU_SET_SLEEPLED, 3, cmd, 0, NULL); + mtx_unlock(&sc->sc_mutex); +} + static int pmu_server_mode(SYSCTL_HANDLER_ARGS) { Modified: head/sys/powerpc/powermac/pmuvar.h ============================================================================== --- head/sys/powerpc/powermac/pmuvar.h Tue Dec 9 00:25:57 2008 (r185781) +++ head/sys/powerpc/powermac/pmuvar.h Tue Dec 9 01:01:02 2008 (r185782) @@ -11,9 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -76,6 +73,7 @@ #define PMU_I2C_CMD 0x9a /* i2c commands */ #define PMU_GET_LID_STATE 0xdc /* Report lid state */ #define PMU_GET_VERSION 0xea /* Identify thyself */ +#define PMU_SET_SLEEPLED 0xee /* Set sleep LED on/off */ /* Bits in PMU interrupt and interrupt mask bytes */ #define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */ @@ -161,6 +159,7 @@ struct pmu_softc { device_t adb_bus; volatile int sc_autopoll; int sc_batteries; + struct cdev *sc_leddev; }; struct pmu_battstate { From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 02:06:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B78A106564A; Tue, 9 Dec 2008 02:06:03 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 6CAC38FC17; Tue, 9 Dec 2008 02:06:03 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=UTF-8; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) id <0KBL00C004E31E00@smtpauth2.wiscmail.wisc.edu>; Mon, 08 Dec 2008 19:06:03 -0600 (CST) Received: from trantor.tachypleus.net ([76.204.99.187]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPSA id <0KBL0097A4E1MF10@smtpauth2.wiscmail.wisc.edu>; Mon, 08 Dec 2008 19:06:02 -0600 (CST) Date: Mon, 08 Dec 2008 19:07:42 -0600 From: Nathan Whitehorn In-reply-to: <200812090101.mB9112IL075629@svn.freebsd.org> To: Nathan Whitehorn Message-id: <493DC4DE.1090401@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.204.99.187 X-Spam-PmxInfo: Server=avs-12, Version=5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.12.9.4911, SenderIP=76.204.99.187 References: <200812090101.mB9112IL075629@svn.freebsd.org> User-Agent: Thunderbird 2.0.0.17 (X11/20080928) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185782 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 02:06:03 -0000 Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Tue Dec 9 01:01:02 2008 > New Revision: 185782 > URL: http://svn.freebsd.org/changeset/base/185782 > > Log: > Add the ability to control the sleep LED with led(4). Adding this fairly > useless feature gives us a reasonably complete PMU implementation. > > Modified: > head/sys/powerpc/powermac/pmu.c > head/sys/powerpc/powermac/pmuvar.h > As is evident from the actual text of the commit, this also updates the license to 2 clauses to reflect changes in NetBSD. -Nathan From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 04:30:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9262A106564A; Tue, 9 Dec 2008 04:30:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80D5B8FC17; Tue, 9 Dec 2008 04:30:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB94UlXR079918; Tue, 9 Dec 2008 04:30:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB94UlWU079916; Tue, 9 Dec 2008 04:30:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812090430.mB94UlWU079916@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 9 Dec 2008 04:30: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: r185784 - head/sys/dev/sis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 04:30:47 -0000 Author: yongari Date: Tue Dec 9 04:30:47 2008 New Revision: 185784 URL: http://svn.freebsd.org/changeset/base/185784 Log: Fix a long standing VLAN tagged frame handling bug. When VLAN tagged frame is received the hardware sets 'LONG' bit of Rx status word. It is always set when the size of received frame exceeded 1518 bytes, including CRC. This VLAN tagged frame clears 'OK' bit of Rx status word such that driver should not rely on 'OK' bit of Rx status word to pass the VLAN tagged frame to upper stack. To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are configured to accept VLAN tagged frames and the received frame size is less than or equal to maximum allowed length of VLAN tagged frame, clear 'LONG' bit of Rx status word before checking Rx errors. Reported by: Vladimir Ermako < samflanker <> gmail DOT com > Tested by: Vladimir Ermako < samflanker <> gmail DOT com > Modified: head/sys/dev/sis/if_sis.c head/sys/dev/sis/if_sisreg.h Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Tue Dec 9 04:17:44 2008 (r185783) +++ head/sys/dev/sis/if_sis.c Tue Dec 9 04:30:47 2008 (r185784) @@ -1432,7 +1432,11 @@ sis_rxeof(struct sis_softc *sc) * it should simply get re-used next time this descriptor * comes up in the ring. */ - if (!(rxstat & SIS_CMDSTS_PKT_OK)) { + if ((ifp->if_capenable & IFCAP_VLAN_MTU) != 0 && + total_len <= (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - + ETHER_CRC_LEN)) + rxstat &= ~SIS_RXSTAT_GIANT; + if (SIS_RXSTAT_ERROR(rxstat) != 0) { ifp->if_ierrors++; if (rxstat & SIS_RXSTAT_COLL) ifp->if_collisions++; Modified: head/sys/dev/sis/if_sisreg.h ============================================================================== --- head/sys/dev/sis/if_sisreg.h Tue Dec 9 04:17:44 2008 (r185783) +++ head/sys/dev/sis/if_sisreg.h Tue Dec 9 04:30:47 2008 (r185784) @@ -348,6 +348,11 @@ struct sis_desc { #define SIS_RXSTAT_OVERRUN 0x02000000 #define SIS_RXSTAT_RX_ABORT 0x04000000 +#define SIS_RXSTAT_ERROR(x) \ + ((x) & (SIS_RXSTAT_RX_ABORT | SIS_RXSTAT_OVERRUN | \ + SIS_RXSTAT_GIANT | SIS_RXSTAT_SYMBOLERR | SIS_RXSTAT_RUNT | \ + SIS_RXSTAT_CRCERR | SIS_RXSTAT_ALIGNERR)) + #define SIS_DSTCLASS_REJECT 0x00000000 #define SIS_DSTCLASS_UNICAST 0x00800000 #define SIS_DSTCLASS_MULTICAST 0x01000000 From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 07:41:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1495E1065670 for ; Tue, 9 Dec 2008 07:41:32 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by mx1.freebsd.org (Postfix) with ESMTP id D4E128FC16 for ; Tue, 9 Dec 2008 07:41:31 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: by wa-out-1112.google.com with SMTP id m34so730158wag.27 for ; Mon, 08 Dec 2008 23:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=ymezVxnkw9w8LkCMTfSeGB3w1hfCLUUbM9T4sCOcsxA=; b=ZhToSPS7FxPPxKC4KLjRXPDA44qZa96mB/RAlSgTHUpGWMAhcEKa3/foVoNvOqJX0K W7ekpcsF61ni9/9ofIwNGz4SVBo/jHhEqMo2TEiz2qPI0LVNRaDFFjlsVkyatAnI79oz 0JwzYAmYhCilS1SJrvU2fvoHx0DaEmPpD2upY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=wm1lhVPQ/lvsIxefyoGDBDiilPblsAfPgSZnrEe3xVZd0BxPSG3dxzOZpZeQPW1b9V Si7cphrfyt3jdeEJAjG3NPjj4renTbgGadFCArHaLqprlR86zvfEyoWhbYHmnsAYSv2k xHWlBGhf828cEX9qwRxFLJIMsXWQrWz45DoDU= Received: by 10.115.32.1 with SMTP id k1mr3000534waj.66.1228807029076; Mon, 08 Dec 2008 23:17:09 -0800 (PST) Received: by 10.114.106.6 with HTTP; Mon, 8 Dec 2008 23:17:09 -0800 (PST) Message-ID: <5c0ff6a70812082317t15368b3aibcd6df8d13fcab3e@mail.gmail.com> Date: Mon, 8 Dec 2008 23:17:09 -0800 From: "Paul Saab" Sender: paul.m.saab@gmail.com To: "Luigi Rizzo" In-Reply-To: <200812031837.mB3Ib0pb098329@svn.freebsd.org> MIME-Version: 1.0 References: <200812031837.mB3Ib0pb098329@svn.freebsd.org> X-Google-Sender-Auth: f45159064888ac27 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185588 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 07:41:32 -0000 This requires all devices end in 'a' - 'h'. This breaks newfsing zfs volumes with arbitrary names, On Wed, Dec 3, 2008 at 10:37 AM, Luigi Rizzo wrote: > Author: luigi > Date: Wed Dec 3 18:36:59 2008 > New Revision: 185588 > URL: http://svn.freebsd.org/changeset/base/185588 > > Log: > Enable operation of newfs on plain files, which is useful when you > want to prepare disk images for emulators (though 'makefs' in port > can do something similar). > > This relies on: > + minor changes to pass the consistency checks even when working on a > file; > > + an additional option, '-p partition' , to specify the disk partition to > initialize; > > + some changes on the I/O routines to deal with partition offsets. > > The latter was a bit tricky to implement, see the details in newfs.h: > in newfs, I/O is done through libufs which assumes that the file > descriptor refers to the whole partition. Introducing support for > the offset in libufs would require a non-backward compatible change > in the library, to be dealt with a version bump or with symbol > versioning. > > I felt both approaches to be overkill for this specific application, > especially because there might be other changes to libufs that might > become necessary in the near future. > > So I used the following trick: > - read access is always done by calling bread() directly, so we just add > the offset in the (few) places that call bread(); > - write access is done through bwrite() and sbwrite(), which in turn > calls bwrite(). To avoid rewriting sbwrite(), we supply our own version > of bwrite() here, which takes precedence over the version in libufs. > > MFC after: 4 weeks > > Modified: > head/sbin/newfs/Makefile > head/sbin/newfs/mkfs.c > head/sbin/newfs/newfs.8 > head/sbin/newfs/newfs.c > head/sbin/newfs/newfs.h > > Modified: head/sbin/newfs/Makefile > > ============================================================================== > --- head/sbin/newfs/Makefile Wed Dec 3 18:22:36 2008 (r185587) > +++ head/sbin/newfs/Makefile Wed Dec 3 18:36:59 2008 (r185588) > @@ -1,10 +1,13 @@ > # @(#)Makefile 8.2 (Berkeley) 3/27/94 > # $FreeBSD$ > > +.PATH: ${.CURDIR}/../../sys/geom > + > PROG= newfs > DPADD= ${LIBUFS} > LDADD= -lufs > -SRCS= newfs.c mkfs.c > +SRCS= newfs.c mkfs.c geom_bsd_enc.c > + > WARNS?= 2 > MAN= newfs.8 > > > Modified: head/sbin/newfs/mkfs.c > > ============================================================================== > --- head/sbin/newfs/mkfs.c Wed Dec 3 18:22:36 2008 (r185587) > +++ head/sbin/newfs/mkfs.c Wed Dec 3 18:36:59 2008 (r185588) > @@ -459,7 +459,7 @@ mkfs(struct partition *pp, char *fsys) > * Wipe out old UFS1 superblock(s) if necessary. > */ > if (!Nflag && Oflag != 1) { > - i = bread(&disk, SBLOCK_UFS1 / disk.d_bsize, chdummy, > SBLOCKSIZE); > + i = bread(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, > chdummy, SBLOCKSIZE); > if (i == -1) > err(1, "can't read old UFS1 superblock: %s", > disk.d_error); > > @@ -872,7 +872,7 @@ alloc(int size, int mode) > { > int i, d, blkno, frag; > > - bread(&disk, fsbtodb(&sblock, cgtod(&sblock, 0)), (char *)&acg, > + bread(&disk, part_ofs + fsbtodb(&sblock, cgtod(&sblock, 0)), (char > *)&acg, > sblock.fs_cgsize); > if (acg.cg_magic != CG_MAGIC) { > printf("cg 0: bad magic number\n"); > @@ -925,7 +925,7 @@ iput(union dinode *ip, ino_t ino) > int c; > > c = ino_to_cg(&sblock, ino); > - bread(&disk, fsbtodb(&sblock, cgtod(&sblock, 0)), (char *)&acg, > + bread(&disk, part_ofs + fsbtodb(&sblock, cgtod(&sblock, 0)), (char > *)&acg, > sblock.fs_cgsize); > if (acg.cg_magic != CG_MAGIC) { > printf("cg 0: bad magic number\n"); > @@ -942,7 +942,7 @@ iput(union dinode *ip, ino_t ino) > exit(32); > } > d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino)); > - bread(&disk, d, (char *)iobuf, sblock.fs_bsize); > + bread(&disk, part_ofs + d, (char *)iobuf, sblock.fs_bsize); > if (sblock.fs_magic == FS_UFS1_MAGIC) > ((struct ufs1_dinode *)iobuf)[ino_to_fsbo(&sblock, ino)] = > ip->dp1; > > Modified: head/sbin/newfs/newfs.8 > > ============================================================================== > --- head/sbin/newfs/newfs.8 Wed Dec 3 18:22:36 2008 (r185587) > +++ head/sbin/newfs/newfs.8 Wed Dec 3 18:36:59 2008 (r185588) > @@ -52,6 +52,7 @@ > .Op Fl i Ar bytes > .Op Fl m Ar free-space > .Op Fl o Ar optimization > +.Op Fl p Ar partition > .Op Fl r Ar reserved > .Op Fl s Ar size > .Ar special > @@ -201,6 +202,17 @@ the default is to optimize for > See > .Xr tunefs 8 > for more details on how to set this option. > +.It Fl p Ar partition > +The partition name (a..h) you want to use in case the underlying image > +is a file, so you don't have access to individual partitions through the > +filesystem. > +Can also be used with a device, e.g. > +.Nm > +.Fl p Ar f > +.Ar /dev/da1s3 > +is equivalent to > +.Nm > +.Ar /dev/da1s3f . > .It Fl r Ar reserved > The size, in sectors, of reserved space > at the end of the partition specified in > > Modified: head/sbin/newfs/newfs.c > > ============================================================================== > --- head/sbin/newfs/newfs.c Wed Dec 3 18:22:36 2008 (r185587) > +++ head/sbin/newfs/newfs.c Wed Dec 3 18:36:59 2008 (r185588) > @@ -139,6 +139,9 @@ u_char *volumelabel = NULL; /* volume la > struct uufsd disk; /* libufs disk structure */ > > static char device[MAXPATHLEN]; > +static u_char bootarea[BBSIZE]; > +static int is_file; /* work on a file, not a device */ > +static char *dkname; > static char *disktype; > static int unlabeled; > > @@ -147,6 +150,18 @@ static struct disklabel *getdisklabel(ch > static void rewritelabel(char *s, struct disklabel *lp); > static void usage(void); > > +ufs2_daddr_t part_ofs; /* partition offset in blocks, used with files */ > + > +/* > + * need to replace the library's bwrite so that sbwrite uses this one > + */ > +ssize_t > +bwrite(struct uufsd *disk, ufs2_daddr_t blockno, const void *data, size_t > size) > +{ > + return pwrite(disk->d_fd, data, size, > + (off_t)((part_ofs + blockno) * disk->d_bsize)); > +} > + > int > main(int argc, char *argv[]) > { > @@ -158,7 +173,9 @@ main(int argc, char *argv[]) > intmax_t reserved; > int ch, i; > off_t mediasize; > + char part_name; /* partition name, default to full disk */ > > + part_name = 'c'; > reserved = 0; > while ((ch = getopt(argc, argv, > "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:r:s:")) != -1) > @@ -276,6 +293,11 @@ main(int argc, char *argv[]) > *cp != '\0' || reserved < 0) > errx(1, "%s: bad reserved size", optarg); > break; > + case 'p': > + is_file = 1; > + part_name = optarg[0]; > + break; > + > case 's': > errno = 0; > fssize = strtoimax(optarg, &cp, 0); > @@ -294,6 +316,8 @@ main(int argc, char *argv[]) > usage(); > > special = argv[0]; > + if (!special[0]) > + err(1, "empty file/special name"); > cp = strrchr(special, '/'); > if (cp == 0) { > /* > @@ -303,7 +327,16 @@ main(int argc, char *argv[]) > special = device; > } > > - if (ufs_disk_fillout_blank(&disk, special) == -1 || > + if (is_file) { > + /* bypass ufs_disk_fillout_blank */ > + bzero( &disk, sizeof(disk)); > + disk.d_bsize = 1; > + disk.d_name = special; > + disk.d_fd = open(special, O_RDONLY); > + if (disk.d_fd < 0 || > + (!Nflag && ufs_disk_write(&disk) == -1)) > + errx(1, "%s: ", special); > + } else if (ufs_disk_fillout_blank(&disk, special) == -1 || > (!Nflag && ufs_disk_write(&disk) == -1)) { > if (disk.d_error != NULL) > errx(1, "%s: %s", special, disk.d_error); > @@ -312,22 +345,30 @@ main(int argc, char *argv[]) > } > if (fstat(disk.d_fd, &st) < 0) > err(1, "%s", special); > - if ((st.st_mode & S_IFMT) != S_IFCHR) > - errx(1, "%s: not a character-special device", special); > + if ((st.st_mode & S_IFMT) != S_IFCHR) { > + warn("%s: not a character-special device", special); > + is_file = 1; /* assume it is a file */ > + dkname = special; > + if (sectorsize == 0) > + sectorsize = 512; > + mediasize = st.st_size; > + /* set fssize from the partition */ > + } else { > + part_name = special[strlen(special) - 1]; > + if ((part_name < 'a' || part_name > 'h') && > !isdigit(part_name)) > + errx(1, "%s: can't figure out file system partition", > + special); > > - if (sectorsize == 0) > + if (sectorsize == 0) > if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) > - sectorsize = 0; /* back out on error for safety */ > - if (sectorsize && ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize) != > -1) > + sectorsize = 0; /* back out on error for safety */ > + if (sectorsize && ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize) > != -1) > getfssize(&fssize, special, mediasize / sectorsize, > reserved); > + } > pp = NULL; > lp = getdisklabel(special); > if (lp != NULL) { > - cp = strchr(special, '\0'); > - cp--; > - if ((*cp < 'a' || *cp > 'h') && !isdigit(*cp)) > - errx(1, "%s: can't figure out file system > partition", > - special); > + cp = &part_name; > if (isdigit(*cp)) > pp = &lp->d_partitions[RAW_PART]; > else > @@ -346,6 +387,8 @@ main(int argc, char *argv[]) > fsize = pp->p_fsize; > if (bsize == 0) > bsize = pp->p_frag * pp->p_fsize; > + if (is_file) > + part_ofs = pp->p_offset; > } > if (sectorsize <= 0) > errx(1, "%s: no default sector size", special); > @@ -414,6 +457,19 @@ getdisklabel(char *s) > static struct disklabel lab; > struct disklabel *lp; > > + if (is_file) { > + if (read(disk.d_fd, bootarea, BBSIZE) != BBSIZE) > + err(4, "cannot read bootarea"); > + if (bsd_disklabel_le_dec( > + bootarea + (0 /* labeloffset */ + > + 1 /* labelsoffset */ * sectorsize), > + &lab, MAXPARTITIONS)) > + errx(1, "no valid label found"); > + > + lp = &lab; > + return &lab; > + } > + > if (ioctl(disk.d_fd, DIOCGDINFO, (char *)&lab) != -1) > return (&lab); > unlabeled++; > @@ -432,6 +488,14 @@ rewritelabel(char *s, struct disklabel * > return; > lp->d_checksum = 0; > lp->d_checksum = dkcksum(lp); > + if (is_file) { > + bsd_disklabel_le_enc(bootarea + 0 /* labeloffset */ + > + 1 /* labelsoffset */ * sectorsize, lp); > + lseek(disk.d_fd, 0, SEEK_SET); > + if (write(disk.d_fd, bootarea, BBSIZE) != BBSIZE) > + errx(1, "cannot write label"); > + return; > + } > if (ioctl(disk.d_fd, DIOCWDINFO, (char *)lp) == -1) > warn("ioctl (WDINFO): %s: can't rewrite disk label", s); > } > @@ -467,6 +531,7 @@ usage() > fprintf(stderr, "\t-n do not create .snap directory\n"); > fprintf(stderr, "\t-m minimum free space %%\n"); > fprintf(stderr, "\t-o optimization preference (`space' or > `time')\n"); > + fprintf(stderr, "\t-p partition name (a..h)\n"); > fprintf(stderr, "\t-r reserved sectors at the end of device\n"); > fprintf(stderr, "\t-s file system size (sectors)\n"); > exit(1); > > Modified: head/sbin/newfs/newfs.h > > ============================================================================== > --- head/sbin/newfs/newfs.h Wed Dec 3 18:22:36 2008 (r185587) > +++ head/sbin/newfs/newfs.h Wed Dec 3 18:36:59 2008 (r185588) > @@ -70,4 +70,20 @@ extern int avgfilesperdir; /* expected n > extern u_char *volumelabel; /* volume label for filesystem */ > extern struct uufsd disk; /* libufs disk structure */ > > +/* > + * To override a limitation in libufs, export the offset (in sectors) of > the > + * partition on the underlying media (file or disk). The value is used as > + * an offset for all accesses to the media through bread(), which is only > + * invoked directly in this program. > + * For bwrite() we need a different approach, namely override the library > + * version with one defined here. This is because bwrite() is called also > + * by the library function sbwrite() which we cannot intercept nor want to > + * rewrite. As a consequence, the internal version of bwrite() adds the > + * partition offset itself when calling the underlying function, pwrite(). > + * > + * XXX This info really ought to go into the struct uufsd, at which point > + * we can remove the above hack. > + */ > +extern ufs2_daddr_t part_ofs; /* partition offset in blocks */ > + > void mkfs (struct partition *, char *); > From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 08:09:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E7381065673 for ; Tue, 9 Dec 2008 08:09:57 +0000 (UTC) (envelope-from peter@wemm.org) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by mx1.freebsd.org (Postfix) with ESMTP id E7D868FC17 for ; Tue, 9 Dec 2008 08:09:56 +0000 (UTC) (envelope-from peter@wemm.org) Received: by an-out-0708.google.com with SMTP id b6so624590ana.13 for ; Tue, 09 Dec 2008 00:09:55 -0800 (PST) Received: by 10.100.153.6 with SMTP id a6mr2003004ane.76.1228810195430; Tue, 09 Dec 2008 00:09:55 -0800 (PST) Received: by 10.100.211.19 with HTTP; Tue, 9 Dec 2008 00:09:55 -0800 (PST) Message-ID: Date: Tue, 9 Dec 2008 00:09:55 -0800 From: "Peter Wemm" To: "Paul Saab" In-Reply-To: <5c0ff6a70812082317t15368b3aibcd6df8d13fcab3e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812031837.mB3Ib0pb098329@svn.freebsd.org> <5c0ff6a70812082317t15368b3aibcd6df8d13fcab3e@mail.gmail.com> Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r185588 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 08:09:57 -0000 On Mon, Dec 8, 2008 at 11:17 PM, Paul Saab wrote: > This requires all devices end in 'a' - 'h'. This breaks newfsing zfs > volumes with arbitrary names, It also would be wrong in a whole bunch of other scenarios: peter@overcee[12:07AM]~/fbp4-1132> cat /etc/fstab /dev/twed0p2 / ufs rw 1 1 /dev/twed0p3 /usr ufs rw 2 2 ... Also.. 'a' .. 'h' is wrong even for disklabel. If you're using GEOM_PART_BSD, you've got something like 20 partition letters available instead of just 8. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 09:24:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 739C8106564A; Tue, 9 Dec 2008 09:24:25 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 491178FC17; Tue, 9 Dec 2008 09:24:25 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB99OPJW085920; Tue, 9 Dec 2008 09:24:25 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB99OPIc085919; Tue, 9 Dec 2008 09:24:25 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200812090924.mB99OPIc085919@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 9 Dec 2008 09:24: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: r185789 - head/lib/libc/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: Tue, 09 Dec 2008 09:24:25 -0000 Author: maxim Date: Tue Dec 9 09:24:25 2008 New Revision: 185789 URL: http://svn.freebsd.org/changeset/base/185789 Log: o Use full month name in .Dd macro. Modified: head/lib/libc/string/strdup.3 Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Tue Dec 9 06:24:26 2008 (r185788) +++ head/lib/libc/string/strdup.3 Tue Dec 9 09:24:25 2008 (r185789) @@ -28,7 +28,7 @@ .\" @(#)strdup.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd Dec 5, 2008 +.Dd December 5, 2008 .Dt STRDUP 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 09:25:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9189106564A; Tue, 9 Dec 2008 09:25:03 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7DCD8FC28; Tue, 9 Dec 2008 09:25:03 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB99P3Ix085971; Tue, 9 Dec 2008 09:25:03 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB99P36A085969; Tue, 9 Dec 2008 09:25:03 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200812090925.mB99P36A085969@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 9 Dec 2008 09:25: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: r185790 - head/usr.sbin/fifolog/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, 09 Dec 2008 09:25:03 -0000 Author: phk Date: Tue Dec 9 09:25:03 2008 New Revision: 185790 URL: http://svn.freebsd.org/changeset/base/185790 Log: Fix a cornercase during search Modified: head/usr.sbin/fifolog/lib/fifolog_int.c head/usr.sbin/fifolog/lib/fifolog_reader.c Modified: head/usr.sbin/fifolog/lib/fifolog_int.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_int.c Tue Dec 9 09:24:25 2008 (r185789) +++ head/usr.sbin/fifolog/lib/fifolog_int.c Tue Dec 9 09:25:03 2008 (r185790) @@ -221,9 +221,9 @@ fifolog_int_read(const struct fifolog_fi recno++; /* label sector */ i = pread(ff->fd, ff->recbuf, ff->recsize, recno * ff->recsize); if (i < 0) - return (-1); + return (-2); if (i != (int)ff->recsize) - return (-1); + return (-3); return (0); } Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_reader.c Tue Dec 9 09:24:25 2008 (r185789) +++ head/usr.sbin/fifolog/lib/fifolog_reader.c Tue Dec 9 09:25:03 2008 (r185790) @@ -98,7 +98,7 @@ fifolog_reader_findsync(const struct fif assert(*o < ff->logsize); e = fifolog_int_read(ff, *o); if (e) - err(1, "Read error while looking for SYNC"); + err(1, "Read error (%d) while looking for SYNC", e); seq = be32dec(ff->recbuf); if (*o == 0 && seq == 0) return (0); @@ -113,7 +113,7 @@ fifolog_reader_findsync(const struct fif return (2); /* wraparound */ e = fifolog_int_read(ff, *o); if (e) - err(1, "Read error while looking for SYNC"); + err(1, "Read error (%d) while looking for SYNC", e); seqs = be32dec(ff->recbuf); if (seqs != seq) return (3); /* End of log */ @@ -174,8 +174,10 @@ fifolog_reader_seek(const struct fifolog continue; } e = fifolog_int_read(fr->ff, o + st); - if (e) - err(1, "Read error, duing binary search"); + if (e) { + s = st = s / 2; + continue; + } /* If not in same part, sequence won't match */ seqs = be32dec(fr->ff->recbuf); if (seqs != seq + st) { @@ -254,7 +256,7 @@ fifolog_reader_process(struct fifolog_re while (1) { e = fifolog_int_read(fr->ff, o); if (e) - err(1, "Read error"); + err(1, "Read error (%d)", e); if (++o >= fr->ff->logsize) o = 0; seq = be32dec(fr->ff->recbuf); From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 10:21:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658181065672; Tue, 9 Dec 2008 10:21:38 +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 5408E8FC1F; Tue, 9 Dec 2008 10:21:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9ALcwc087142; Tue, 9 Dec 2008 10:21:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9ALcjX087141; Tue, 9 Dec 2008 10:21:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812091021.mB9ALcjX087141@svn.freebsd.org> From: Robert Watson Date: Tue, 9 Dec 2008 10:21: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: r185791 - 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: Tue, 09 Dec 2008 10:21:38 -0000 Author: rwatson Date: Tue Dec 9 10:21:38 2008 New Revision: 185791 URL: http://svn.freebsd.org/changeset/base/185791 Log: Move macros defining flags and shortcus to nested structure fields in inpcbinfo below the structure definition in order to make inpcbinfo fit on a single printed page; related style tweaks. MFC after: pretty soon Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Dec 9 09:25:03 2008 (r185790) +++ head/sys/netinet/in_pcb.h Tue Dec 9 10:21:38 2008 (r185791) @@ -1,6 +1,7 @@ /*- * Copyright (c) 1982, 1986, 1990, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -88,11 +89,11 @@ struct in_endpoints { struct in_addr_4in6 ie46_local; struct in6_addr ie6_local; } ie_dependladdr; +}; #define ie_faddr ie_dependfaddr.ie46_foreign.ia46_addr4 #define ie_laddr ie_dependladdr.ie46_local.ia46_addr4 #define ie6_faddr ie_dependfaddr.ie6_foreign #define ie6_laddr ie_dependladdr.ie6_local -}; /* * XXX The defines for inc_* are hacks and should be changed to direct @@ -152,20 +153,11 @@ struct inpcb { LIST_ENTRY(inpcb) inp_list; /* (i/p) list for all PCBs for proto */ void *inp_ppcb; /* (i) pointer to per-protocol pcb */ struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ - struct socket *inp_socket; /* (i) back pointer to socket */ + struct socket *inp_socket; /* (i) back pointer to socket */ struct ucred *inp_cred; /* (c) cache of socket cred */ - - u_int32_t inp_flow; /* (i) IPv6 flow information */ + u_int32_t inp_flow; /* (i) IPv6 flow information */ int inp_flags; /* (i) generic IP/datagram flags */ - u_char inp_vflag; /* (i) IP version flag (v4/v6) */ -#define INP_IPV4 0x1 -#define INP_IPV6 0x2 -#define INP_IPV6PROTO 0x4 /* opened under IPv6 protocol */ -#define INP_TIMEWAIT 0x8 /* .. probably doesn't go here */ -#define INP_ONESBCAST 0x10 /* send all-ones broadcast */ -#define INP_DROPPED 0x20 /* protocol drop flag */ -#define INP_SOCKREF 0x40 /* strong socket reference */ u_char inp_ip_ttl; /* (i) time to live proto */ u_char inp_ip_p; /* (c) protocol proto */ u_char inp_ip_minttl; /* (i) minimum TTL or drop */ @@ -174,9 +166,9 @@ struct inpcb { void *inp_pspare[2]; /* (x) rtentry / general use */ /* Local and foreign ports, local and foreign addr. */ - struct in_conninfo inp_inc; + struct in_conninfo inp_inc; /* (i/p) list for PCB's local port */ - /* (i/p) list for PCB's local port */ + /* MAC and IPSEC policy information. */ struct label *inp_label; /* (i) MAC label */ struct inpcbpolicy *inp_sp; /* (s) for IPSEC */ @@ -184,15 +176,8 @@ struct inpcb { struct { u_char inp4_ip_tos; /* (i) type of service proto */ struct mbuf *inp4_options; /* (i) IP options */ - struct ip_moptions *inp4_moptions; /* (i) IP multicast options */ + struct ip_moptions *inp4_moptions; /* (i) IP mcast options */ } inp_depend4; -#define inp_fport inp_inc.inc_fport -#define inp_lport inp_inc.inc_lport -#define inp_faddr inp_inc.inc_faddr -#define inp_laddr inp_inc.inc_laddr -#define inp_ip_tos inp_depend4.inp4_ip_tos -#define inp_options inp_depend4.inp4_options -#define inp_moptions inp_depend4.inp4_moptions struct { /* (i) IP options */ struct mbuf *inp6_options; @@ -209,8 +194,16 @@ struct inpcb { LIST_ENTRY(inpcb) inp_portlist; /* (i/p) */ struct inpcbport *inp_phd; /* (i/p) head of this list */ #define inp_zero_size offsetof(struct inpcb, inp_gencnt) - inp_gen_t inp_gencnt; /* (c) generation count of this instance */ + inp_gen_t inp_gencnt; /* (c) generation count */ struct rwlock inp_lock; +}; +#define inp_fport inp_inc.inc_fport +#define inp_lport inp_inc.inc_lport +#define inp_faddr inp_inc.inc_faddr +#define inp_laddr inp_inc.inc_laddr +#define inp_ip_tos inp_depend4.inp4_ip_tos +#define inp_options inp_depend4.inp4_options +#define inp_moptions inp_depend4.inp4_moptions #define in6p_faddr inp_inc.inc6_faddr #define in6p_laddr inp_inc.inc6_laddr @@ -228,7 +221,7 @@ struct inpcb { #define in6p_lport inp_lport /* for KAME src sync over BSD*'s */ #define in6p_fport inp_fport /* for KAME src sync over BSD*'s */ #define in6p_ppcb inp_ppcb /* for KAME src sync over BSD*'s */ -}; + /* * The range of the generation count, as used in this implementation, is 9e19. * We would have to create 300 billion connections per second for this number @@ -384,7 +377,22 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_PCBPORTHASH(lport, mask) \ (ntohs((lport)) & (mask)) -/* flags in inp_flags: */ +/* + * Flags for inp_vflags -- historically version flags only, but now quite a + * bit more due to an overflow of inp_flag, leading to some locking ambiguity + * as some bits are stable from initial allocation, and others may change. + */ +#define INP_IPV4 0x1 +#define INP_IPV6 0x2 +#define INP_IPV6PROTO 0x4 /* opened under IPv6 protocol */ +#define INP_TIMEWAIT 0x8 /* .. probably doesn't go here */ +#define INP_ONESBCAST 0x10 /* send all-ones broadcast */ +#define INP_DROPPED 0x20 /* protocol drop flag */ +#define INP_SOCKREF 0x40 /* strong socket reference */ + +/* + * Flags for inp_flag. + */ #define INP_RECVOPTS 0x01 /* receive incoming IP options */ #define INP_RECVRETOPTS 0x02 /* receive IP options for reply */ #define INP_RECVDSTADDR 0x04 /* receive IP dst address */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 15:49:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01CF1106564A; Tue, 9 Dec 2008 15:49:03 +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 E526C8FC1F; Tue, 9 Dec 2008 15:49:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9Fn27g094679; Tue, 9 Dec 2008 15:49:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9Fn2Pb094678; Tue, 9 Dec 2008 15:49:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812091549.mB9Fn2Pb094678@svn.freebsd.org> From: Robert Watson Date: Tue, 9 Dec 2008 15:49: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: r185795 - 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: Tue, 09 Dec 2008 15:49:03 -0000 Author: rwatson Date: Tue Dec 9 15:49:02 2008 New Revision: 185795 URL: http://svn.freebsd.org/changeset/base/185795 Log: Enhance one comment relating to recent TCP locking changes, and fix a typo in another. MFC after: 6 weeks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Dec 9 14:56:39 2008 (r185794) +++ head/sys/netinet/tcp_input.c Tue Dec 9 15:49:02 2008 (r185795) @@ -480,11 +480,11 @@ tcp_input(struct mbuf *m, int off0) /* * Locate pcb for segment, which requires a lock on tcbinfo. - * Optimisticaly acquire a global read lock unless header flags - * necessarily imply a state change. There are two cases where we - * might discover later we need a write lock despite the flags: ACKs - * moving a connection out of the syncache, and ACK relating to a - * connection in TIMEWAIT. + * Optimisticaly acquire a global read lock rather than a write lock + * unless header flags necessarily imply a state change. There are + * two cases where we might discover later we need a write lock + * despite the flags: ACKs moving a connection out of the syncache, + * and ACKs for a connection in TIMEWAIT. */ if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || tcp_read_locking == 0) { @@ -1087,7 +1087,7 @@ tcp_do_segment(struct mbuf *m, struct tc * allow either a read lock or a write lock, as we may have acquired * a write lock due to a race. * - * Require a global write lock for SYN/SIN/RST segments or + * Require a global write lock for SYN/FIN/RST segments or * non-established connections; otherwise accept either a read or * write lock, as we may have conservatively acquired a write lock in * certain cases in tcp_input() (is this still true?). Currently we From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 18:00:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F058106567E; Tue, 9 Dec 2008 18:00:55 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3558FC28; Tue, 9 Dec 2008 18:00:54 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0DFB06D43F; Tue, 9 Dec 2008 18:00:54 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id E72E9844BD; Tue, 9 Dec 2008 19:00:53 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Konstantin Belousov References: <200812081315.mB8DFVMk061023@svn.freebsd.org> Date: Tue, 09 Dec 2008 19:00:53 +0100 In-Reply-To: <200812081315.mB8DFVMk061023@svn.freebsd.org> (Konstantin Belousov's message of "Mon, 8 Dec 2008 13:15:31 +0000 (UTC)") Message-ID: <86oczlxm7e.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185766 - in head/sys: compat/linprocfs fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 18:00:55 -0000 Konstantin Belousov writes: > Log: > Make two style changes to create new commit and document proper commit > message for r185765. Thank you! DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 19:44:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24D5C1065672; Tue, 9 Dec 2008 19:44:54 +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 151FD8FC18; Tue, 9 Dec 2008 19:44:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9Jir1l099893; Tue, 9 Dec 2008 19:44:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9JirJ6099892; Tue, 9 Dec 2008 19:44:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812091944.mB9JirJ6099892@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 9 Dec 2008 19:44: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: r185807 - 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: Tue, 09 Dec 2008 19:44:54 -0000 Author: bz Date: Tue Dec 9 19:44:53 2008 New Revision: 185807 URL: http://svn.freebsd.org/changeset/base/185807 Log: Fix a bug introduced in r185747: rather than dereferencing an uninitialized *rt to something undefined, use the fibnum that came in as function argument. Found with: Coverity Prevent(tm) CID: 4168 Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Dec 9 19:36:50 2008 (r185806) +++ head/sys/net/route.c Tue Dec 9 19:44:53 2008 (r185807) @@ -513,7 +513,7 @@ rtredirect_fib(struct sockaddr *dst, struct rt_addrinfo info; struct ifaddr *ifa; struct radix_node_head *rnh = - V_rt_tables[rt->rt_fibnum][dst->sa_family]; + V_rt_tables[fibnum][dst->sa_family]; /* verify the gateway is directly reachable */ if ((ifa = ifa_ifwithnet(gateway)) == NULL) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 20:05:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E0571065670; Tue, 9 Dec 2008 20:05:58 +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 4E6AA8FC08; Tue, 9 Dec 2008 20:05:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9K5w4w000461; Tue, 9 Dec 2008 20:05:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9K5wCr000460; Tue, 9 Dec 2008 20:05:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812092005.mB9K5wCr000460@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 9 Dec 2008 20:05: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: r185808 - 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: Tue, 09 Dec 2008 20:05:58 -0000 Author: bz Date: Tue Dec 9 20:05:58 2008 New Revision: 185808 URL: http://svn.freebsd.org/changeset/base/185808 Log: Add rwlock.h (and lock.h for that) to keep no-INET kernels compiling after RADIX_NODE_HEAD_{,UN}LOCK() were added. Must have been "learned" by pollution before (most likely: route.h -> radix.h -> rwlock.h) Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Dec 9 19:44:53 2008 (r185807) +++ head/sys/net/if.c Tue Dec 9 20:05:58 2008 (r185808) @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 21:09:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7B6B1065672; Tue, 9 Dec 2008 21:09:05 +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 8E2CF8FC1B; Tue, 9 Dec 2008 21:09:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9L950W001795; Tue, 9 Dec 2008 21:09:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9L95BG001794; Tue, 9 Dec 2008 21:09:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812092109.mB9L95BG001794@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 9 Dec 2008 21: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: r185810 - 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: Tue, 09 Dec 2008 21:09:05 -0000 Author: bz Date: Tue Dec 9 21:09:05 2008 New Revision: 185810 URL: http://svn.freebsd.org/changeset/base/185810 Log: It does not make much sense to include net/route.h twice. Remove one #include. Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Dec 9 20:59:55 2008 (r185809) +++ head/sys/net/if.c Tue Dec 9 21:09:05 2008 (r185810) @@ -1343,8 +1343,6 @@ done: return (ifa); } -#include - /* * Default action when installing a route with a Link Level gateway. * Lookup an appropriate real ifa to point to. From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 21:26:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2F01065672; Tue, 9 Dec 2008 21:26:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 39EE98FC1E; Tue, 9 Dec 2008 21:26:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mB9LPpFt014957; Tue, 9 Dec 2008 16:25:57 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Kostik Belousov Date: Tue, 9 Dec 2008 16:00:30 -0500 User-Agent: KMail/1.9.7 References: <200812071325.mB7DP64P026630@svn.freebsd.org> <200812081141.39800.jhb@freebsd.org> <20081208194229.GX2038@deviant.kiev.zoral.com.ua> In-Reply-To: <20081208194229.GX2038@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812091600.30942.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 09 Dec 2008 16:25:57 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8738/Tue Dec 9 14:31:40 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185739 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 21:26:03 -0000 On Monday 08 December 2008 02:42:29 pm Kostik Belousov wrote: > On Mon, Dec 08, 2008 at 11:41:39AM -0500, John Baldwin wrote: > > On Sunday 07 December 2008 08:25:06 am Konstantin Belousov wrote: > > > Author: kib > > > Date: Sun Dec 7 13:25:06 2008 > > > New Revision: 185739 > > > URL: http://svn.freebsd.org/changeset/base/185739 > > > > > > Log: > > > Improve usefulness of the panic by printing the pointer to the problematic > > > dquot. In-tree gdb is often unable to get the dq value, so supply it in > > > panic message. > > > > Even in userland I find gdb to be an epic fail for handling local > > variables if inlined functions are involved. I haven't tried a newer > > gdb from ports to see if it fares better in that case. > > I have locally built 6.8 exactly for this purposes, made by configure;make. > I can confirm that its dwarf handling is _much_ better then in-tree gdb. Hmm, I wonder what it would take to update our in-tree gdb. Is 6.8 gplv3? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 21:34:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC5281065677; Tue, 9 Dec 2008 21:34:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAF568FC08; Tue, 9 Dec 2008 21:34:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9LYM3Z002371; Tue, 9 Dec 2008 21:34:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9LYM2J002370; Tue, 9 Dec 2008 21:34:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200812092134.mB9LYM2J002370@svn.freebsd.org> From: Marius Strobl Date: Tue, 9 Dec 2008 21:34: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: r185812 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Dec 2008 21:34:23 -0000 Author: marius Date: Tue Dec 9 21:34:22 2008 New Revision: 185812 URL: http://svn.freebsd.org/changeset/base/185812 Log: - Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which causes data corruption in combination with certain bridges. Information about this problem was kindly provided by davidch. [1] - As BGE_FLAG_PCIX is meant to indicate that the controller is in PCI-X mode, revert to the pre __FreeBSD_version 602101 method of reading the bus mode register rather than checking the mere existence of a PCI-X capability, which is also there when the NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC to be tuned incorrectly. PR: 128833 [1] Reviewed by: jhb MFC after: 3 days Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Dec 9 21:10:09 2008 (r185811) +++ head/sys/dev/bge/if_bge.c Tue Dec 9 21:34:22 2008 (r185812) @@ -1370,6 +1370,16 @@ bge_chipinit(struct bge_softc *sc) BGE_MODECTL_TX_NO_PHDR_CSUM); /* + * BCM5701 B5 have a bug causing data corruption when using + * 64-bit DMA reads, which can be terminated early and then + * completed later as 32-bit accesses, in combination with + * certain bridges. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5701 && + sc->bge_chipid == BGE_CHIPID_BCM5701_B5) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_FORCE_PCI32); + + /* * Tell the firmware the driver is running */ if (sc->bge_asf_mode & ASF_STACKUP) @@ -2462,26 +2472,21 @@ bge_attach(device_t dev) */ if (reg != 0) sc->bge_flags |= BGE_FLAG_PCIE; - } else if (pci_find_extcap(dev, PCIY_PCIX, ®) == 0) { - if (reg != 0) - sc->bge_flags |= BGE_FLAG_PCIX; - } - #else if (BGE_IS_5705_PLUS(sc)) { reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); if ((reg & 0xFF) == BGE_PCIE_CAPID) sc->bge_flags |= BGE_FLAG_PCIE; +#endif } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ - if ((pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE, 4) & + if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) & BGE_PCISTATE_PCI_BUSMODE) == 0) sc->bge_flags |= BGE_FLAG_PCIX; } -#endif #if __FreeBSD_version > 602105 { From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 21:41:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 307361065676; Tue, 9 Dec 2008 21:41:56 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0C88FC1A; Tue, 9 Dec 2008 21:41:56 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.3/8.14.3) with ESMTP id mB9LftG1078795; Tue, 9 Dec 2008 13:41:55 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.3/8.14.3/Submit) id mB9Lftl7078794; Tue, 9 Dec 2008 13:41:55 -0800 (PST) (envelope-from sgk) Date: Tue, 9 Dec 2008 13:41:55 -0800 From: Steve Kargl To: John Baldwin Message-ID: <20081209214155.GA78604@troutmask.apl.washington.edu> References: <200812071325.mB7DP64P026630@svn.freebsd.org> <200812081141.39800.jhb@freebsd.org> <20081208194229.GX2038@deviant.kiev.zoral.com.ua> <200812091600.30942.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812091600.30942.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185739 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 21:41:56 -0000 On Tue, Dec 09, 2008 at 04:00:30PM -0500, John Baldwin wrote: > > Hmm, I wonder what it would take to update our in-tree gdb. Is 6.8 gplv3? > gdb-6.8 distribution includes COPYING3 and COPYING3.LIB. grep "either version 3" *.[ch] amd64fbsd-nat.c: the Free Software Foundation; either version 3 of the License, or amd64fbsd-tdep.c: the Free Software Foundation; either version 3 of the License, or -- Steve From owner-svn-src-head@FreeBSD.ORG Tue Dec 9 23:57:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C16E31065672; Tue, 9 Dec 2008 23:57:09 +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 AD07B8FC12; Tue, 9 Dec 2008 23:57:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9Nv9Jp004939; Tue, 9 Dec 2008 23:57:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9Nv9JI004938; Tue, 9 Dec 2008 23:57:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812092357.mB9Nv9JI004938@svn.freebsd.org> From: Robert Watson Date: Tue, 9 Dec 2008 23:57: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: r185813 - 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: Tue, 09 Dec 2008 23:57:09 -0000 Author: rwatson Date: Tue Dec 9 23:57:09 2008 New Revision: 185813 URL: http://svn.freebsd.org/changeset/base/185813 Log: Update comment on INP_TIMEWAIT to say what it's about, as we caution regarding the misplacement of flags in inp_vflag in an earlier comment. MFC after: pretty soon Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Dec 9 21:34:22 2008 (r185812) +++ head/sys/netinet/in_pcb.h Tue Dec 9 23:57:09 2008 (r185813) @@ -385,7 +385,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_IPV4 0x1 #define INP_IPV6 0x2 #define INP_IPV6PROTO 0x4 /* opened under IPv6 protocol */ -#define INP_TIMEWAIT 0x8 /* .. probably doesn't go here */ +#define INP_TIMEWAIT 0x8 /* inpcb in TIMEWAIT, ppcb is tcptw */ #define INP_ONESBCAST 0x10 /* send all-ones broadcast */ #define INP_DROPPED 0x20 /* protocol drop flag */ #define INP_SOCKREF 0x40 /* strong socket reference */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 02:32:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D871065672; Wed, 10 Dec 2008 02:32:06 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3DCA8FC08; Wed, 10 Dec 2008 02:32:06 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA2W6Gi010402; Wed, 10 Dec 2008 02:32:06 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA2W6i0010401; Wed, 10 Dec 2008 02:32:06 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200812100232.mBA2W6i0010401@svn.freebsd.org> From: David Schultz Date: Wed, 10 Dec 2008 02:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185825 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Dec 2008 02:32:07 -0000 Author: das Date: Wed Dec 10 02:32:06 2008 New Revision: 185825 URL: http://svn.freebsd.org/changeset/base/185825 Log: Move the xprintf hook to where it belongs; it shouldn't be in the middle of vfprintf's variable declarations. Modified: head/lib/libc/stdio/vfprintf.c Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Wed Dec 10 02:24:50 2008 (r185824) +++ head/lib/libc/stdio/vfprintf.c Wed Dec 10 02:32:06 2008 (r185825) @@ -396,12 +396,6 @@ __vfprintf(FILE *fp, const char *fmt0, v char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ - - if (__use_xprintf == 0 && getenv("USE_XPRINTF")) - __use_xprintf = 1; - if (__use_xprintf > 0) - return (__xvprintf(fp, fmt0, ap)); - #ifndef NO_FLOATING_POINT /* * We can decompose the printed representation of floating @@ -568,6 +562,10 @@ __vfprintf(FILE *fp, const char *fmt0, v val = GETARG (int); \ } + if (__use_xprintf == 0 && getenv("USE_XPRINTF")) + __use_xprintf = 1; + if (__use_xprintf > 0) + return (__xvprintf(fp, fmt0, ap)); thousands_sep = '\0'; grouping = NULL; From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 08:22:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B852B1065677; Wed, 10 Dec 2008 08:22:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A45C38FC17; Wed, 10 Dec 2008 08:22:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA8Mp3W023108; Wed, 10 Dec 2008 08:22:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA8MpI1023107; Wed, 10 Dec 2008 08:22:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100822.mBA8MpI1023107@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 08:22: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: r185844 - 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, 10 Dec 2008 08:22:51 -0000 Author: kmacy Date: Wed Dec 10 08:22:51 2008 New Revision: 185844 URL: http://svn.freebsd.org/changeset/base/185844 Log: don't reference if_addr_mtx directly Modified: head/sys/netinet/ip_fw_nat.c Modified: head/sys/netinet/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ip_fw_nat.c Wed Dec 10 08:01:10 2008 (r185843) +++ head/sys/netinet/ip_fw_nat.c Wed Dec 10 08:22:51 2008 (r185844) @@ -91,7 +91,7 @@ ifaddr_change(void *arg __unused, struct LIST_FOREACH(ptr, &V_layer3_chain.nat, _next) { /* ...using nic 'ifp->if_xname' as dynamic alias address. */ if (strncmp(ptr->if_name, ifp->if_xname, IF_NAMESIZE) == 0) { - mtx_lock(&ifp->if_addr_mtx); + IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { if (ifa->ifa_addr == NULL) continue; @@ -101,7 +101,7 @@ ifaddr_change(void *arg __unused, struct (ifa->ifa_addr))->sin_addr; LibAliasSetAddress(ptr->lib, ptr->ip); } - mtx_unlock(&ifp->if_addr_mtx); + IF_ADDR_LOCK(ifp); } } IPFW_WUNLOCK(&V_layer3_chain); From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 08:23:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F03C1065672; Wed, 10 Dec 2008 08:23:48 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7CC8FC19; Wed, 10 Dec 2008 08:23:48 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA8NmDO023169; Wed, 10 Dec 2008 08:23:48 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA8NmKh023168; Wed, 10 Dec 2008 08:23:48 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100823.mBA8NmKh023168@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 08:23: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: r185845 - 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, 10 Dec 2008 08:23:48 -0000 Author: kmacy Date: Wed Dec 10 08:23:47 2008 New Revision: 185845 URL: http://svn.freebsd.org/changeset/base/185845 Log: unlock when done Modified: head/sys/netinet/ip_fw_nat.c Modified: head/sys/netinet/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ip_fw_nat.c Wed Dec 10 08:22:51 2008 (r185844) +++ head/sys/netinet/ip_fw_nat.c Wed Dec 10 08:23:47 2008 (r185845) @@ -101,7 +101,7 @@ ifaddr_change(void *arg __unused, struct (ifa->ifa_addr))->sin_addr; LibAliasSetAddress(ptr->lib, ptr->ip); } - IF_ADDR_LOCK(ifp); + IF_ADDR_UNLOCK(ifp); } } IPFW_WUNLOCK(&V_layer3_chain); From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 09:21:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BF721065673; Wed, 10 Dec 2008 09:21:52 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A0C28FC13; Wed, 10 Dec 2008 09:21:52 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA9Lq7X024438; Wed, 10 Dec 2008 09:21:52 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA9LqtA024436; Wed, 10 Dec 2008 09:21:52 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100921.mBA9LqtA024436@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 09:21: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: r185849 - 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: Wed, 10 Dec 2008 09:21:52 -0000 Author: kmacy Date: Wed Dec 10 09:21:52 2008 New Revision: 185849 URL: http://svn.freebsd.org/changeset/base/185849 Log: fix a reported panic when adding a route and one hit here when deleting a route - pass RTF_RNH_LOCKED to rtalloc1_fib in 2 cases where the lock is held - make sure the rnh lock is held across rt_setgate and rt_getifa_fib Modified: head/sys/net/route.c head/sys/net/rtsock.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Dec 10 08:55:12 2008 (r185848) +++ head/sys/net/route.c Wed Dec 10 09:21:52 2008 (r185849) @@ -680,7 +680,7 @@ ifa_ifwithroute_fib(int flags, struct so if (ifa == NULL) ifa = ifa_ifwithnet(gateway); if (ifa == NULL) { - struct rtentry *rt = rtalloc1_fib(gateway, 0, 0UL, fibnum); + struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) return (NULL); /* @@ -1161,7 +1161,7 @@ deldone: * then we just blow it away and retry the insertion * of the new one. */ - rt2 = rtalloc1_fib(dst, 0, 0, fibnum); + rt2 = rtalloc1_fib(dst, 0, RTF_RNH_LOCKED, fibnum); if (rt2 && rt2->rt_parent) { rtexpunge(rt2); RT_UNLOCK(rt2); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Dec 10 08:55:12 2008 (r185848) +++ head/sys/net/rtsock.c Wed Dec 10 09:21:52 2008 (r185849) @@ -672,9 +672,11 @@ route_output(struct mbuf *m, struct sock !sa_equal(info.rti_info[RTAX_IFA], rt->rt_ifa->ifa_addr))) { RT_UNLOCK(rt); + RADIX_NODE_HEAD_LOCK(rnh); if ((error = rt_getifa_fib(&info, rt->rt_fibnum)) != 0) senderr(error); + RADIX_NODE_HEAD_UNLOCK(rnh); RT_LOCK(rt); } if (info.rti_ifa != NULL && @@ -686,8 +688,14 @@ route_output(struct mbuf *m, struct sock IFAFREE(rt->rt_ifa); } if (info.rti_info[RTAX_GATEWAY] != NULL) { - if ((error = rt_setgate(rt, rt_key(rt), - info.rti_info[RTAX_GATEWAY])) != 0) { + RT_UNLOCK(rt); + RADIX_NODE_HEAD_LOCK(rnh); + RT_LOCK(rt); + + error = rt_setgate(rt, rt_key(rt), + info.rti_info[RTAX_GATEWAY]); + RADIX_NODE_HEAD_UNLOCK(rnh); + if (error != 0) { RT_UNLOCK(rt); senderr(error); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 10:46:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B45471065680; Wed, 10 Dec 2008 10:46:34 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4FA78FC1B; Wed, 10 Dec 2008 10:46:34 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAAkYH5026189; Wed, 10 Dec 2008 10:46:34 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAAkYk5026188; Wed, 10 Dec 2008 10:46:34 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812101046.mBAAkYk5026188@svn.freebsd.org> From: Doug Rabson Date: Wed, 10 Dec 2008 10:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185852 - head/sys/boot/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: Wed, 10 Dec 2008 10:46:34 -0000 Author: dfr Date: Wed Dec 10 10:46:34 2008 New Revision: 185852 URL: http://svn.freebsd.org/changeset/base/185852 Log: Don't get confused if we encounter a device which is part of a raidz or raidz2 pool while probing for vdevs. PR: 129539 Submitted by: Paul Wootton (paul at fletchermoorland dot co dot uk) Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Dec 10 10:21:54 2008 (r185851) +++ head/sys/boot/zfs/zfsimpl.c Wed Dec 10 10:46:34 2008 (r185852) @@ -623,7 +623,7 @@ vdev_probe(vdev_read_t *read, void *read uint64_t pool_txg, pool_guid; const char *pool_name; const unsigned char *vdevs; - int i; + int i, rc; char upbuf[1024]; const struct uberblock *up; @@ -723,7 +723,9 @@ vdev_probe(vdev_read_t *read, void *read DATA_TYPE_NVLIST, 0, &vdevs)) { return (EIO); } - vdev_init_from_nvlist(vdevs, &top_vdev); + rc = vdev_init_from_nvlist(vdevs, &top_vdev); + if (rc) + return (rc); /* * Add the toplevel vdev to the pool if its not already there. From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 11:03:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA8441065676; Wed, 10 Dec 2008 11:03: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 DB1EA8FC1A; Wed, 10 Dec 2008 11:03:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAB3Ghq028619; Wed, 10 Dec 2008 11:03:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAB3Gui028618; Wed, 10 Dec 2008 11:03:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812101103.mBAB3Gui028618@svn.freebsd.org> From: Robert Watson Date: Wed, 10 Dec 2008 11:03: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: r185855 - 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, 10 Dec 2008 11:03:17 -0000 Author: rwatson Date: Wed Dec 10 11:03:16 2008 New Revision: 185855 URL: http://svn.freebsd.org/changeset/base/185855 Log: Move flag definitions for t_flags and t_oobflags below the definition of struct tcpcb so that the structure definition is a bit more vertically compact. Can't yet fit it on one printed page, though. MFC after: pretty soon Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Dec 10 10:50:19 2008 (r185854) +++ head/sys/netinet/tcp_var.h Wed Dec 10 11:03:16 2008 (r185855) @@ -101,32 +101,6 @@ struct tcpcb { struct inpcb *t_inpcb; /* back pointer to internet pcb */ int t_state; /* state of this connection */ u_int t_flags; -#define TF_ACKNOW 0x000001 /* ack peer immediately */ -#define TF_DELACK 0x000002 /* ack, but try to delay it */ -#define TF_NODELAY 0x000004 /* don't delay packets to coalesce */ -#define TF_NOOPT 0x000008 /* don't use tcp options */ -#define TF_SENTFIN 0x000010 /* have sent FIN */ -#define TF_REQ_SCALE 0x000020 /* have/will request window scaling */ -#define TF_RCVD_SCALE 0x000040 /* other side has requested scaling */ -#define TF_REQ_TSTMP 0x000080 /* have/will request timestamps */ -#define TF_RCVD_TSTMP 0x000100 /* a timestamp was received in SYN */ -#define TF_SACK_PERMIT 0x000200 /* other side said I could SACK */ -#define TF_NEEDSYN 0x000400 /* send SYN (implicit state) */ -#define TF_NEEDFIN 0x000800 /* send FIN (implicit state) */ -#define TF_NOPUSH 0x001000 /* don't push */ -#define TF_MORETOCOME 0x010000 /* More data to be appended to sock */ -#define TF_LQ_OVERFLOW 0x020000 /* listen queue overflow */ -#define TF_LASTIDLE 0x040000 /* connection was previously idle */ -#define TF_RXWIN0SENT 0x080000 /* sent a receiver win 0 in response */ -#define TF_FASTRECOVERY 0x100000 /* in NewReno Fast Recovery */ -#define TF_WASFRECOVERY 0x200000 /* was in NewReno Fast Recovery */ -#define TF_SIGNATURE 0x400000 /* require MD5 digests (RFC2385) */ -#define TF_FORCEDATA 0x800000 /* force out a byte */ -#define TF_TSO 0x1000000 /* TSO enabled on this connection */ -#define TF_TOE 0x2000000 /* this connection is offloaded */ -#define TF_ECN_PERMIT 0x4000000 /* connection ECN-ready */ -#define TF_ECN_SND_CWR 0x8000000 /* ECN CWR in queue */ -#define TF_ECN_SND_ECE 0x10000000 /* ECN ECE in queue */ tcp_seq snd_una; /* send unacknowledged */ tcp_seq snd_max; /* highest sequence number sent; @@ -180,8 +154,6 @@ struct tcpcb { /* out-of-band data */ char t_oobflags; /* have some */ char t_iobc; /* input character */ -#define TCPOOB_HAVEDATA 0x01 -#define TCPOOB_HADDATA 0x02 /* RFC 1323 variables */ u_char snd_scale; /* window scaling for send window */ u_char rcv_scale; /* window scaling for recv window */ @@ -215,10 +187,46 @@ struct tcpcb { void *t_toe; /* TOE pcb pointer */ }; +/* + * Flags and utility macros for the t_flags field. + */ +#define TF_ACKNOW 0x000001 /* ack peer immediately */ +#define TF_DELACK 0x000002 /* ack, but try to delay it */ +#define TF_NODELAY 0x000004 /* don't delay packets to coalesce */ +#define TF_NOOPT 0x000008 /* don't use tcp options */ +#define TF_SENTFIN 0x000010 /* have sent FIN */ +#define TF_REQ_SCALE 0x000020 /* have/will request window scaling */ +#define TF_RCVD_SCALE 0x000040 /* other side has requested scaling */ +#define TF_REQ_TSTMP 0x000080 /* have/will request timestamps */ +#define TF_RCVD_TSTMP 0x000100 /* a timestamp was received in SYN */ +#define TF_SACK_PERMIT 0x000200 /* other side said I could SACK */ +#define TF_NEEDSYN 0x000400 /* send SYN (implicit state) */ +#define TF_NEEDFIN 0x000800 /* send FIN (implicit state) */ +#define TF_NOPUSH 0x001000 /* don't push */ +#define TF_MORETOCOME 0x010000 /* More data to be appended to sock */ +#define TF_LQ_OVERFLOW 0x020000 /* listen queue overflow */ +#define TF_LASTIDLE 0x040000 /* connection was previously idle */ +#define TF_RXWIN0SENT 0x080000 /* sent a receiver win 0 in response */ +#define TF_FASTRECOVERY 0x100000 /* in NewReno Fast Recovery */ +#define TF_WASFRECOVERY 0x200000 /* was in NewReno Fast Recovery */ +#define TF_SIGNATURE 0x400000 /* require MD5 digests (RFC2385) */ +#define TF_FORCEDATA 0x800000 /* force out a byte */ +#define TF_TSO 0x1000000 /* TSO enabled on this connection */ +#define TF_TOE 0x2000000 /* this connection is offloaded */ +#define TF_ECN_PERMIT 0x4000000 /* connection ECN-ready */ +#define TF_ECN_SND_CWR 0x8000000 /* ECN CWR in queue */ +#define TF_ECN_SND_ECE 0x10000000 /* ECN ECE in queue */ + #define IN_FASTRECOVERY(tp) (tp->t_flags & TF_FASTRECOVERY) #define ENTER_FASTRECOVERY(tp) tp->t_flags |= TF_FASTRECOVERY #define EXIT_FASTRECOVERY(tp) tp->t_flags &= ~TF_FASTRECOVERY +/* + * Flags for the t_oobflags field. + */ +#define TCPOOB_HAVEDATA 0x01 +#define TCPOOB_HADDATA 0x02 + #ifdef TCP_SIGNATURE /* * Defines which are needed by the xform_tcp module and tcp_[in|out]put From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 11:11:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8E5C1065676; Wed, 10 Dec 2008 11:11:43 +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 A0F338FC13; Wed, 10 Dec 2008 11:11:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBABBhVd028962; Wed, 10 Dec 2008 11:11:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBABBhYJ028961; Wed, 10 Dec 2008 11:11:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812101111.mBABBhYJ028961@svn.freebsd.org> From: Robert Watson Date: Wed, 10 Dec 2008 11:11: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: r185857 - 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, 10 Dec 2008 11:11:43 -0000 Author: rwatson Date: Wed Dec 10 11:11:43 2008 New Revision: 185857 URL: http://svn.freebsd.org/changeset/base/185857 Log: Move syncache flag definitions below data structure, compress some vertical whitespace. MFC after: pretty soon Modified: head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Wed Dec 10 11:09:31 2008 (r185856) +++ head/sys/netinet/tcp_syncache.h Wed Dec 10 11:11:43 2008 (r185857) @@ -56,7 +56,6 @@ struct syncache { struct in_conninfo sc_inc; /* addresses */ int sc_rxttime; /* retransmit time */ u_int16_t sc_rxmits; /* retransmit counter */ - u_int32_t sc_tsreflect; /* timestamp to reflect */ u_int32_t sc_ts; /* our timestamp to send */ u_int32_t sc_tsoff; /* ts offset w/ syncookies */ @@ -64,7 +63,6 @@ struct syncache { tcp_seq sc_irs; /* seq from peer */ tcp_seq sc_iss; /* our ISS */ struct mbuf *sc_ipopts; /* source route */ - u_int16_t sc_peer_mss; /* peer's MSS */ u_int16_t sc_wnd; /* advertised window */ u_int8_t sc_ip_ttl; /* IPv4 TTL */ @@ -72,14 +70,6 @@ struct syncache { u_int8_t sc_requested_s_scale:4, sc_requested_r_scale:4; u_int16_t sc_flags; -#define SCF_NOOPT 0x01 /* no TCP options */ -#define SCF_WINSCALE 0x02 /* negotiated window scaling */ -#define SCF_TIMESTAMP 0x04 /* negotiated timestamps */ - /* MSS is implicit */ -#define SCF_UNREACH 0x10 /* icmp unreachable received */ -#define SCF_SIGNATURE 0x20 /* send MD5 digests */ -#define SCF_SACK 0x80 /* send SACK option */ -#define SCF_ECN 0x100 /* send ECN setup packet */ #ifndef TCP_OFFLOAD_DISABLE struct toe_usrreqs *sc_tu; /* TOE operations */ void *sc_toepcb; /* TOE protocol block */ @@ -90,6 +80,18 @@ struct syncache { struct ucred *sc_cred; /* cred cache for jail checks */ }; +/* + * Flags for the sc_flags field. + */ +#define SCF_NOOPT 0x01 /* no TCP options */ +#define SCF_WINSCALE 0x02 /* negotiated window scaling */ +#define SCF_TIMESTAMP 0x04 /* negotiated timestamps */ + /* MSS is implicit */ +#define SCF_UNREACH 0x10 /* icmp unreachable received */ +#define SCF_SIGNATURE 0x20 /* send MD5 digests */ +#define SCF_SACK 0x80 /* send SACK option */ +#define SCF_ECN 0x100 /* send ECN setup packet */ + #define SYNCOOKIE_SECRET_SIZE 8 /* dwords */ #define SYNCOOKIE_LIFETIME 16 /* seconds */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 13:24:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E604E1065678; Wed, 10 Dec 2008 13:24:38 +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 D68BA8FC14; Wed, 10 Dec 2008 13:24:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBADOc7s031435; Wed, 10 Dec 2008 13:24:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBADOcR3031434; Wed, 10 Dec 2008 13:24:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812101324.mBADOcR3031434@svn.freebsd.org> From: Robert Watson Date: Wed, 10 Dec 2008 13:24: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: r185858 - 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, 10 Dec 2008 13:24:39 -0000 Author: rwatson Date: Wed Dec 10 13:24:38 2008 New Revision: 185858 URL: http://svn.freebsd.org/changeset/base/185858 Log: Remove inconsistent white space from in_pcballoc(). MFC after: pretty soon Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Dec 10 11:11:43 2008 (r185857) +++ head/sys/netinet/in_pcb.c Wed Dec 10 13:24:38 2008 (r185858) @@ -212,7 +212,6 @@ in_pcballoc(struct socket *so, struct in mac_inpcb_create(so, inp); SOCK_UNLOCK(so); #endif - #ifdef IPSEC error = ipsec_init_policy(so, &inp->inp_sp); if (error != 0) { @@ -239,7 +238,6 @@ in_pcballoc(struct socket *so, struct in INP_WLOCK(inp); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; inp->inp_refcount = 1; /* Reference from the inpcbinfo */ - #if defined(IPSEC) || defined(MAC) out: if (error != 0) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 14:49:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B891106564A; Wed, 10 Dec 2008 14:49:55 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C67B8FC17; Wed, 10 Dec 2008 14:49:55 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAEntRk033108; Wed, 10 Dec 2008 14:49:55 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAEntQs033107; Wed, 10 Dec 2008 14:49:55 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812101449.mBAEntQs033107@svn.freebsd.org> From: Doug Rabson Date: Wed, 10 Dec 2008 14:49: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: r185860 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Dec 2008 14:49:55 -0000 Author: dfr Date: Wed Dec 10 14:49:54 2008 New Revision: 185860 URL: http://svn.freebsd.org/changeset/base/185860 Log: We need to pass a structure with enough space for an NFSv2 filehandle to nfs_srvmtofh_xx otherwise bad things happen when an NFSv2 client tries to make a request. Modified: head/sys/nfsserver/nfs_fha.c Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Wed Dec 10 14:06:08 2008 (r185859) +++ head/sys/nfsserver/nfs_fha.c Wed Dec 10 14:49:54 2008 (r185860) @@ -162,7 +162,7 @@ static void fha_extract_info(struct svc_req *req, struct fha_info *i) { struct mbuf *md = req->rq_args; - fhandle_t fh; + nfsfh_t fh; caddr_t dpos = mtod(md, caddr_t); static u_int64_t random_fh = 0; int error; @@ -205,11 +205,11 @@ fha_extract_info(struct svc_req *req, st goto out; /* Grab the filehandle. */ - error = nfsm_srvmtofh_xx(&fh, v3, &md, &dpos); + error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos); if (error) goto out; - i->fh = *(const u_int64_t *)(fh.fh_fid.fid_data); + i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data); /* Content ourselves with zero offset for all but reads. */ if (procnum != NFSPROC_READ) From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 16:11:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B149E1065677; Wed, 10 Dec 2008 16:11:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1C968FC39; Wed, 10 Dec 2008 16:11:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAGB9Pf035736; Wed, 10 Dec 2008 16:11:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAGB9ik035734; Wed, 10 Dec 2008 16:11:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812101611.mBAGB9ik035734@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 10 Dec 2008 16:11: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: r185864 - in head/sys: compat/linprocfs fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Dec 2008 16:11:09 -0000 Author: kib Date: Wed Dec 10 16:11:09 2008 New Revision: 185864 URL: http://svn.freebsd.org/changeset/base/185864 Log: Relock user map earlier, to have the lock held when break leaves the loop earlier due to sbuf error. Pointy hat to: me Submitted by: dchagin Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_map.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Dec 10 16:02:54 2008 (r185863) +++ head/sys/compat/linprocfs/linprocfs.c Wed Dec 10 16:11:09 2008 (r185864) @@ -969,11 +969,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ); if (freename) free(freename, M_TEMP); + vm_map_lock_read(map); if (error == -1) { error = 0; break; } - vm_map_lock_read(map); if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Wed Dec 10 16:02:54 2008 (r185863) +++ head/sys/fs/procfs/procfs_map.c Wed Dec 10 16:11:09 2008 (r185864) @@ -219,12 +219,11 @@ procfs_doprocmap(PFS_FILL_ARGS) if (freepath != NULL) free(freepath, M_TEMP); - + vm_map_lock_read(map); if (error == -1) { error = 0; break; } - vm_map_lock_read(map); if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 19:45:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BF521065673; Wed, 10 Dec 2008 19:45:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3938FC2B; Wed, 10 Dec 2008 19:45:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAJjwsY040854; Wed, 10 Dec 2008 19:45:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAJjwn2040853; Wed, 10 Dec 2008 19:45:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812101945.mBAJjwn2040853@svn.freebsd.org> From: John Baldwin Date: Wed, 10 Dec 2008 19:45: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: r185874 - 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: Wed, 10 Dec 2008 19:45:58 -0000 Author: jhb Date: Wed Dec 10 19:45:58 2008 New Revision: 185874 URL: http://svn.freebsd.org/changeset/base/185874 Log: Rather than using a char array with explicit assumptions about the layout of 'struct osigevent' in 'struct aiocb', use int and void pointer spare members that are identical to 'struct osigevent'. MFC after: 1 month Modified: head/sys/sys/aio.h Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Wed Dec 10 19:33:10 2008 (r185873) +++ head/sys/sys/aio.h Wed Dec 10 19:45:58 2008 (r185874) @@ -69,7 +69,8 @@ typedef struct aiocb { off_t aio_offset; /* File offset for I/O */ volatile void *aio_buf; /* I/O buffer in process space */ size_t aio_nbytes; /* Number of bytes for I/O */ - char __spare__[sizeof(int) * 2 + sizeof(void *)]; /* osigevent. */ + int __spare__[2]; + void *__spare2__; int aio_lio_opcode; /* LIO opcode */ int aio_reqprio; /* Request priority -- ignored */ struct __aiocb_private _aiocb_private; From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 20:44:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A9781065670; Wed, 10 Dec 2008 20:44:19 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FD0B8FC1B; Wed, 10 Dec 2008 20:44:19 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAKiIfB042006; Wed, 10 Dec 2008 20:44:18 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAKiIBr042005; Wed, 10 Dec 2008 20:44:18 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200812102044.mBAKiIBr042005@svn.freebsd.org> From: Max Laier Date: Wed, 10 Dec 2008 20:44: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: r185875 - head/contrib/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Dec 2008 20:44:19 -0000 Author: mlaier Date: Wed Dec 10 20:44:18 2008 New Revision: 185875 URL: http://svn.freebsd.org/changeset/base/185875 Log: Bootstrap mergeinfo on pf userland Modified: head/contrib/pf/ (props changed) From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 20:56:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF8B1065675; Wed, 10 Dec 2008 20:56:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88E0A8FC16; Wed, 10 Dec 2008 20:56:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAKuJlB042382; Wed, 10 Dec 2008 20:56:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAKuJ97042379; Wed, 10 Dec 2008 20:56:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812102056.mBAKuJ97042379@svn.freebsd.org> From: John Baldwin Date: Wed, 10 Dec 2008 20:56: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: r185878 - in head/sys: compat/freebsd32 kern modules/aio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Dec 2008 20:56:19 -0000 Author: jhb Date: Wed Dec 10 20:56:19 2008 New Revision: 185878 URL: http://svn.freebsd.org/changeset/base/185878 Log: - Add 32-bit compat system calls for VFS_AIO. The system calls live in the aio code and are registered via the recently added SYSCALL32_*() helpers. - Since the aio code likes to invoke fuword and suword a lot down in the "bowels" of system calls, add a structure holding a set of operations for things like storing errors, copying in the aiocb structure, storing status, etc. The 32-bit system calls use a separate operations vector to handle fuword32 vs fuword, etc. Also, the oldsigevent handling is now done by having seperate operation vectors with different aiocb copyin routines. - Split out kern_foo() functions for the various AIO system calls so the 32-bit front ends can manage things like copying in and converting timespec structures, etc. - For both the native and 32-bit aio_suspend() and lio_listio() calls, just use copyin() to read the array of aiocb pointers instead of using a for loop that iterated over fuword/fuword32. The error handling in the old case was incomplete (lio_listio() just ignored any aiocb's that it got an EFAULT trying to read rather than reporting an error), and possibly slower. MFC after: 1 month Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/vfs_aio.c head/sys/modules/aio/Makefile Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Dec 10 20:55:44 2008 (r185877) +++ head/sys/compat/freebsd32/syscalls.master Wed Dec 10 20:56:19 2008 (r185878) @@ -454,9 +454,13 @@ u_int nfds, int timeout); } 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } 254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } -255 AUE_NULL UNIMPL nosys -256 AUE_NULL UNIMPL nosys -257 AUE_NULL UNIMPL nosys +255 AUE_NULL NOSTD { int freebsd32_aio_read( \ + struct aiocb32 *aiocbp); } +256 AUE_NULL NOSTD { int freebsd32_aio_write( \ + struct aiocb32 *aiocbp); } +257 AUE_NULL NOSTD { int freebsd32_lio_listio(int mode, \ + struct aiocb32 * const *acb_list, \ + int nent, struct sigevent *sig); } 258 AUE_NULL UNIMPL nosys 259 AUE_NULL UNIMPL nosys 260 AUE_NULL UNIMPL nosys @@ -535,13 +539,22 @@ 312 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_NULL UNIMPL aio_return -315 AUE_NULL UNIMPL aio_suspend -316 AUE_NULL UNIMPL aio_cancel -317 AUE_NULL UNIMPL aio_error -318 AUE_NULL UNIMPL aio_read -319 AUE_NULL UNIMPL aio_write -320 AUE_NULL UNIMPL lio_listio +314 AUE_NULL NOSTD { int freebsd32_aio_return( \ + struct aiocb32 *aiocbp); } +315 AUE_NULL NOSTD { int freebsd32_aio_suspend( \ + struct aiocb32 * const * aiocbp, int nent, \ + const struct timespec32 *timeout); } +316 AUE_NULL NOSTD { int freebsd32_aio_cancel(int fd, \ + struct aiocb32 *aiocbp); } +317 AUE_NULL NOSTD { int freebsd32_aio_error( \ + struct aiocb32 *aiocbp); } +318 AUE_NULL NOSTD { int freebsd32_oaio_read( \ + struct oaiocb32 *aiocbp); } +319 AUE_NULL NOSTD { int freebsd32_oaio_write( \ + struct oaiocb32 *aiocbp); } +320 AUE_NULL NOSTD { int freebsd32_olio_listio(int mode, \ + struct oaiocb32 * const *acb_list, \ + int nent, struct osigevent32 *sig); } 321 AUE_NULL NOPROTO { int yield(void); } 322 AUE_NULL OBSOL thr_sleep 323 AUE_NULL OBSOL thr_wakeup @@ -618,7 +631,9 @@ 358 AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \ const char *path, int attrnamespace, \ const char *attrname); } -359 AUE_NULL UNIMPL aio_waitcomplete +359 AUE_NULL NOSTD { int freebsd32_aio_waitcomplete( \ + struct aiocb32 **aiocbp, \ + struct timespec32 *timeout); } 360 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ uid_t *suid); } 361 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ @@ -766,7 +781,8 @@ 462 AUE_NULL UNIMPL kmq_unlink 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } -465 AUE_NULL UNIMPL aio_fsync +465 AUE_NULL NOSTD { int freebsd32_aio_fsync(int op, \ + struct aiocb32 *aiocbp); } 466 AUE_RTPRIO NOPROTO { int rtprio_thread(int function, \ lwpid_t lwpid, struct rtprio *rtp); } 467 AUE_NULL UNIMPL nosys Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Dec 10 20:55:44 2008 (r185877) +++ head/sys/kern/vfs_aio.c Wed Dec 10 20:56:19 2008 (r185878) @@ -21,6 +21,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include @@ -121,6 +123,8 @@ static uint64_t jobseqno; FEATURE(aio, "Asynchronous I/O"); +static MALLOC_DEFINE(M_LIO, "lio", "listio aio control block list"); + static SYSCTL_NODE(_vfs, OID_AUTO, aio, CTLFLAG_RW, 0, "Async IO management"); static int max_aio_procs = MAX_AIO_PROCS; @@ -308,6 +312,20 @@ struct kaioinfo { #define KAIO_RUNDOWN 0x1 /* process is being run down */ #define KAIO_WAKEUP 0x2 /* wakeup process when there is a significant event */ +/* + * Operations used to interact with userland aio control blocks. + * Different ABIs provide their own operations. + */ +struct aiocb_ops { + int (*copyin)(struct aiocb *ujob, struct aiocb *kjob); + long (*fetch_status)(struct aiocb *ujob); + long (*fetch_error)(struct aiocb *ujob); + int (*store_status)(struct aiocb *ujob, long status); + int (*store_error)(struct aiocb *ujob, long error); + int (*store_kernelinfo)(struct aiocb *ujob, long jobref); + int (*store_aiocb)(struct aiocb **ujobp, struct aiocb *ujob); +}; + static TAILQ_HEAD(,aiothreadlist) aio_freeproc; /* (c) Idle daemons */ static struct sema aio_newproc_sem; static struct mtx aio_job_mtx; @@ -321,7 +339,7 @@ static int aio_free_entry(struct aiocbli static void aio_process(struct aiocblist *aiocbe); static int aio_newproc(int *); int aio_aqueue(struct thread *td, struct aiocb *job, - struct aioliojob *lio, int type, int osigev); + struct aioliojob *lio, int type, struct aiocb_ops *ops); static void aio_physwakeup(struct buf *bp); static void aio_proc_rundown(void *arg, struct proc *p); static void aio_proc_rundown_exec(void *arg, struct proc *p, struct image_params *imgp); @@ -333,7 +351,6 @@ static int aio_unload(void); static void aio_bio_done_notify(struct proc *userp, struct aiocblist *aiocbe, int type); #define DONE_BUF 1 #define DONE_QUEUE 2 -static int do_lio_listio(struct thread *td, struct lio_listio_args *uap, int oldsigev); static int aio_kick(struct proc *userp); static void aio_kick_nowait(struct proc *userp); static void aio_kick_helper(void *context, int pending); @@ -1322,13 +1339,122 @@ aio_swake_cb(struct socket *so, struct s SOCKBUF_UNLOCK(sb); } +static int +convert_old_sigevent(struct osigevent *osig, struct sigevent *nsig) +{ + + /* + * Only SIGEV_NONE, SIGEV_SIGNAL, and SIGEV_KEVENT are + * supported by AIO with the old sigevent structure. + */ + nsig->sigev_notify = osig->sigev_notify; + switch (nsig->sigev_notify) { + case SIGEV_NONE: + break; + case SIGEV_SIGNAL: + nsig->sigev_signo = osig->__sigev_u.__sigev_signo; + break; + case SIGEV_KEVENT: + nsig->sigev_notify_kqueue = + osig->__sigev_u.__sigev_notify_kqueue; + nsig->sigev_value.sival_ptr = osig->sigev_value.sival_ptr; + break; + default: + return (EINVAL); + } + return (0); +} + +static int +aiocb_copyin_old_sigevent(struct aiocb *ujob, struct aiocb *kjob) +{ + struct oaiocb *ojob; + int error; + + bzero(kjob, sizeof(struct aiocb)); + error = copyin(ujob, kjob, sizeof(struct oaiocb)); + if (error) + return (error); + ojob = (struct oaiocb *)kjob; + return (convert_old_sigevent(&ojob->aio_sigevent, &kjob->aio_sigevent)); +} + +static int +aiocb_copyin(struct aiocb *ujob, struct aiocb *kjob) +{ + + return (copyin(ujob, kjob, sizeof(struct aiocb))); +} + +static long +aiocb_fetch_status(struct aiocb *ujob) +{ + + return (fuword(&ujob->_aiocb_private.status)); +} + +static long +aiocb_fetch_error(struct aiocb *ujob) +{ + + return (fuword(&ujob->_aiocb_private.error)); +} + +static int +aiocb_store_status(struct aiocb *ujob, long status) +{ + + return (suword(&ujob->_aiocb_private.status, status)); +} + +static int +aiocb_store_error(struct aiocb *ujob, long error) +{ + + return (suword(&ujob->_aiocb_private.error, error)); +} + +static int +aiocb_store_kernelinfo(struct aiocb *ujob, long jobref) +{ + + return (suword(&ujob->_aiocb_private.kernelinfo, jobref)); +} + +static int +aiocb_store_aiocb(struct aiocb **ujobp, struct aiocb *ujob) +{ + + return (suword(ujobp, (long)ujob)); +} + +static struct aiocb_ops aiocb_ops = { + .copyin = aiocb_copyin, + .fetch_status = aiocb_fetch_status, + .fetch_error = aiocb_fetch_error, + .store_status = aiocb_store_status, + .store_error = aiocb_store_error, + .store_kernelinfo = aiocb_store_kernelinfo, + .store_aiocb = aiocb_store_aiocb, +}; + +static struct aiocb_ops aiocb_ops_osigevent = { + .copyin = aiocb_copyin_old_sigevent, + .fetch_status = aiocb_fetch_status, + .fetch_error = aiocb_fetch_error, + .store_status = aiocb_store_status, + .store_error = aiocb_store_error, + .store_kernelinfo = aiocb_store_kernelinfo, + .store_aiocb = aiocb_store_aiocb, +}; + /* * Queue a new AIO request. Choosing either the threaded or direct physio VCHR * technique is done in this code. */ int aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj, - int type, int oldsigev) + int type, struct aiocb_ops *ops) { struct proc *p = td->td_proc; struct file *fp; @@ -1347,13 +1473,13 @@ aio_aqueue(struct thread *td, struct aio ki = p->p_aioinfo; - suword(&job->_aiocb_private.status, -1); - suword(&job->_aiocb_private.error, 0); - suword(&job->_aiocb_private.kernelinfo, -1); + ops->store_status(job, -1); + ops->store_error(job, 0); + ops->store_kernelinfo(job, -1); if (num_queue_count >= max_queue_count || ki->kaio_count >= ki->kaio_qallowed_count) { - suword(&job->_aiocb_private.error, EAGAIN); + ops->store_error(job, EAGAIN); return (EAGAIN); } @@ -1362,16 +1488,9 @@ aio_aqueue(struct thread *td, struct aio aiocbe->outputcharge = 0; knlist_init(&aiocbe->klist, AIO_MTX(ki), NULL, NULL, NULL); - if (oldsigev) { - bzero(&aiocbe->uaiocb, sizeof(struct aiocb)); - error = copyin(job, &aiocbe->uaiocb, sizeof(struct oaiocb)); - bcopy(&aiocbe->uaiocb.__spare__, &aiocbe->uaiocb.aio_sigevent, - sizeof(struct osigevent)); - } else { - error = copyin(job, &aiocbe->uaiocb, sizeof(struct aiocb)); - } + error = ops->copyin(job, &aiocbe->uaiocb); if (error) { - suword(&job->_aiocb_private.error, error); + ops->store_error(job, error); uma_zfree(aiocb_zone, aiocbe); return (error); } @@ -1380,11 +1499,11 @@ aio_aqueue(struct thread *td, struct aio aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_SIGNAL && aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_THREAD_ID && aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_NONE) { - suword(&job->_aiocb_private.error, EINVAL); + ops->store_error(job, EINVAL); uma_zfree(aiocb_zone, aiocbe); return (EINVAL); } - + if ((aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL || aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_THREAD_ID) && !_SIG_VALID(aiocbe->uaiocb.aio_sigevent.sigev_signo)) { @@ -1416,7 +1535,7 @@ aio_aqueue(struct thread *td, struct aio } if (error) { uma_zfree(aiocb_zone, aiocbe); - suword(&job->_aiocb_private.error, error); + ops->store_error(job, error); return (error); } @@ -1436,7 +1555,7 @@ aio_aqueue(struct thread *td, struct aio jid = jobrefid++; aiocbe->seqno = jobseqno++; mtx_unlock(&aio_job_mtx); - error = suword(&job->_aiocb_private.kernelinfo, jid); + error = ops->store_kernelinfo(job, jid); if (error) { error = EINVAL; goto aqueue_fail; @@ -1467,12 +1586,12 @@ aqueue_fail: if (error) { fdrop(fp, td); uma_zfree(aiocb_zone, aiocbe); - suword(&job->_aiocb_private.error, error); + ops->store_error(job, error); goto done; } no_kqueue: - suword(&job->_aiocb_private.error, EINPROGRESS); + ops->store_error(job, EINPROGRESS); aiocbe->uaiocb._aiocb_private.error = EINPROGRESS; aiocbe->userproc = p; aiocbe->cred = crhold(td->td_ucred); @@ -1528,7 +1647,7 @@ no_kqueue: #if 0 if (error > 0) { aiocbe->uaiocb._aiocb_private.error = error; - suword(&job->_aiocb_private.error, error); + ops->store_error(job, error); goto done; } #endif @@ -1643,19 +1762,17 @@ aio_kick_helper(void *context, int pendi * Support the aio_return system call, as a side-effect, kernel resources are * released. */ -int -aio_return(struct thread *td, struct aio_return_args *uap) +static int +kern_aio_return(struct thread *td, struct aiocb *uaiocb, struct aiocb_ops *ops) { struct proc *p = td->td_proc; struct aiocblist *cb; - struct aiocb *uaiocb; struct kaioinfo *ki; int status, error; ki = p->p_aioinfo; if (ki == NULL) return (EINVAL); - uaiocb = uap->aiocbp; AIO_LOCK(ki); TAILQ_FOREACH(cb, &ki->kaio_done, plist) { if (cb->uuaiocb == uaiocb) @@ -1675,8 +1792,8 @@ aio_return(struct thread *td, struct aio } aio_free_entry(cb); AIO_UNLOCK(ki); - suword(&uaiocb->_aiocb_private.error, error); - suword(&uaiocb->_aiocb_private.status, status); + ops->store_error(uaiocb, error); + ops->store_status(uaiocb, status); } else { error = EINVAL; AIO_UNLOCK(ki); @@ -1684,37 +1801,32 @@ aio_return(struct thread *td, struct aio return (error); } +int +aio_return(struct thread *td, struct aio_return_args *uap) +{ + + return (kern_aio_return(td, uap->aiocbp, &aiocb_ops)); +} + /* * Allow a process to wakeup when any of the I/O requests are completed. */ -int -aio_suspend(struct thread *td, struct aio_suspend_args *uap) +static int +kern_aio_suspend(struct thread *td, int njoblist, struct aiocb **ujoblist, + struct timespec *ts) { struct proc *p = td->td_proc; struct timeval atv; - struct timespec ts; - struct aiocb *const *cbptr, *cbp; struct kaioinfo *ki; struct aiocblist *cb, *cbfirst; - struct aiocb **ujoblist; - int njoblist; - int error; - int timo; - int i; - - if (uap->nent < 0 || uap->nent > AIO_LISTIO_MAX) - return (EINVAL); + int error, i, timo; timo = 0; - if (uap->timeout) { - /* Get timespec struct. */ - if ((error = copyin(uap->timeout, &ts, sizeof(ts))) != 0) - return (error); - - if (ts.tv_nsec < 0 || ts.tv_nsec >= 1000000000) + if (ts) { + if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000) return (EINVAL); - TIMESPEC_TO_TIMEVAL(&atv, &ts); + TIMESPEC_TO_TIMEVAL(&atv, ts); if (itimerfix(&atv)) return (EINVAL); timo = tvtohz(&atv); @@ -1724,22 +1836,8 @@ aio_suspend(struct thread *td, struct ai if (ki == NULL) return (EAGAIN); - njoblist = 0; - ujoblist = uma_zalloc(aiol_zone, M_WAITOK); - cbptr = uap->aiocbp; - - for (i = 0; i < uap->nent; i++) { - cbp = (struct aiocb *)(intptr_t)fuword(&cbptr[i]); - if (cbp == 0) - continue; - ujoblist[njoblist] = cbp; - njoblist++; - } - - if (njoblist == 0) { - uma_zfree(aiol_zone, ujoblist); + if (njoblist == 0) return (0); - } AIO_LOCK(ki); for (;;) { @@ -1769,6 +1867,31 @@ aio_suspend(struct thread *td, struct ai } RETURN: AIO_UNLOCK(ki); + return (error); +} + +int +aio_suspend(struct thread *td, struct aio_suspend_args *uap) +{ + struct timespec ts, *tsp; + struct aiocb **ujoblist; + int error; + + if (uap->nent < 0 || uap->nent > AIO_LISTIO_MAX) + return (EINVAL); + + if (uap->timeout) { + /* Get timespec struct. */ + if ((error = copyin(uap->timeout, &ts, sizeof(ts))) != 0) + return (error); + tsp = &ts; + } else + tsp = NULL; + + ujoblist = uma_zalloc(aiol_zone, M_WAITOK); + error = copyin(uap->aiocbp, ujoblist, uap->nent * sizeof(ujoblist[0])); + if (error == 0) + error = kern_aio_suspend(td, uap->nent, ujoblist, tsp); uma_zfree(aiol_zone, ujoblist); return (error); } @@ -1876,8 +1999,8 @@ done: * only. For a user mode async implementation, it would be best to do it in * a userland subroutine. */ -int -aio_error(struct thread *td, struct aio_error_args *uap) +static int +kern_aio_error(struct thread *td, struct aiocb *aiocbp, struct aiocb_ops *ops) { struct proc *p = td->td_proc; struct aiocblist *cb; @@ -1892,7 +2015,7 @@ aio_error(struct thread *td, struct aio_ AIO_LOCK(ki); TAILQ_FOREACH(cb, &ki->kaio_all, allist) { - if (cb->uuaiocb == uap->aiocbp) { + if (cb->uuaiocb == aiocbp) { if (cb->jobstate == JOBST_JOBFINISHED) td->td_retval[0] = cb->uaiocb._aiocb_private.error; @@ -1907,9 +2030,9 @@ aio_error(struct thread *td, struct aio_ /* * Hack for failure of aio_aqueue. */ - status = fuword(&uap->aiocbp->_aiocb_private.status); + status = ops->fetch_status(aiocbp); if (status == -1) { - td->td_retval[0] = fuword(&uap->aiocbp->_aiocb_private.error); + td->td_retval[0] = ops->fetch_error(aiocbp); return (0); } @@ -1917,19 +2040,27 @@ aio_error(struct thread *td, struct aio_ return (0); } +int +aio_error(struct thread *td, struct aio_error_args *uap) +{ + + return (kern_aio_error(td, uap->aiocbp, &aiocb_ops)); +} + /* syscall - asynchronous read from a file (REALTIME) */ int oaio_read(struct thread *td, struct oaio_read_args *uap) { - return aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_READ, 1); + return (aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_READ, + &aiocb_ops_osigevent)); } int aio_read(struct thread *td, struct aio_read_args *uap) { - return aio_aqueue(td, uap->aiocbp, NULL, LIO_READ, 0); + return (aio_aqueue(td, uap->aiocbp, NULL, LIO_READ, &aiocb_ops)); } /* syscall - asynchronous write to a file (REALTIME) */ @@ -1937,47 +2068,34 @@ int oaio_write(struct thread *td, struct oaio_write_args *uap) { - return aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_WRITE, 1); + return (aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_WRITE, + &aiocb_ops_osigevent)); } int aio_write(struct thread *td, struct aio_write_args *uap) { - return aio_aqueue(td, uap->aiocbp, NULL, LIO_WRITE, 0); -} - -/* syscall - list directed I/O (REALTIME) */ -int -olio_listio(struct thread *td, struct olio_listio_args *uap) -{ - return do_lio_listio(td, (struct lio_listio_args *)uap, 1); -} - -/* syscall - list directed I/O (REALTIME) */ -int -lio_listio(struct thread *td, struct lio_listio_args *uap) -{ - return do_lio_listio(td, uap, 0); + return (aio_aqueue(td, uap->aiocbp, NULL, LIO_WRITE, &aiocb_ops)); } static int -do_lio_listio(struct thread *td, struct lio_listio_args *uap, int oldsigev) +kern_lio_listio(struct thread *td, int mode, struct aiocb * const *uacb_list, + struct aiocb **acb_list, int nent, struct sigevent *sig, + struct aiocb_ops *ops) { struct proc *p = td->td_proc; - struct aiocb *iocb, * const *cbptr; + struct aiocb *iocb; struct kaioinfo *ki; struct aioliojob *lj; struct kevent kev; - int nent; int error; int nerror; int i; - if ((uap->mode != LIO_NOWAIT) && (uap->mode != LIO_WAIT)) + if ((mode != LIO_NOWAIT) && (mode != LIO_WAIT)) return (EINVAL); - nent = uap->nent; if (nent < 0 || nent > AIO_LISTIO_MAX) return (EINVAL); @@ -1996,21 +2114,13 @@ do_lio_listio(struct thread *td, struct /* * Setup signal. */ - if (uap->sig && (uap->mode == LIO_NOWAIT)) { - bzero(&lj->lioj_signal, sizeof(&lj->lioj_signal)); - error = copyin(uap->sig, &lj->lioj_signal, - oldsigev ? sizeof(struct osigevent) : - sizeof(struct sigevent)); - if (error) { - uma_zfree(aiolio_zone, lj); - return (error); - } - + if (sig && (mode == LIO_NOWAIT)) { + bcopy(sig, &lj->lioj_signal, sizeof(lj->lioj_signal)); if (lj->lioj_signal.sigev_notify == SIGEV_KEVENT) { /* Assume only new style KEVENT */ kev.filter = EVFILT_LIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; - kev.ident = (uintptr_t)uap->acb_list; /* something unique */ + kev.ident = (uintptr_t)uacb_list; /* something unique */ kev.data = (intptr_t)lj; /* pass user defined sigval data */ kev.udata = lj->lioj_signal.sigev_value.sival_ptr; @@ -2050,11 +2160,10 @@ do_lio_listio(struct thread *td, struct * Get pointers to the list of I/O requests. */ nerror = 0; - cbptr = uap->acb_list; - for (i = 0; i < uap->nent; i++) { - iocb = (struct aiocb *)(intptr_t)fuword(&cbptr[i]); - if (((intptr_t)iocb != -1) && ((intptr_t)iocb != 0)) { - error = aio_aqueue(td, iocb, lj, LIO_NOP, oldsigev); + for (i = 0; i < nent; i++) { + iocb = acb_list[i]; + if (iocb != NULL) { + error = aio_aqueue(td, iocb, lj, LIO_NOP, ops); if (error != 0) nerror++; } @@ -2062,7 +2171,7 @@ do_lio_listio(struct thread *td, struct error = 0; AIO_LOCK(ki); - if (uap->mode == LIO_WAIT) { + if (mode == LIO_WAIT) { while (lj->lioj_count - 1 != lj->lioj_finished_count) { ki->kaio_flags |= KAIO_WAKEUP; error = msleep(&p->p_aioinfo, AIO_MTX(ki), @@ -2105,6 +2214,75 @@ do_lio_listio(struct thread *td, struct return (error); } +/* syscall - list directed I/O (REALTIME) */ +int +olio_listio(struct thread *td, struct olio_listio_args *uap) +{ + struct aiocb **acb_list; + struct sigevent *sigp, sig; + struct osigevent osig; + int error, nent; + + if ((uap->mode != LIO_NOWAIT) && (uap->mode != LIO_WAIT)) + return (EINVAL); + + nent = uap->nent; + if (nent < 0 || nent > AIO_LISTIO_MAX) + return (EINVAL); + + if (uap->sig && (uap->mode == LIO_NOWAIT)) { + error = copyin(uap->sig, &osig, sizeof(osig)); + if (error) + return (error); + error = convert_old_sigevent(&osig, &sig); + if (error) + return (error); + sigp = &sig; + } else + sigp = NULL; + + acb_list = malloc(sizeof(struct aiocb *) * nent, M_LIO, M_WAITOK); + error = copyin(uap->acb_list, acb_list, nent * sizeof(acb_list[0])); + if (error == 0) + error = kern_lio_listio(td, uap->mode, + (struct aiocb * const *)uap->acb_list, acb_list, nent, sigp, + &aiocb_ops_osigevent); + free(acb_list, M_LIO); + return (error); +} + +/* syscall - list directed I/O (REALTIME) */ +int +lio_listio(struct thread *td, struct lio_listio_args *uap) +{ + struct aiocb **acb_list; + struct sigevent *sigp, sig; + int error, nent; + + if ((uap->mode != LIO_NOWAIT) && (uap->mode != LIO_WAIT)) + return (EINVAL); + + nent = uap->nent; + if (nent < 0 || nent > AIO_LISTIO_MAX) + return (EINVAL); + + if (uap->sig && (uap->mode == LIO_NOWAIT)) { + error = copyin(uap->sig, &sig, sizeof(sig)); + if (error) + return (error); + sigp = &sig; + } else + sigp = NULL; + + acb_list = malloc(sizeof(struct aiocb *) * nent, M_LIO, M_WAITOK); + error = copyin(uap->acb_list, acb_list, nent * sizeof(acb_list[0])); + if (error == 0) + error = kern_lio_listio(td, uap->mode, uap->acb_list, acb_list, + nent, sigp, &aiocb_ops); + free(acb_list, M_LIO); + return (error); +} + /* * Called from interrupt thread for physio, we should return as fast * as possible, so we schedule a biohelper task. @@ -2156,30 +2334,25 @@ biohelper(void *context, int pending) } /* syscall - wait for the next completion of an aio request */ -int -aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap) +static int +kern_aio_waitcomplete(struct thread *td, struct aiocb **aiocbp, + struct timespec *ts, struct aiocb_ops *ops) { struct proc *p = td->td_proc; struct timeval atv; - struct timespec ts; struct kaioinfo *ki; struct aiocblist *cb; struct aiocb *uuaiocb; int error, status, timo; - suword(uap->aiocbp, (long)NULL); + ops->store_aiocb(aiocbp, NULL); timo = 0; - if (uap->timeout) { - /* Get timespec struct. */ - error = copyin(uap->timeout, &ts, sizeof(ts)); - if (error) - return (error); - - if ((ts.tv_nsec < 0) || (ts.tv_nsec >= 1000000000)) + if (ts) { + if ((ts->tv_nsec < 0) || (ts->tv_nsec >= 1000000000)) return (EINVAL); - TIMESPEC_TO_TIMEVAL(&atv, &ts); + TIMESPEC_TO_TIMEVAL(&atv, ts); if (itimerfix(&atv)) return (EINVAL); timo = tvtohz(&atv); @@ -2217,9 +2390,9 @@ aio_waitcomplete(struct thread *td, stru } aio_free_entry(cb); AIO_UNLOCK(ki); - suword(uap->aiocbp, (long)uuaiocb); - suword(&uuaiocb->_aiocb_private.error, error); - suword(&uuaiocb->_aiocb_private.status, status); + ops->store_aiocb(aiocbp, uuaiocb); + ops->store_error(uuaiocb, error); + ops->store_status(uuaiocb, status); } else AIO_UNLOCK(ki); @@ -2227,17 +2400,43 @@ aio_waitcomplete(struct thread *td, stru } int -aio_fsync(struct thread *td, struct aio_fsync_args *uap) +aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap) +{ + struct timespec ts, *tsp; + int error; + + if (uap->timeout) { + /* Get timespec struct. */ + error = copyin(uap->timeout, &ts, sizeof(ts)); + if (error) + return (error); + tsp = &ts; + } else + tsp = NULL; + + return (kern_aio_waitcomplete(td, uap->aiocbp, tsp, &aiocb_ops)); +} + +static int +kern_aio_fsync(struct thread *td, int op, struct aiocb *aiocbp, + struct aiocb_ops *ops) { struct proc *p = td->td_proc; struct kaioinfo *ki; - if (uap->op != O_SYNC) /* XXX lack of O_DSYNC */ + if (op != O_SYNC) /* XXX lack of O_DSYNC */ return (EINVAL); ki = p->p_aioinfo; if (ki == NULL) aio_init_aioinfo(p); - return aio_aqueue(td, uap->aiocbp, NULL, LIO_SYNC, 0); + return (aio_aqueue(td, aiocbp, NULL, LIO_SYNC, ops)); +} + +int +aio_fsync(struct thread *td, struct aio_fsync_args *uap) +{ + + return (kern_aio_fsync(td, uap->op, uap->aiocbp, &aiocb_ops)); } /* kqueue attach function */ @@ -2325,3 +2524,433 @@ filt_lio(struct knote *kn, long hint) return (lj->lioj_flags & LIOJ_KEVENT_POSTED); } + +#ifdef COMPAT_IA32 +#include +#include +#include +#include +#include +#include +#include + +struct __aiocb_private32 { + int32_t status; + int32_t error; + uint32_t kernelinfo; +}; + +typedef struct oaiocb32 { + int aio_fildes; /* File descriptor */ + uint64_t aio_offset __packed; /* File offset for I/O */ + uint32_t aio_buf; /* I/O buffer in process space */ + uint32_t aio_nbytes; /* Number of bytes for I/O */ + struct osigevent32 aio_sigevent; /* Signal to deliver */ + int aio_lio_opcode; /* LIO opcode */ + int aio_reqprio; /* Request priority -- ignored */ + struct __aiocb_private32 _aiocb_private; +} oaiocb32_t; + +typedef struct aiocb32 { + int32_t aio_fildes; /* File descriptor */ + uint64_t aio_offset __packed; /* File offset for I/O */ + uint32_t aio_buf; /* I/O buffer in process space */ + uint32_t aio_nbytes; /* Number of bytes for I/O */ + int __spare__[2]; + uint32_t __spare2__; + int aio_lio_opcode; /* LIO opcode */ + int aio_reqprio; /* Request priority -- ignored */ + struct __aiocb_private32 _aiocb_private; + struct sigevent32 aio_sigevent; /* Signal to deliver */ +} aiocb32_t; + +static int +convert_old_sigevent32(struct osigevent32 *osig, struct sigevent *nsig) +{ + + /* + * Only SIGEV_NONE, SIGEV_SIGNAL, and SIGEV_KEVENT are + * supported by AIO with the old sigevent structure. + */ + CP(*osig, *nsig, sigev_notify); + switch (nsig->sigev_notify) { + case SIGEV_NONE: + break; + case SIGEV_SIGNAL: + nsig->sigev_signo = osig->__sigev_u.__sigev_signo; + break; + case SIGEV_KEVENT: + nsig->sigev_notify_kqueue = + osig->__sigev_u.__sigev_notify_kqueue; + PTRIN_CP(*osig, *nsig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} + +static int +aiocb32_copyin_old_sigevent(struct aiocb *ujob, struct aiocb *kjob) +{ + struct oaiocb32 job32; + int error; + + bzero(kjob, sizeof(struct aiocb)); + error = copyin(ujob, &job32, sizeof(job32)); + if (error) + return (error); + + CP(job32, *kjob, aio_fildes); + CP(job32, *kjob, aio_offset); + PTRIN_CP(job32, *kjob, aio_buf); + CP(job32, *kjob, aio_nbytes); + CP(job32, *kjob, aio_lio_opcode); + CP(job32, *kjob, aio_reqprio); + CP(job32, *kjob, _aiocb_private.status); + CP(job32, *kjob, _aiocb_private.error); + PTRIN_CP(job32, *kjob, _aiocb_private.kernelinfo); + return (convert_old_sigevent32(&job32.aio_sigevent, + &kjob->aio_sigevent)); +} + +static int +convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) +{ + + CP(*sig32, *sig, sigev_notify); + switch (sig->sigev_notify) { + case SIGEV_NONE: + break; + case SIGEV_THREAD_ID: + CP(*sig32, *sig, sigev_notify_thread_id); + /* FALLTHROUGH */ + case SIGEV_SIGNAL: + CP(*sig32, *sig, sigev_signo); + break; + case SIGEV_KEVENT: + CP(*sig32, *sig, sigev_notify_kqueue); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} + +static int +aiocb32_copyin(struct aiocb *ujob, struct aiocb *kjob) +{ + struct aiocb32 job32; + int error; + + error = copyin(ujob, &job32, sizeof(job32)); + if (error) + return (error); + CP(job32, *kjob, aio_fildes); + CP(job32, *kjob, aio_offset); + PTRIN_CP(job32, *kjob, aio_buf); + CP(job32, *kjob, aio_nbytes); + CP(job32, *kjob, aio_lio_opcode); + CP(job32, *kjob, aio_reqprio); + CP(job32, *kjob, _aiocb_private.status); + CP(job32, *kjob, _aiocb_private.error); + PTRIN_CP(job32, *kjob, _aiocb_private.kernelinfo); + return (convert_sigevent32(&job32.aio_sigevent, &kjob->aio_sigevent)); +} + +static long +aiocb32_fetch_status(struct aiocb *ujob) +{ + struct aiocb32 *ujob32; + + ujob32 = (struct aiocb32 *)ujob; + return (fuword32(&ujob32->_aiocb_private.status)); +} + +static long +aiocb32_fetch_error(struct aiocb *ujob) +{ + struct aiocb32 *ujob32; + + ujob32 = (struct aiocb32 *)ujob; + return (fuword32(&ujob32->_aiocb_private.error)); +} + +static int +aiocb32_store_status(struct aiocb *ujob, long status) +{ + struct aiocb32 *ujob32; + + ujob32 = (struct aiocb32 *)ujob; + return (suword32(&ujob32->_aiocb_private.status, status)); +} + +static int +aiocb32_store_error(struct aiocb *ujob, long error) +{ + struct aiocb32 *ujob32; + + ujob32 = (struct aiocb32 *)ujob; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 20:57:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3648F106564A; Wed, 10 Dec 2008 20:57:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 237378FC1A; Wed, 10 Dec 2008 20:57:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAKvHk9042443; Wed, 10 Dec 2008 20:57:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAKvHXq042439; Wed, 10 Dec 2008 20:57:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812102057.mBAKvHXq042439@svn.freebsd.org> From: John Baldwin Date: Wed, 10 Dec 2008 20:57: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: r185879 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 20:57:17 -0000 Author: jhb Date: Wed Dec 10 20:57:16 2008 New Revision: 185879 URL: http://svn.freebsd.org/changeset/base/185879 Log: Regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 10 20:56:19 2008 (r185878) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 10 20:57:16 2008 (r185879) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -215,6 +215,18 @@ struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_aio_read_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_write_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_lio_listio_args { + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; +}; struct freebsd32_lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; @@ -235,6 +247,33 @@ struct freebsd32_modstat_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; char stat_l_[PADL_(struct module_stat32 *)]; struct module_stat32 * stat; char stat_r_[PADR_(struct module_stat32 *)]; }; +struct freebsd32_aio_return_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_suspend_args { + char aiocbp_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; +}; +struct freebsd32_aio_cancel_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_error_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_oaio_read_args { + char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; char aiocbp_r_[PADR_(struct oaiocb32 *)]; +}; +struct freebsd32_oaio_write_args { + char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; char aiocbp_r_[PADR_(struct oaiocb32 *)]; +}; +struct freebsd32_olio_listio_args { + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char acb_list_l_[PADL_(struct oaiocb32 *const *)]; struct oaiocb32 *const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char sig_l_[PADL_(struct osigevent32 *)]; struct osigevent32 * sig; char sig_r_[PADR_(struct osigevent32 *)]; +}; struct freebsd32_jail_args { char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; }; @@ -247,6 +286,10 @@ struct freebsd32_sigwaitinfo_args { char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +struct freebsd32_aio_waitcomplete_args { + char aiocbp_l_[PADL_(struct aiocb32 **)]; struct aiocb32 ** aiocbp; char aiocbp_r_[PADR_(struct aiocb32 **)]; + char timeout_l_[PADL_(struct timespec32 *)]; struct timespec32 * timeout; char timeout_r_[PADR_(struct timespec32 *)]; +}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -308,6 +351,10 @@ struct freebsd32_thr_new_args { char param_l_[PADL_(struct thr_param32 *)]; struct thr_param32 * param; char param_r_[PADR_(struct thr_param32 *)]; char param_size_l_[PADL_(int)]; int param_size; char param_size_r_[PADR_(int)]; }; +struct freebsd32_aio_fsync_args { + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; struct freebsd32_pread_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; @@ -427,13 +474,24 @@ int freebsd32_clock_gettime(struct threa int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *); int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); +int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); +int freebsd32_aio_write(struct thread *, struct freebsd32_aio_write_args *); +int freebsd32_lio_listio(struct thread *, struct freebsd32_lio_listio_args *); int freebsd32_lutimes(struct thread *, struct freebsd32_lutimes_args *); int freebsd32_preadv(struct thread *, struct freebsd32_preadv_args *); int freebsd32_pwritev(struct thread *, struct freebsd32_pwritev_args *); int freebsd32_modstat(struct thread *, struct freebsd32_modstat_args *); +int freebsd32_aio_return(struct thread *, struct freebsd32_aio_return_args *); +int freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *); +int freebsd32_aio_cancel(struct thread *, struct freebsd32_aio_cancel_args *); +int freebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *); +int freebsd32_oaio_read(struct thread *, struct freebsd32_oaio_read_args *); +int freebsd32_oaio_write(struct thread *, struct freebsd32_oaio_write_args *); +int freebsd32_olio_listio(struct thread *, struct freebsd32_olio_listio_args *); int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); +int freebsd32_aio_waitcomplete(struct thread *, struct freebsd32_aio_waitcomplete_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_nmount(struct thread *, struct freebsd32_nmount_args *); int freebsd32_sendfile(struct thread *, struct freebsd32_sendfile_args *); @@ -447,6 +505,7 @@ int freebsd32_umtx_unlock(struct thread int freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *); int freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *); int freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *); +int freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *); int freebsd32_pread(struct thread *, struct freebsd32_pread_args *); int freebsd32_pwrite(struct thread *, struct freebsd32_pwrite_args *); int freebsd32_mmap(struct thread *, struct freebsd32_mmap_args *); @@ -641,13 +700,24 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_clock_settime AUE_CLOCK_SETTIME #define FREEBSD32_SYS_AUE_freebsd32_clock_getres AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_lio_listio AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_lutimes AUE_LUTIMES #define FREEBSD32_SYS_AUE_freebsd32_preadv AUE_PREADV #define FREEBSD32_SYS_AUE_freebsd32_pwritev AUE_PWRITEV #define FREEBSD32_SYS_AUE_freebsd32_modstat AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_return AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_suspend AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_cancel AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_error AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_oaio_read AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_oaio_write AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_olio_listio AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT #define FREEBSD32_SYS_AUE_freebsd32_sigwaitinfo AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_waitcomplete AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nmount AUE_NMOUNT #define FREEBSD32_SYS_AUE_freebsd32_sendfile AUE_SENDFILE @@ -661,6 +731,7 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_fsync AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_pread AUE_PREAD #define FREEBSD32_SYS_AUE_freebsd32_pwrite AUE_PWRITE #define FREEBSD32_SYS_AUE_freebsd32_mmap AUE_MMAP Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Dec 10 20:56:19 2008 (r185878) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Dec 10 20:57:16 2008 (r185879) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -210,6 +210,9 @@ #define FREEBSD32_SYS_openbsd_poll 252 #define FREEBSD32_SYS_issetugid 253 #define FREEBSD32_SYS_lchown 254 +#define FREEBSD32_SYS_freebsd32_aio_read 255 +#define FREEBSD32_SYS_freebsd32_aio_write 256 +#define FREEBSD32_SYS_freebsd32_lio_listio 257 #define FREEBSD32_SYS_getdents 272 #define FREEBSD32_SYS_lchmod 274 #define FREEBSD32_SYS_netbsd_lchown 275 @@ -237,6 +240,13 @@ #define FREEBSD32_SYS_setresuid 311 #define FREEBSD32_SYS_setresgid 312 /* 313 is obsolete signanosleep */ +#define FREEBSD32_SYS_freebsd32_aio_return 314 +#define FREEBSD32_SYS_freebsd32_aio_suspend 315 +#define FREEBSD32_SYS_freebsd32_aio_cancel 316 +#define FREEBSD32_SYS_freebsd32_aio_error 317 +#define FREEBSD32_SYS_freebsd32_oaio_read 318 +#define FREEBSD32_SYS_freebsd32_oaio_write 319 +#define FREEBSD32_SYS_freebsd32_olio_listio 320 #define FREEBSD32_SYS_yield 321 /* 322 is obsolete thr_sleep */ /* 323 is obsolete thr_wakeup */ @@ -274,6 +284,7 @@ #define FREEBSD32_SYS_extattr_set_file 356 #define FREEBSD32_SYS_extattr_get_file 357 #define FREEBSD32_SYS_extattr_delete_file 358 +#define FREEBSD32_SYS_freebsd32_aio_waitcomplete 359 #define FREEBSD32_SYS_getresuid 360 #define FREEBSD32_SYS_getresgid 361 #define FREEBSD32_SYS_kqueue 362 @@ -321,6 +332,7 @@ #define FREEBSD32_SYS_sigqueue 456 #define FREEBSD32_SYS_abort2 463 #define FREEBSD32_SYS_thr_set_name 464 +#define FREEBSD32_SYS_freebsd32_aio_fsync 465 #define FREEBSD32_SYS_rtprio_thread 466 #define FREEBSD32_SYS_sctp_peeloff 471 #define FREEBSD32_SYS_sctp_generic_sendmsg 472 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Dec 10 20:56:19 2008 (r185878) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Dec 10 20:57:16 2008 (r185879) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ const char *freebsd32_syscallnames[] = { @@ -262,9 +262,9 @@ const char *freebsd32_syscallnames[] = { "openbsd_poll", /* 252 = openbsd_poll */ "issetugid", /* 253 = issetugid */ "lchown", /* 254 = lchown */ - "#255", /* 255 = nosys */ - "#256", /* 256 = nosys */ - "#257", /* 257 = nosys */ + "freebsd32_aio_read", /* 255 = freebsd32_aio_read */ + "freebsd32_aio_write", /* 256 = freebsd32_aio_write */ + "freebsd32_lio_listio", /* 257 = freebsd32_lio_listio */ "#258", /* 258 = nosys */ "#259", /* 259 = nosys */ "#260", /* 260 = nosys */ @@ -321,13 +321,13 @@ const char *freebsd32_syscallnames[] = { "setresuid", /* 311 = setresuid */ "setresgid", /* 312 = setresgid */ "obs_signanosleep", /* 313 = obsolete signanosleep */ - "#314", /* 314 = aio_return */ - "#315", /* 315 = aio_suspend */ - "#316", /* 316 = aio_cancel */ - "#317", /* 317 = aio_error */ - "#318", /* 318 = aio_read */ - "#319", /* 319 = aio_write */ - "#320", /* 320 = lio_listio */ + "freebsd32_aio_return", /* 314 = freebsd32_aio_return */ + "freebsd32_aio_suspend", /* 315 = freebsd32_aio_suspend */ + "freebsd32_aio_cancel", /* 316 = freebsd32_aio_cancel */ + "freebsd32_aio_error", /* 317 = freebsd32_aio_error */ + "freebsd32_oaio_read", /* 318 = freebsd32_oaio_read */ + "freebsd32_oaio_write", /* 319 = freebsd32_oaio_write */ + "freebsd32_olio_listio", /* 320 = freebsd32_olio_listio */ "yield", /* 321 = yield */ "obs_thr_sleep", /* 322 = obsolete thr_sleep */ "obs_thr_wakeup", /* 323 = obsolete thr_wakeup */ @@ -366,7 +366,7 @@ const char *freebsd32_syscallnames[] = { "extattr_set_file", /* 356 = extattr_set_file */ "extattr_get_file", /* 357 = extattr_get_file */ "extattr_delete_file", /* 358 = extattr_delete_file */ - "#359", /* 359 = aio_waitcomplete */ + "freebsd32_aio_waitcomplete", /* 359 = freebsd32_aio_waitcomplete */ "getresuid", /* 360 = getresuid */ "getresgid", /* 361 = getresgid */ "kqueue", /* 362 = kqueue */ @@ -472,7 +472,7 @@ const char *freebsd32_syscallnames[] = { "#462", /* 462 = kmq_unlink */ "abort2", /* 463 = abort2 */ "thr_set_name", /* 464 = thr_set_name */ - "#465", /* 465 = aio_fsync */ + "freebsd32_aio_fsync", /* 465 = freebsd32_aio_fsync */ "rtprio_thread", /* 466 = rtprio_thread */ "#467", /* 467 = nosys */ "#468", /* 468 = nosys */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Dec 10 20:56:19 2008 (r185878) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Dec 10 20:57:16 2008 (r185879) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ #include "opt_compat.h" @@ -293,9 +293,9 @@ struct sysent freebsd32_sysent[] = { { AS(openbsd_poll_args), (sy_call_t *)openbsd_poll, AUE_POLL, NULL, 0, 0 }, /* 252 = openbsd_poll */ { 0, (sy_call_t *)issetugid, AUE_ISSETUGID, NULL, 0, 0 }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 254 = lchown */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 255 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 256 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 257 = nosys */ + { AS(freebsd32_aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 255 = freebsd32_aio_read */ + { AS(freebsd32_aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 256 = freebsd32_aio_write */ + { AS(freebsd32_lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 257 = freebsd32_lio_listio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 258 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 259 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 260 = nosys */ @@ -352,13 +352,13 @@ struct sysent freebsd32_sysent[] = { { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0 }, /* 311 = setresuid */ { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0 }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 313 = obsolete signanosleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 314 = aio_return */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 315 = aio_suspend */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 316 = aio_cancel */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 317 = aio_error */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 318 = aio_read */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 319 = aio_write */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 320 = lio_listio */ + { AS(freebsd32_aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 314 = freebsd32_aio_return */ + { AS(freebsd32_aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 315 = freebsd32_aio_suspend */ + { AS(freebsd32_aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 316 = freebsd32_aio_cancel */ + { AS(freebsd32_aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 317 = freebsd32_aio_error */ + { AS(freebsd32_oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 318 = freebsd32_oaio_read */ + { AS(freebsd32_oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 319 = freebsd32_oaio_write */ + { AS(freebsd32_olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 320 = freebsd32_olio_listio */ { 0, (sy_call_t *)yield, AUE_NULL, NULL, 0, 0 }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 323 = obsolete thr_wakeup */ @@ -397,7 +397,7 @@ struct sysent freebsd32_sysent[] = { { AS(extattr_set_file_args), (sy_call_t *)extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0 }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0 }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0 }, /* 358 = extattr_delete_file */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 359 = aio_waitcomplete */ + { AS(freebsd32_aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 359 = freebsd32_aio_waitcomplete */ { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0 }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0 }, /* 361 = getresgid */ { 0, (sy_call_t *)kqueue, AUE_KQUEUE, NULL, 0, 0 }, /* 362 = kqueue */ @@ -503,7 +503,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0 }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0 }, /* 464 = thr_set_name */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 465 = aio_fsync */ + { AS(freebsd32_aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 465 = freebsd32_aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)rtprio_thread, AUE_RTPRIO, NULL, 0, 0 }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 468 = nosys */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 21:48:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC9A106568E; Wed, 10 Dec 2008 21:48:05 +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 7944E8FC22; Wed, 10 Dec 2008 21:48:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBALm5IA044022; Wed, 10 Dec 2008 21:48:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBALm5Lt044021; Wed, 10 Dec 2008 21:48:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812102148.mBALm5Lt044021@svn.freebsd.org> From: Ed Schouten Date: Wed, 10 Dec 2008 21:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185891 - 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: Wed, 10 Dec 2008 21:48:05 -0000 Author: ed Date: Wed Dec 10 21:48:05 2008 New Revision: 185891 URL: http://svn.freebsd.org/changeset/base/185891 Log: Remove added newlines from logged messages written to /dev/console. The /dev/console device node logs all strings that are written to it. When the string does not contain a trailing newline, it appends one. I can imagine this was useful a long time ago, but with our current rc-scripts, it generates a whole bunch of messages that look like: | Configuring syscons: | blanktime | . By not appending the newlines, the output of `dmesg -a' is now (almost?) exactly the same as what the user will see on the console device (syscons, uart). Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Wed Dec 10 21:32:58 2008 (r185890) +++ head/sys/kern/subr_prf.c Wed Dec 10 21:48:05 2008 (r185891) @@ -257,7 +257,7 @@ log(int level, const char *fmt, ...) void log_console(struct uio *uio) { - int c, i, error, nl; + int c, i, error; char *consbuffer; int pri; @@ -268,22 +268,14 @@ log_console(struct uio *uio) uio = cloneuio(uio); consbuffer = malloc(CONSCHUNK, M_TEMP, M_WAITOK); - nl = 0; while (uio->uio_resid > 0) { c = imin(uio->uio_resid, CONSCHUNK); error = uiomove(consbuffer, c, uio); if (error != 0) break; - for (i = 0; i < c; i++) { + for (i = 0; i < c; i++) msglogchar(consbuffer[i], pri); - if (consbuffer[i] == '\n') - nl = 1; - else - nl = 0; - } } - if (!nl) - msglogchar('\n', pri); msgbuftrigger = 1; free(uio, M_IOV); free(consbuffer, M_TEMP); From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 22:10:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAC501065670; Wed, 10 Dec 2008 22:10:37 +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 B6BB38FC1C; Wed, 10 Dec 2008 22:10:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAMAbuN044579; Wed, 10 Dec 2008 22:10:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAMAbl5044578; Wed, 10 Dec 2008 22:10:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812102210.mBAMAbl5044578@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 10 Dec 2008 22: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: r185892 - 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: Wed, 10 Dec 2008 22:10:37 -0000 Author: bz Date: Wed Dec 10 22:10:37 2008 New Revision: 185892 URL: http://svn.freebsd.org/changeset/base/185892 Log: Style changes only. Put the return type on an extra line[1] and add an empty line at the beginning as we do not have any local variables. Submitted by: rwatson [1] Reviewed by: rwatson MFC after: 4 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Dec 10 21:48:05 2008 (r185891) +++ head/sys/kern/uipc_socket.c Wed Dec 10 22:10:37 2008 (r185892) @@ -238,8 +238,10 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsock /* * Initialise maxsockets. */ -static void init_maxsockets(void *ignored) +static void +init_maxsockets(void *ignored) { + TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 22:17:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58743106564A; Wed, 10 Dec 2008 22:17:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44B368FC29; Wed, 10 Dec 2008 22:17:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAMHAFZ044755; Wed, 10 Dec 2008 22:17:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAMHAPo044753; Wed, 10 Dec 2008 22:17:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812102217.mBAMHAPo044753@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 10 Dec 2008 22:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185893 - 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: Wed, 10 Dec 2008 22:17:10 -0000 Author: bz Date: Wed Dec 10 22:17:09 2008 New Revision: 185893 URL: http://svn.freebsd.org/changeset/base/185893 Log: Make sure nmbclusters are initialized before maxsockets by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE before the init_maxsockets() SYSINT at SI_ORDER_ANY. Reviewed by: rwatson, zec Sponsored by: The FreeBSD Foundation MFC after: 4 weeks Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_socket.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Dec 10 22:10:37 2008 (r185892) +++ head/sys/kern/kern_mbuf.c Wed Dec 10 22:17:09 2008 (r185893) @@ -101,6 +101,11 @@ int nmbjumbo9; /* limits number of 9k int nmbjumbo16; /* limits number of 16k jumbo clusters */ struct mbstat mbstat; +/* + * tunable_mbinit() has to be run before init_maxsockets() thus + * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() + * runs at SI_ORDER_ANY. + */ static void tunable_mbinit(void *dummy) { @@ -113,7 +118,7 @@ tunable_mbinit(void *dummy) nmbjumbo9 = nmbjumbop / 2; nmbjumbo16 = nmbjumbo9 / 2; } -SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); +SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); /* XXX: These should be tuneables. Can't change UMA limits on the fly. */ static int Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Dec 10 22:10:37 2008 (r185892) +++ head/sys/kern/uipc_socket.c Wed Dec 10 22:17:09 2008 (r185893) @@ -236,7 +236,8 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsock "Maximum number of sockets avaliable"); /* - * Initialise maxsockets. + * Initialise maxsockets. This SYSINIT must be run after + * tunable_mbinit(). */ static void init_maxsockets(void *ignored) From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 22:24:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 107391065673; Wed, 10 Dec 2008 22:24:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id BAD5C8FC21; Wed, 10 Dec 2008 22:24:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4ABB541C5C9; Wed, 10 Dec 2008 23:24:44 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id gtGUB64NaP9T; Wed, 10 Dec 2008 23:24:43 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id BA84D41C5D9; Wed, 10 Dec 2008 23:24:43 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 095F54448DD; Wed, 10 Dec 2008 22:24:32 +0000 (UTC) Date: Wed, 10 Dec 2008 22:24:32 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200812102217.mBAMHAPo044753@svn.freebsd.org> Message-ID: <20081210221842.V97918@maildrop.int.zabbadoz.net> References: <200812102217.mBAMHAPo044753@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r185893 - 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: Wed, 10 Dec 2008 22:24:46 -0000 On Wed, 10 Dec 2008, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Dec 10 22:17:09 2008 > New Revision: 185893 > URL: http://svn.freebsd.org/changeset/base/185893 > > Log: > Make sure nmbclusters are initialized before maxsockets > by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE > before the init_maxsockets() SYSINT at SI_ORDER_ANY. > > Reviewed by: rwatson, zec > Sponsored by: The FreeBSD Foundation > MFC after: 4 weeks The problem was found by Marko Zec during the preparation of the next vimage commit patch. Booting different kernels (w/ and w/o the patch) resulted in different values for net.inet.tcp.maxtcptw and kern.ipc.maxsockets. After careful review it was clear that the intialization values for all relevant variables had not been altered. Further debugging revealed that the order the SYSINITs were run had changed. This has been around for quite a while and worked more or less out of linker luck. /bz -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 22:45:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A3D01065676; Wed, 10 Dec 2008 22:45:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2755C8FC0C; Wed, 10 Dec 2008 22:45:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mBAMj3bn026597; Wed, 10 Dec 2008 17:45:04 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Wed, 10 Dec 2008 17:44:00 -0500 User-Agent: KMail/1.9.7 References: <200812102148.mBALm5Lt044021@svn.freebsd.org> In-Reply-To: <200812102148.mBALm5Lt044021@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812101744.00578.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 10 Dec 2008 17:45:04 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8745/Wed Dec 10 15:10:10 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185891 - 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: Wed, 10 Dec 2008 22:45:10 -0000 On Wednesday 10 December 2008 04:48:05 pm Ed Schouten wrote: > Author: ed > Date: Wed Dec 10 21:48:05 2008 > New Revision: 185891 > URL: http://svn.freebsd.org/changeset/base/185891 > > Log: > Remove added newlines from logged messages written to /dev/console. > > The /dev/console device node logs all strings that are written to it. > When the string does not contain a trailing newline, it appends one. I > can imagine this was useful a long time ago, but with our current > rc-scripts, it generates a whole bunch of messages that look like: > > | Configuring syscons: > | blanktime > | . > > By not appending the newlines, the output of `dmesg -a' is now (almost?) > exactly the same as what the user will see on the console device > (syscons, uart). I believe phk@ inserted the new-lines on purpose to prevent interleaving of messages in dmesg. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 23:12:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E58881065670; Wed, 10 Dec 2008 23:12:41 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDE098FC17; Wed, 10 Dec 2008 23:12:41 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBANCfMG045907; Wed, 10 Dec 2008 23:12:41 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBANCeaE045870; Wed, 10 Dec 2008 23:12:40 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200812102312.mBANCeaE045870@svn.freebsd.org> From: Marko Zec Date: Wed, 10 Dec 2008 23:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185895 - in head/sys: conf contrib/pf/net kern net netgraph netinet netinet/libalias netinet6 netipsec 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, 10 Dec 2008 23:12:42 -0000 Author: zec Date: Wed Dec 10 23:12:39 2008 New Revision: 185895 URL: http://svn.freebsd.org/changeset/base/185895 Log: Conditionally compile out V_ globals while instantiating the appropriate container structures, depending on VIMAGE_GLOBALS compile time option. Make VIMAGE_GLOBALS a new compile-time option, which by default will not be defined, resulting in instatiations of global variables selected for V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be effectively compiled out. Instantiate new global container structures to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0, vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0. Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_ macros resolve either to the original globals, or to fields inside container structures, i.e. effectively #ifdef VIMAGE_GLOBALS #define V_rt_tables rt_tables #else #define V_rt_tables vnet_net_0._rt_tables #endif Update SYSCTL_V_*() macros to operate either on globals or on fields inside container structs. Extend the internal kldsym() lookups with the ability to resolve selected fields inside the virtualization container structs. This applies only to the fields which are explicitly registered for kldsym() visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently this is done only in sys/net/if.c. Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code, and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in turn result in proper code being generated depending on VIMAGE_GLOBALS. De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c which were prematurely V_irtualized by automated V_ prepending scripts during earlier merging steps. PF virtualization will be done separately, most probably after next PF import. Convert a few variable initializations at instantiation to initialization in init functions, most notably in ipfw. Also convert TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in initializer functions. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation Added: head/sys/kern/kern_vimage.c (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/contrib/pf/net/pf_subr.c head/sys/kern/kern_linker.c head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/net/vnet.h head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_ipfw.c head/sys/netinet/in_proto.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_dummynet.c head/sys/netinet/ip_fw.h head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_nat.c head/sys/netinet/ip_fw_pfil.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h head/sys/netinet/libalias/alias_db.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet/vinet.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_input.c head/sys/netinet6/nd6.c head/sys/netinet6/vinet6.h head/sys/netipsec/ipsec.c head/sys/netipsec/vipsec.h head/sys/sys/kernel.h head/sys/sys/sysctl.h head/sys/sys/vimage.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/conf/files Wed Dec 10 23:12:39 2008 (r185895) @@ -1953,6 +1953,7 @@ kern/kern_timeout.c standard kern/kern_umtx.c standard kern/kern_uuid.c standard kern/kern_xxx.c standard +kern/kern_vimage.c standard kern/link_elf.c standard kern/linker_if.m standard kern/md4c.c optional netsmb Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/conf/options Wed Dec 10 23:12:39 2008 (r185895) @@ -415,6 +415,7 @@ TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h +VIMAGE_GLOBALS opt_global.h XBONEHACK # Modified: head/sys/contrib/pf/net/pf_subr.c ============================================================================== --- head/sys/contrib/pf/net/pf_subr.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/contrib/pf/net/pf_subr.c Wed Dec 10 23:12:39 2008 (r185895) @@ -124,15 +124,14 @@ static MD5_CTX isn_ctx; u_int32_t pf_new_isn(struct pf_state *s) { - INIT_VNET_INET(curvnet); u_int32_t md5_buffer[4]; u_int32_t new_isn; struct pf_state_host *src, *dst; /* Seed if this is the first use, reseed if requested. */ - if (V_isn_last_reseed == 0) { - read_random(&V_isn_secret, sizeof(V_isn_secret)); - V_isn_last_reseed = ticks; + if (isn_last_reseed == 0) { + read_random(&isn_secret, sizeof(isn_secret)); + isn_last_reseed = ticks; } if (s->direction == PF_IN) { @@ -144,28 +143,28 @@ pf_new_isn(struct pf_state *s) } /* Compute the md5 hash and return the ISN. */ - MD5Init(&V_isn_ctx); - MD5Update(&V_isn_ctx, (u_char *) &dst->port, sizeof(u_short)); - MD5Update(&V_isn_ctx, (u_char *) &src->port, sizeof(u_short)); + MD5Init(&isn_ctx); + MD5Update(&isn_ctx, (u_char *) &dst->port, sizeof(u_short)); + MD5Update(&isn_ctx, (u_char *) &src->port, sizeof(u_short)); #ifdef INET6 if (s->af == AF_INET6) { - MD5Update(&V_isn_ctx, (u_char *) &dst->addr, + MD5Update(&isn_ctx, (u_char *) &dst->addr, sizeof(struct in6_addr)); - MD5Update(&V_isn_ctx, (u_char *) &src->addr, + MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in6_addr)); } else #endif { - MD5Update(&V_isn_ctx, (u_char *) &dst->addr, + MD5Update(&isn_ctx, (u_char *) &dst->addr, sizeof(struct in_addr)); - MD5Update(&V_isn_ctx, (u_char *) &src->addr, + MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in_addr)); } - MD5Update(&V_isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); - MD5Final((u_char *) &md5_buffer, &V_isn_ctx); + MD5Update(&isn_ctx, (u_char *) &isn_secret, sizeof(isn_secret)); + MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; - V_isn_offset += ISN_STATIC_INCREMENT + + isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); - new_isn += V_isn_offset; + new_isn += isn_offset; return (new_isn); } Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/kern/kern_linker.c Wed Dec 10 23:12:39 2008 (r185895) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1301,8 +1302,23 @@ kldsym(struct thread *td, struct kldsym_ break; } } +#ifndef VIMAGE_GLOBALS + /* + * If the symbol is not found in global namespace, + * try to look it up in the current vimage namespace. + */ + if (lf == NULL) { + CURVNET_SET(TD_TO_VNET(td)); + error = vi_symlookup(&lookup, symstr); + CURVNET_RESTORE(); + if (error == 0) + error = copyout(&lookup, uap->data, + sizeof(lookup)); + } +#else if (lf == NULL) error = ENOENT; +#endif } KLD_UNLOCK(); out: Added: head/sys/kern/kern_vimage.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/kern_vimage.c Wed Dec 10 23:12:39 2008 (r185895) @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2004-2008 University of Zagreb + * Copyright (c) 2006-2008 FreeBSD Foundation + * + * This software was developed by the University of Zagreb and the + * FreeBSD Foundation under sponsorship by the Stichting NLnet and the + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#ifndef VIMAGE_GLOBALS + +MALLOC_DEFINE(M_VIMAGE, "vimage", "vimage resource container"); + +static TAILQ_HEAD(vnet_modlink_head, vnet_modlink) vnet_modlink_head; + +void +vnet_mod_register(const struct vnet_modinfo *vmi) +{ + struct vnet_modlink *vml, *vml_iter; + + /* Do not register the same module instance more than once. */ + TAILQ_FOREACH(vml_iter, &vnet_modlink_head, vml_mod_le) + if (vml_iter->vml_modinfo == vmi) + panic("%s: %s", __func__, vmi->vmi_name); + vml = malloc(sizeof(struct vnet_modlink), M_VIMAGE, M_NOWAIT); + vml->vml_modinfo = vmi; + TAILQ_INSERT_TAIL(&vnet_modlink_head, vml, vml_mod_le); +} + +/* + * vi_symlookup() attempts to resolve name to address queries for + * variables which have been moved from global namespace to virtualization + * container structures, but are still directly accessed from legacy + * userspace processes via kldsym(2) and kmem(4) interfaces. + */ +int +vi_symlookup(struct kld_sym_lookup *lookup, char *symstr) +{ + struct vnet_modlink *vml; + struct vnet_symmap *mapentry; + + TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) { + if (vml->vml_modinfo->vmi_symmap == NULL) + continue; + for (mapentry = vml->vml_modinfo->vmi_symmap; + mapentry->name != NULL; mapentry++) { + if (strcmp(symstr, mapentry->name) == 0) { + lookup->symvalue = (u_long) mapentry->base; + lookup->symsize = mapentry->size; + return (0); + } + } + } + return (ENOENT); +} + +static void +vi_init(void *unused) +{ + + TAILQ_INIT(&vnet_modlink_head); +} + +SYSINIT(vimage, SI_SUB_VIMAGE, SI_ORDER_FIRST, vi_init, NULL); + +#endif /* !VIMAGE_GLOBALS */ Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/net/if.c Wed Dec 10 23:12:39 2008 (r185895) @@ -90,6 +90,12 @@ #include +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +struct vnet_net vnet_net_0; +#endif +#endif + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -161,6 +167,19 @@ static int filt_netdev(struct knote *kn, static struct filterops netdev_filtops = { 1, NULL, filt_netdetach, filt_netdev }; +#ifndef VIMAGE_GLOBALS +static struct vnet_symmap vnet_net_symmap[] = { + VNET_SYMMAP(net, ifnet), + VNET_SYMMAP(net, rt_tables), + VNET_SYMMAP(net, rtstat), + VNET_SYMMAP(net, rttrash), + VNET_SYMMAP_END +}; + +VNET_MOD_DECLARE(NET, net, vnet_net_iattach, vnet_net_idetach, + NONE, vnet_net_symmap) +#endif + /* * System initialization */ @@ -361,6 +380,10 @@ if_init(void *dummy __unused) { INIT_VNET_NET(curvnet); +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_net_modinfo); +#endif + V_if_index = 0; V_ifindex_table = NULL; V_if_indexlim = 8; Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/net/if_bridge.c Wed Dec 10 23:12:39 2008 (r185895) @@ -100,6 +100,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -3041,7 +3042,7 @@ bridge_pfil(struct mbuf **mp, struct ifn } if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { - INIT_VNET_IPFW(curvnet); + INIT_VNET_INET(curvnet); error = -1; args.rule = ip_dn_claim_rule(*mp); Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/net/if_ethersubr.c Wed Dec 10 23:12:39 2008 (r185895) @@ -42,10 +42,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -71,6 +73,7 @@ #include #include #include +#include #endif #ifdef INET6 #include @@ -426,7 +429,7 @@ int ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, struct ip_fw **rule, int shared) { - INIT_VNET_IPFW(dst->if_vnet); + INIT_VNET_INET(dst->if_vnet); struct ether_header *eh; struct ether_header save_eh; struct mbuf *m; Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/net/if_gif.c Wed Dec 10 23:12:39 2008 (r185895) @@ -95,6 +95,12 @@ static struct mtx gif_mtx; static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +struct vnet_gif vnet_gif_0; +#endif +#endif + #ifdef VIMAGE_GLOBALS static LIST_HEAD(, gif_softc) gif_softc_list; static int max_gif_nesting; Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/net/if_gif.h Wed Dec 10 23:12:39 2008 (r185895) @@ -113,7 +113,7 @@ int gif_encapcheck(const struct mbuf *, /* * Virtualization support */ -#ifdef VIMAGE + struct vnet_gif { LIST_HEAD(, gif_softc) _gif_softc_list; int _max_gif_nesting; @@ -121,6 +121,11 @@ struct vnet_gif { int _ip_gif_ttl; int _ip6_gif_hlim; }; + +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +extern struct vnet_gif vnet_gif_0; +#endif #endif #define INIT_VNET_GIF(vnet) \ Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/net/vnet.h Wed Dec 10 23:12:39 2008 (r185895) @@ -37,9 +37,7 @@ #include #include -#include #include -#include #include #include @@ -67,6 +65,12 @@ struct vnet_net { int _ether_ipfw; }; +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +extern struct vnet_net vnet_net_0; +#endif +#endif + /* * Symbol translation macros */ Modified: head/sys/netgraph/netgraph.h ============================================================================== --- head/sys/netgraph/netgraph.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netgraph/netgraph.h Wed Dec 10 23:12:39 2008 (r185895) @@ -1205,6 +1205,12 @@ struct vnet_netgraph { struct unrhdr *_ng_wormhole_unit; }; +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +extern struct vnet_netgraph vnet_netgraph_0; +#endif +#endif + /* Symbol translation macros */ #define V_nextID VNET_NETGRAPH(nextID) #define V_ng_ID_hash VNET_NETGRAPH(ng_ID_hash) Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netgraph/ng_base.c Wed Dec 10 23:12:39 2008 (r185895) @@ -72,6 +72,12 @@ MODULE_VERSION(netgraph, NG_ABI_VERSION); +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +struct vnet_netgraph vnet_netgraph_0; +#endif +#endif + /* Mutex to protect topology events. */ static struct mtx ng_topo_mtx; @@ -167,7 +173,9 @@ static struct mtx ng_typelist_mtx; /* Hash related definitions */ /* XXX Don't need to initialise them because it's a LIST */ +#ifdef VIMAGE_GLOBALS static LIST_HEAD(, ng_node) ng_ID_hash[NG_ID_HASH_SIZE]; +#endif static struct mtx ng_idhash_mtx; /* Method to find a node.. used twice so do it here */ #define NG_IDHASH_FN(ID) ((ID) % (NG_ID_HASH_SIZE)) @@ -183,7 +191,9 @@ static struct mtx ng_idhash_mtx; } \ } while (0) +#ifdef VIMAGE_GLOBALS static LIST_HEAD(, ng_node) ng_name_hash[NG_NAME_HASH_SIZE]; +#endif static struct mtx ng_namehash_mtx; #define NG_NAMEHASH(NAME, HASH) \ do { \ @@ -348,7 +358,9 @@ ng_alloc_node(void) #define TRAP_ERROR() #endif -static ng_ID_t nextID = 1; +#ifdef VIMAGE_GLOBALS +static ng_ID_t nextID; +#endif #ifdef INVARIANTS #define CHECK_DATA_MBUF(m) do { \ @@ -3063,6 +3075,7 @@ ngb_mod_event(module_t mod, int event, v switch (event) { case MOD_LOAD: /* Initialize everything. */ + V_nextID = 1; NG_WORKLIST_LOCK_INIT(); mtx_init(&ng_typelist_mtx, "netgraph types mutex", NULL, MTX_DEF); Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netgraph/ng_bridge.c Wed Dec 10 23:12:39 2008 (r185895) @@ -61,9 +61,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netgraph/ng_eiface.c Wed Dec 10 23:12:39 2008 (r185895) @@ -113,7 +113,9 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(eiface, &typestruct); +#ifdef VIMAGE_GLOBALS static struct unrhdr *ng_eiface_unit; +#endif /************************************************************************ INTERFACE STUFF Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netgraph/ng_iface.c Wed Dec 10 23:12:39 2008 (r185895) @@ -208,7 +208,9 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(iface, &typestruct); +#ifdef VIMAGE_GLOBALS static struct unrhdr *ng_iface_unit; +#endif /************************************************************************ HELPER STUFF Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netgraph/ng_ipfw.c Wed Dec 10 23:12:39 2008 (r185895) @@ -29,10 +29,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/in_proto.c Wed Dec 10 23:12:39 2008 (r185895) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_divert.c Wed Dec 10 23:12:39 2008 (r185895) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -167,7 +168,7 @@ div_init(void) V_divcbinfo.ipi_zone = uma_zcreate("divcb", sizeof(struct inpcb), NULL, NULL, div_inpcb_init, div_inpcb_fini, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(divcbinfo.ipi_zone, maxsockets); + uma_zone_set_max(V_divcbinfo.ipi_zone, maxsockets); EVENTHANDLER_REGISTER(maxsockets_change, div_zone_change, NULL, EVENTHANDLER_PRI_ANY); } Modified: head/sys/netinet/ip_dummynet.c ============================================================================== --- head/sys/netinet/ip_dummynet.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_dummynet.c Wed Dec 10 23:12:39 2008 (r185895) @@ -62,9 +62,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_fw.h Wed Dec 10 23:12:39 2008 (r185895) @@ -650,8 +650,6 @@ typedef int ip_fw_chk_t(struct ip_fw_arg extern ip_fw_chk_t *ip_fw_chk_ptr; #define IPFW_LOADED (ip_fw_chk_ptr != NULL) -#ifdef IPFW_INTERNAL - struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ struct ip_fw *reap; /* list of rules to reap */ @@ -659,6 +657,9 @@ struct ip_fw_chain { struct radix_node_head *tables[IPFW_TABLES_MAX]; struct rwlock rwmtx; }; + +#ifdef IPFW_INTERNAL + #define IPFW_LOCK_INIT(_chain) \ rw_init(&(_chain)->rwmtx, "IPFW static rules") #define IPFW_LOCK_DESTROY(_chain) rw_destroy(&(_chain)->rwmtx) @@ -684,9 +685,7 @@ typedef int ipfw_nat_cfg_t(struct sockop /* * Stack virtualization support. */ -#ifdef VIMAGE struct vnet_ipfw { - int _fw_one_pass; int _fw_enable; int _fw6_enable; u_int32_t _set_disable; @@ -716,6 +715,11 @@ struct vnet_ipfw { struct callout _ipfw_timeout; eventhandler_tag _ifaddr_event_tag; }; + +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +extern struct vnet_ipfw vnet_ipfw_0; +#endif #endif /* @@ -726,7 +730,6 @@ struct vnet_ipfw { #define VNET_IPFW(sym) VSYM(vnet_ipfw, sym) -#define V_fw_one_pass VNET_IPFW(fw_one_pass) #define V_fw_enable VNET_IPFW(fw_enable) #define V_fw6_enable VNET_IPFW(fw6_enable) #define V_set_disable VNET_IPFW(set_disable) Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_fw2.c Wed Dec 10 23:12:39 2008 (r185895) @@ -110,6 +110,12 @@ __FBSDID("$FreeBSD$"); #include +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +struct vnet_ipfw vnet_ipfw_0; +#endif +#endif + /* * set_disable contains one bit per set value (0..31). * If the bit is set, all rules with the corresponding set @@ -118,12 +124,13 @@ __FBSDID("$FreeBSD$"); * and CANNOT be disabled. * Rules in set RESVD_SET can only be deleted explicitly. */ +#ifdef VIMAGE_GLOBALS static u_int32_t set_disable; - static int fw_verbose; +static struct callout ipfw_timeout; +#endif static int verbose_limit; -static struct callout ipfw_timeout; static uma_zone_t ipfw_dyn_rule_zone; /* @@ -159,8 +166,10 @@ struct table_entry { u_int32_t value; }; -static int fw_debug = 1; -static int autoinc_step = 100; /* bounded to 1..1000 in add_rule() */ +#ifdef VIMAGE_GLOBALS +static int fw_debug; +static int autoinc_step; +#endif extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); @@ -171,7 +180,7 @@ SYSCTL_V_PROC(V_NET, vnet_ipfw, _net_ine ipfw_chg_hook, "I", "Enable ipfw"); SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, autoinc_step, CTLFLAG_RW, autoinc_step, 0, "Rule number autincrement step"); -SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, one_pass, +SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_RW | CTLFLAG_SECURE3, fw_one_pass, 0, "Only do a single pass through ipfw when using dummynet(4)"); SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, @@ -222,9 +231,11 @@ SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, t * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ -static ipfw_dyn_rule **ipfw_dyn_v = NULL; -static u_int32_t dyn_buckets = 256; /* must be power of 2 */ -static u_int32_t curr_dyn_buckets = 256; /* must be power of 2 */ +#ifdef VIMAGE_GLOBALS +static ipfw_dyn_rule **ipfw_dyn_v; +static u_int32_t dyn_buckets; +static u_int32_t curr_dyn_buckets; +#endif static struct mtx ipfw_dyn_mtx; /* mutex guarding dynamic rules */ #define IPFW_DYN_LOCK_INIT() \ @@ -237,12 +248,13 @@ static struct mtx ipfw_dyn_mtx; /* mute /* * Timeouts for various events in handing dynamic rules. */ -static u_int32_t dyn_ack_lifetime = 300; -static u_int32_t dyn_syn_lifetime = 20; -static u_int32_t dyn_fin_lifetime = 1; -static u_int32_t dyn_rst_lifetime = 1; -static u_int32_t dyn_udp_lifetime = 10; -static u_int32_t dyn_short_lifetime = 5; +#ifdef VIMAGE_GLOBALS +static u_int32_t dyn_ack_lifetime; +static u_int32_t dyn_syn_lifetime; +static u_int32_t dyn_fin_lifetime; +static u_int32_t dyn_rst_lifetime; +static u_int32_t dyn_udp_lifetime; +static u_int32_t dyn_short_lifetime; /* * Keepalives are sent if dyn_keepalive is set. They are sent every @@ -252,14 +264,15 @@ static u_int32_t dyn_short_lifetime = 5; * than dyn_keepalive_period. */ -static u_int32_t dyn_keepalive_interval = 20; -static u_int32_t dyn_keepalive_period = 5; -static u_int32_t dyn_keepalive = 1; /* do send keepalives */ +static u_int32_t dyn_keepalive_interval; +static u_int32_t dyn_keepalive_period; +static u_int32_t dyn_keepalive; static u_int32_t static_count; /* # of static rules */ static u_int32_t static_len; /* size in bytes of static rules */ -static u_int32_t dyn_count; /* # of dynamic rules */ -static u_int32_t dyn_max = 4096; /* max # of dynamic rules */ +static u_int32_t dyn_count; /* # of dynamic rules */ +static u_int32_t dyn_max; /* max # of dynamic rules */ +#endif /* VIMAGE_GLOBALS */ SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, dyn_buckets, CTLFLAG_RW, dyn_buckets, 0, "Number of dyn. buckets"); @@ -299,8 +312,9 @@ static struct sysctl_oid *ip6_fw_sysctl_ #endif /* INET6 */ #endif /* SYSCTL_NODE */ -static int fw_deny_unknown_exthdrs = 1; - +#ifdef VIMAGE_GLOBALS +static int fw_deny_unknown_exthdrs; +#endif /* * L3HDR maps an ipv4 pointer into a layer3 header pointer of type T @@ -748,7 +762,9 @@ send_reject6(struct ip_fw_args *args, in #endif /* INET6 */ +#ifdef VIMAGE_GLOBALS static u_int64_t norule_counter; /* counter for ipfw_log(NULL...) */ +#endif #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) @@ -4510,6 +4526,28 @@ ipfw_init(void) struct ip_fw default_rule; int error; + V_fw_debug = 1; + V_autoinc_step = 100; /* bounded to 1..1000 in add_rule() */ + + V_ipfw_dyn_v = NULL; + V_dyn_buckets = 256; /* must be power of 2 */ + V_curr_dyn_buckets = 256; /* must be power of 2 */ + + V_dyn_ack_lifetime = 300; + V_dyn_syn_lifetime = 20; + V_dyn_fin_lifetime = 1; + V_dyn_rst_lifetime = 1; + V_dyn_udp_lifetime = 10; + V_dyn_short_lifetime = 5; + + V_dyn_keepalive_interval = 20; + V_dyn_keepalive_period = 5; + V_dyn_keepalive = 1; /* do send keepalives */ + + V_dyn_max = 4096; /* max # of dynamic rules */ + + V_fw_deny_unknown_exthdrs = 1; + #ifdef INET6 /* Setup IPv6 fw sysctl tree. */ sysctl_ctx_init(&ip6_fw_sysctl_ctx); Modified: head/sys/netinet/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ip_fw_nat.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_fw_nat.c Wed Dec 10 23:12:39 2008 (r185895) @@ -71,7 +71,9 @@ MALLOC_DECLARE(M_IPFW); extern struct ip_fw_chain layer3_chain; +#ifdef VIMAGE_GLOBALS static eventhandler_tag ifaddr_event_tag; +#endif extern ipfw_nat_t *ipfw_nat_ptr; extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; Modified: head/sys/netinet/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ip_fw_pfil.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_fw_pfil.c Wed Dec 10 23:12:39 2008 (r185895) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_input.c Wed Dec 10 23:12:39 2008 (r185895) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -91,6 +93,12 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct ip) == 20); #endif +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +struct vnet_inet vnet_inet_0; +#endif +#endif + #ifdef VIMAGE_GLOBALS static int ipsendredirects; static int ip_checkinterface; @@ -170,7 +178,9 @@ SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROP SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_ip, IPCTL_STATS, stats, CTLFLAG_RW, ipstat, ipstat, "IP statistics (struct ipstat, netinet/ip_var.h)"); +#ifdef VIMAGE_GLOBALS static uma_zone_t ipq_zone; +#endif static struct mtx ipqlock; #define IPQ_LOCK() mtx_lock(&ipqlock) @@ -207,7 +217,9 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet */ ip_fw_chk_t *ip_fw_chk_ptr = NULL; ip_dn_io_t *ip_dn_io_ptr = NULL; -int fw_one_pass = 1; +#ifdef VIMAGE_GLOBALS +int fw_one_pass; +#endif static void ip_freef(struct ipqhead *, struct ipq *); @@ -246,6 +258,8 @@ ip_init(void) V_ipport_randomtime = 45; /* user controlled via sysctl */ V_ipport_stoprandom = 0; /* toggled by ipport_tick */ + V_fw_one_pass = 1; + #ifdef NOTYET /* XXX global static but not instantiated in this file */ V_ipfastforward_active = 0; Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_output.c Wed Dec 10 23:12:39 2008 (r185895) @@ -793,7 +793,6 @@ done: void in_delayed_cksum(struct mbuf *m) { - INIT_VNET_INET(curvnet); struct ip *ip; u_short csum, offset; Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/ip_var.h Wed Dec 10 23:12:39 2008 (r185895) @@ -177,6 +177,7 @@ struct sockopt; extern struct ipstat ipstat; extern u_short ip_id; /* ip packet ctr, for ids */ +extern int ip_do_randomid; extern int ip_defttl; /* default IP ttl */ extern int ipforwarding; /* ip forwarding */ #ifdef IPSTEALTH Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/libalias/alias_db.c Wed Dec 10 23:12:39 2008 (r185895) @@ -146,7 +146,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #else #include Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/raw_ip.c Wed Dec 10 23:12:39 2008 (r185895) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/sctp_os_bsd.h Wed Dec 10 23:12:39 2008 (r185895) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -96,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif /* INET6 */ @@ -152,13 +154,8 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); #define MOD_IPSEC ipsec /* then define the macro(s) that hook into the vimage macros */ -#if defined(__FreeBSD__) && __FreeBSD_version >= 800044 && defined(VIMAGE) -#if 0 -#define VSYMNAME(__MODULE) vnet_ ## __MODULE -#define MODULE_GLOBAL(__MODULE, __SYMBOL) VSYM(VSYMNAME(__MODULE), __SYMBOL) -#else +#if defined(__FreeBSD__) && __FreeBSD_version >= 800056 #define MODULE_GLOBAL(__MODULE, __SYMBOL) V_ ## __SYMBOL -#endif #else #define MODULE_GLOBAL(__MODULE, __SYMBOL) (__SYMBOL) #endif Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/sctp_pcb.c Wed Dec 10 23:12:39 2008 (r185895) @@ -59,11 +59,11 @@ SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 struct sockaddr_in6 tmp_a, tmp_b; memcpy(&tmp_a, a, sizeof(struct sockaddr_in6)); - if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone))) != 0) { + if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { return 0; } memcpy(&tmp_b, b, sizeof(struct sockaddr_in6)); - if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone))) != 0) { + if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { return 0; } return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr)); @@ -2008,7 +2008,7 @@ sctp_findassociation_addr(struct mbuf *m /* Get the scopes in properly to the sin6 addr's */ /* we probably don't need these operations */ (void)sa6_recoverscope(from6); - sa6_embedscope(from6, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone))); + sa6_embedscope(from6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); break; } #endif @@ -2049,7 +2049,7 @@ sctp_findassociation_addr(struct mbuf *m /* Get the scopes in properly to the sin6 addr's */ /* we probably don't need these operations */ (void)sa6_recoverscope(to6); - sa6_embedscope(to6, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone))); + sa6_embedscope(to6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); break; } #endif Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/tcp_sack.c Wed Dec 10 23:12:39 2008 (r185895) @@ -135,7 +135,6 @@ int tcp_sack_globalholes; SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW, 0, "TCP SACK"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_RW, tcp_do_sack, 0, "Enable/Disable TCP SACK support"); -TUNABLE_INT("net.inet.tcp.sack.enable", &tcp_do_sack); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_RW, tcp_sack_maxholes, 0, Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/tcp_subr.c Wed Dec 10 23:12:39 2008 (r185895) @@ -203,7 +203,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_t "Enable tcp_drain routine for extra help when low on mbufs"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, pcbcount, - CTLFLAG_RD, V_tcbinfo.ipi_count, 0, "Number of active PCBs"); + CTLFLAG_RD, tcbinfo.ipi_count, 0, "Number of active PCBs"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_RW, icmp_may_rst, 0, @@ -359,6 +359,8 @@ tcp_init(void) V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; + TUNABLE_INT_FETCH("net.inet.tcp.sack.enable", &V_tcp_do_sack); + INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp"); LIST_INIT(&V_tcb); V_tcbinfo.ipi_listhead = &V_tcb; Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/udp_usrreq.c Wed Dec 10 23:12:39 2008 (r185895) @@ -1198,7 +1198,7 @@ udp_connect(struct socket *so, struct so sin = (struct sockaddr_in *)nam; if (prison_remote_ip4(td->td_ucred, &sin->sin_addr) != 0) { INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&udbinfo); + INP_INFO_WUNLOCK(&V_udbinfo); return (EAFNOSUPPORT); } error = in_pcbconnect(inp, nam, td->td_ucred); Modified: head/sys/netinet/vinet.h ============================================================================== --- head/sys/netinet/vinet.h Wed Dec 10 22:50:11 2008 (r185894) +++ head/sys/netinet/vinet.h Wed Dec 10 23:12:39 2008 (r185895) @@ -194,8 +194,16 @@ struct vnet_inet { int _icmp_rfi; int _icmp_quotelen; int _icmpbmcastecho; + + int _fw_one_pass; }; +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +extern struct vnet_inet vnet_inet_0; +#endif +#endif + /* * Symbol translation macros */ @@ -212,6 +220,7 @@ struct vnet_inet { #define V_divcbinfo VNET_INET(divcbinfo) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 23:30:57 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EAAF106564A; Wed, 10 Dec 2008 23:30:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 248808FC08; Wed, 10 Dec 2008 23:30:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mBANS6FT021276; Wed, 10 Dec 2008 16:28:06 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 10 Dec 2008 16:28:17 -0700 (MST) Message-Id: <20081210.162817.474623206.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200812101945.mBAJjwn2040853@svn.freebsd.org> References: <200812101945.mBAJjwn2040853@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r185874 - 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: Wed, 10 Dec 2008 23:30:57 -0000 In message: <200812101945.mBAJjwn2040853@svn.freebsd.org> John Baldwin writes: : Author: jhb : Date: Wed Dec 10 19:45:58 2008 : New Revision: 185874 : URL: http://svn.freebsd.org/changeset/base/185874 : : Log: : Rather than using a char array with explicit assumptions about the layout : of 'struct osigevent' in 'struct aiocb', use int and void pointer spare : members that are identical to 'struct osigevent'. This is better from an alignment perspective for !intel architectures. warner : MFC after: 1 month : : Modified: : head/sys/sys/aio.h : : Modified: head/sys/sys/aio.h : ============================================================================== : --- head/sys/sys/aio.h Wed Dec 10 19:33:10 2008 (r185873) : +++ head/sys/sys/aio.h Wed Dec 10 19:45:58 2008 (r185874) : @@ -69,7 +69,8 @@ typedef struct aiocb { : off_t aio_offset; /* File offset for I/O */ : volatile void *aio_buf; /* I/O buffer in process space */ : size_t aio_nbytes; /* Number of bytes for I/O */ : - char __spare__[sizeof(int) * 2 + sizeof(void *)]; /* osigevent. */ : + int __spare__[2]; : + void *__spare2__; : int aio_lio_opcode; /* LIO opcode */ : int aio_reqprio; /* Request priority -- ignored */ : struct __aiocb_private _aiocb_private; : From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 00:30:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D73771065677; Thu, 11 Dec 2008 00:30:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2E628FC17; Thu, 11 Dec 2008 00:30:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB0UQ6c047516; Thu, 11 Dec 2008 00:30:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB0UQiK047515; Thu, 11 Dec 2008 00:30:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110030.mBB0UQiK047515@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 00:30: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: r185896 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 00:30:27 -0000 Author: yongari Date: Thu Dec 11 00:30:26 2008 New Revision: 185896 URL: http://svn.freebsd.org/changeset/base/185896 Log: Partly revert r185756. RTL8169SC doesn't like reduced delays in GMII access while Tx/Rx is in progress. Reported by: Jaakko Heinonen saunalahti DOT fi>, Anton Yuzhaninov citrin DOT ru> Tested by: Jaakko Heinonen saunalahti DOT fi> Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Dec 10 23:12:39 2008 (r185895) +++ head/sys/dev/re/if_re.c Thu Dec 11 00:30:26 2008 (r185896) @@ -419,10 +419,10 @@ re_gmii_readreg(device_t dev, int phy, i CSR_WRITE_4(sc, RL_PHYAR, reg << 16); for (i = 0; i < RL_TIMEOUT; i++) { - DELAY(30); rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; + DELAY(100); } if (i == RL_TIMEOUT) { @@ -446,10 +446,10 @@ re_gmii_writereg(device_t dev, int phy, (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); for (i = 0; i < RL_TIMEOUT; i++) { - DELAY(30); rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; + DELAY(100); } if (i == RL_TIMEOUT) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 00:46:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1A691065686; Thu, 11 Dec 2008 00:46:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9CF8FC1F; Thu, 11 Dec 2008 00:46:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB0k7Ts047844; Thu, 11 Dec 2008 00:46:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB0k7Xo047843; Thu, 11 Dec 2008 00:46:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110046.mBB0k7Xo047843@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 00:46: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: r185897 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 00:46:08 -0000 Author: yongari Date: Thu Dec 11 00:46:07 2008 New Revision: 185897 URL: http://svn.freebsd.org/changeset/base/185897 Log: Always put controller into known state before device intialization. While here remove re_reset calls invoked in system error case as controller reset is always done in device initialization. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Dec 11 00:30:26 2008 (r185896) +++ head/sys/dev/re/if_re.c Thu Dec 11 00:46:07 2008 (r185897) @@ -756,7 +756,6 @@ re_diag(struct rl_softc *sc) ifp->if_flags |= IFF_PROMISC; sc->rl_testmode = 1; - re_reset(sc); re_init_locked(sc); sc->rl_flags |= RL_FLAG_LINK; if (sc->rl_type == RL_8169) @@ -2091,10 +2090,8 @@ re_poll_locked(struct ifnet *ifp, enum p * XXX check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - re_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) re_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -2158,10 +2155,8 @@ re_int_task(void *arg, int npending) RL_ISR_TX_ERR|RL_ISR_TX_DESC_UNAVAIL)) re_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - re_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) re_init_locked(sc); - } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2482,6 +2477,9 @@ re_init_locked(struct rl_softc *sc) */ re_stop(sc); + /* Put controller into known state. */ + re_reset(sc); + /* * Enable C+ RX and TX mode, as well as VLAN stripping and * RX checksum offload. We must configure the C+ register From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 00:46:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 924E9106567A; Thu, 11 Dec 2008 00:46:25 +0000 (UTC) (envelope-from prvs=julian=2245e07b3@elischer.org) Received: from smtp-outbound.ironport.com (smtp-outbound.ironport.com [63.251.108.112]) by mx1.freebsd.org (Postfix) with ESMTP id 730AE8FC1C; Thu, 11 Dec 2008 00:46:25 +0000 (UTC) (envelope-from prvs=julian=2245e07b3@elischer.org) Received: from unknown (HELO julian-mac.elischer.org) ([10.251.60.120]) by smtp-outbound.ironport.com with ESMTP; 10 Dec 2008 16:17:46 -0800 Message-ID: <49405C2A.7070203@elischer.org> Date: Wed, 10 Dec 2008 16:17:46 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Marko Zec References: <200812102312.mBANCeaE045870@svn.freebsd.org> In-Reply-To: <200812102312.mBANCeaE045870@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: r185895 - in head/sys: conf contrib/pf/net kern net netgraph netinet netinet/libalias netinet6 netipsec 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, 11 Dec 2008 00:46:25 -0000 Marko Zec wrote: > Author: zec > Date: Wed Dec 10 23:12:39 2008 > New Revision: 185895 > URL: http://svn.freebsd.org/changeset/base/185895 > congratulations. this is a big step. The first step where we introduce real physical change. Now we need people to help look for problems and do benchmarking. it is possible at this stage that re-ordering the fields in the various vinet/vnet structures may make noticeable performance changes due to cache line effects. it would be cool if we could look at this at this stage. From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 00:58:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1621065675; Thu, 11 Dec 2008 00:58:06 +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 36D998FC12; Thu, 11 Dec 2008 00:58:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB0w6Zi048103; Thu, 11 Dec 2008 00:58:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB0w6HD048102; Thu, 11 Dec 2008 00:58:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812110058.mBB0w6HD048102@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 00:58: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: r185898 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 00:58:06 -0000 Author: bz Date: Thu Dec 11 00:58:05 2008 New Revision: 185898 URL: http://svn.freebsd.org/changeset/base/185898 Log: Add 32-bit compat support for AIO. jhb probably forgot to commit this file with r185878 and will want to review this. It unbreaks the build here. Obtained from: p4 //depot/user/jhb/lock/compat/freebsd32/freebsd32_signal.h#2 Modified: head/sys/compat/freebsd32/freebsd32_signal.h Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Thu Dec 11 00:46:07 2008 (r185897) +++ head/sys/compat/freebsd32/freebsd32_signal.h Thu Dec 11 00:58:05 2008 (r185898) @@ -36,6 +36,9 @@ struct sigaltstack32 { }; union sigval32 { + int sival_int; + u_int32_t sival_ptr; + /* 6.0 compatibility */ int sigval_int; u_int32_t sigval_ptr; }; @@ -70,6 +73,29 @@ struct siginfo32 { } _reason; }; +struct osigevent32 { + int sigev_notify; /* Notification type */ + union { + int __sigev_signo; /* Signal number */ + int __sigev_notify_kqueue; + } __sigev_u; + union sigval32 sigev_value; /* Signal value */ +}; + +struct sigevent32 { + int sigev_notify; /* Notification type */ + int sigev_signo; /* Signal number */ + union sigval32 sigev_value; /* Signal value */ + union { + __lwpid_t _threadid; + struct { + uint32_t _function; + uint32_t _attribute; + } _sigev_thread; + uint32_t __spare__[8]; + } _sigev_un; +}; + void siginfo_to_siginfo32(siginfo_t *src, struct siginfo32 *dst); #endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 01:04:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE3F11065670; Thu, 11 Dec 2008 01:04:26 +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 996D48FC1E; Thu, 11 Dec 2008 01:04:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB14Q1C048265; Thu, 11 Dec 2008 01:04:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB14Qp0048262; Thu, 11 Dec 2008 01:04:26 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812110104.mBB14Qp0048262@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 01:04: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: r185899 - in head: sys/kern usr.sbin/jexec usr.sbin/jls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 01:04:26 -0000 Author: bz Date: Thu Dec 11 01:04:25 2008 New Revision: 185899 URL: http://svn.freebsd.org/changeset/base/185899 Log: Correctly check the number of prison states to not access anything outside the prison_states array. When checking if there is a name configured for the prison, check the first character to not be '\0' instead of checking if the char array is present, which it always is. Note, that this is different for the *jailname in the syscall. Found with: Coverity Prevent(tm) CID: 4156, 4155 MFC after: 4 weeks (just that I get the mail) Modified: head/sys/kern/kern_jail.c head/usr.sbin/jexec/jexec.c head/usr.sbin/jls/jls.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Dec 11 00:58:05 2008 (r185898) +++ head/sys/kern/kern_jail.c Thu Dec 11 01:04:25 2008 (r185899) @@ -1574,13 +1574,13 @@ DB_SHOW_COMMAND(jails, db_show_jails) pr->pr_ip4s, pr->pr_ip6s); db_printf("%6s %-29.29s %.74s\n", "", pr->pr_host, pr->pr_path); - if (pr->pr_state < 0 || pr->pr_state > (int)((sizeof( + if (pr->pr_state < 0 || pr->pr_state >= (int)((sizeof( prison_states) / sizeof(struct prison_state)))) state = "(bogus)"; else state = prison_states[pr->pr_state].state_name; db_printf("%6s %-29.29s %.74s\n", - "", (pr->pr_name != NULL) ? pr->pr_name : "", state); + "", (pr->pr_name[0] != '\0') ? pr->pr_name : "", state); db_printf("%6s %-6d\n", "", pr->pr_cpuset->cs_id); #ifdef INET Modified: head/usr.sbin/jexec/jexec.c ============================================================================== --- head/usr.sbin/jexec/jexec.c Thu Dec 11 00:58:05 2008 (r185898) +++ head/usr.sbin/jexec/jexec.c Thu Dec 11 01:04:25 2008 (r185899) @@ -80,13 +80,13 @@ char *lookup_xprison_v3(void *p, char *e ok = 1; /* Jail state and name. */ - if (xp->pr_state < 0 || xp->pr_state > + if (xp->pr_state < 0 || xp->pr_state >= (int)((sizeof(prison_states) / sizeof(struct prison_state)))) errx(1, "Invalid jail state."); else if (xp->pr_state != PRISON_STATE_ALIVE) ok = 0; if (jailname != NULL) { - if (xp->pr_name == NULL) + if (xp->pr_name[0] == '\0') ok = 0; else if (strcmp(jailname, xp->pr_name) != 0) ok = 0; Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Thu Dec 11 00:58:05 2008 (r185898) +++ head/usr.sbin/jls/jls.c Thu Dec 11 01:04:25 2008 (r185899) @@ -86,7 +86,7 @@ char *print_xprison_v3(void *p, char *en errx(1, "Invalid length for jail"); xp = (struct xprison *)p; - if (xp->pr_state < 0 || xp->pr_state > (int) + if (xp->pr_state < 0 || xp->pr_state >= (int) ((sizeof(prison_states) / sizeof(struct prison_state)))) state = "(bogus)"; else @@ -110,7 +110,7 @@ char *print_xprison_v3(void *p, char *en /* Jail state and name. */ if (flags & FLAG_V) printf("%6s %-29.29s %.74s\n", - "", (xp->pr_name != NULL) ? xp->pr_name : "", state); + "", (xp->pr_name[0] != '\0') ? xp->pr_name : "", state); /* cpusetid. */ if (flags & FLAG_V) From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 01:26:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DB9C1065670; Thu, 11 Dec 2008 01:26:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 896498FC12; Thu, 11 Dec 2008 01:26:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB1QIuv048694; Thu, 11 Dec 2008 01:26:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB1QISC048692; Thu, 11 Dec 2008 01:26:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110126.mBB1QISC048692@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 01:26: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: r185900 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 01:26:18 -0000 Author: yongari Date: Thu Dec 11 01:26:18 2008 New Revision: 185900 URL: http://svn.freebsd.org/changeset/base/185900 Log: Newer RealTek controllers requires setting stop request bit to terminate active Tx/Rx operation. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Dec 11 01:04:25 2008 (r185899) +++ head/sys/dev/re/if_re.c Thu Dec 11 01:26:18 2008 (r185900) @@ -1244,7 +1244,7 @@ re_attach(device_t dev) case RL_HWREV_8102EL: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | - RL_FLAG_MACSTAT | RL_FLAG_FASTETHER; + RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: @@ -1257,7 +1257,8 @@ re_attach(device_t dev) case RL_HWREV_8168CP: case RL_HWREV_8168D: sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT; + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_CMDSTOP; /* * These controllers support jumbo frame but it seems * that enabling it requires touching additional magic @@ -2868,7 +2869,12 @@ re_stop(struct rl_softc *sc) callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - CSR_WRITE_1(sc, RL_COMMAND, 0x00); + if ((sc->rl_flags & RL_FLAG_CMDSTOP) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_STOPREQ | RL_CMD_TX_ENB | + RL_CMD_RX_ENB); + else + CSR_WRITE_1(sc, RL_COMMAND, 0x00); + DELAY(1000); CSR_WRITE_2(sc, RL_IMR, 0x0000); CSR_WRITE_2(sc, RL_ISR, 0xFFFF); Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Dec 11 01:04:25 2008 (r185899) +++ head/sys/pci/if_rlreg.h Thu Dec 11 01:26:18 2008 (r185900) @@ -308,6 +308,7 @@ #define RL_CMD_TX_ENB 0x0004 #define RL_CMD_RX_ENB 0x0008 #define RL_CMD_RESET 0x0010 +#define RL_CMD_STOPREQ 0x0080 /* * Twister register values. These are completely undocumented and derived @@ -883,6 +884,7 @@ struct rl_softc { #define RL_FLAG_DESCV2 0x0040 #define RL_FLAG_MACSTAT 0x0080 #define RL_FLAG_FASTETHER 0x0100 +#define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_LINK 0x8000 }; From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 01:41:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9A151065673; Thu, 11 Dec 2008 01:41:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 958F58FC1A; Thu, 11 Dec 2008 01:41:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB1fcEK048994; Thu, 11 Dec 2008 01:41:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB1fc5K048992; Thu, 11 Dec 2008 01:41:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110141.mBB1fc5K048992@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 01: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: r185901 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 01:41:38 -0000 Author: yongari Date: Thu Dec 11 01:41:38 2008 New Revision: 185901 URL: http://svn.freebsd.org/changeset/base/185901 Log: Don't access undocumented register 0x82 on controllers that have no such register. While here clear undocumented PHY register 0x0B for RTL8110S. Obtained from: RealTek FreeBSD driver Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Dec 11 01:26:18 2008 (r185900) +++ head/sys/dev/re/if_re.c Thu Dec 11 01:41:38 2008 (r185901) @@ -700,7 +700,12 @@ re_reset(struct rl_softc *sc) if (i == RL_TIMEOUT) device_printf(sc->rl_dev, "reset never completed!\n"); - CSR_WRITE_1(sc, 0x82, 1); + if ((sc->rl_flags & RL_FLAG_PHY8169) != 0) + CSR_WRITE_1(sc, 0x82, 1); + if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) { + CSR_WRITE_1(sc, 0x82, 1); + re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0); + } } #ifdef RE_DIAG @@ -1235,6 +1240,9 @@ re_attach(device_t dev) case RL_HWREV_8139CPLUS: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; + case RL_HWREV_8110S: + sc->rl_flags |= RL_FLAG_PHY8110S; + break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | @@ -1271,10 +1279,14 @@ re_attach(device_t dev) */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; + case RL_HWREV_8169: + case RL_HWREV_8169S: + sc->rl_flags |= RL_FLAG_PHY8169; + break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SC: case RL_HWREV_8169_8110SBL: - sc->rl_flags |= RL_FLAG_PHYWAKE; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169; break; default: break; Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Dec 11 01:26:18 2008 (r185900) +++ head/sys/pci/if_rlreg.h Thu Dec 11 01:41:38 2008 (r185901) @@ -885,6 +885,8 @@ struct rl_softc { #define RL_FLAG_MACSTAT 0x0080 #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 +#define RL_FLAG_PHY8169 0x0400 +#define RL_FLAG_PHY8110S 0x0800 #define RL_FLAG_LINK 0x8000 }; From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 02:23:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6E21065676; Thu, 11 Dec 2008 02:23:49 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 780188FC1C; Thu, 11 Dec 2008 02:23:49 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB2NnVj049844; Thu, 11 Dec 2008 02:23:49 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB2NnjW049843; Thu, 11 Dec 2008 02:23:49 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200812110223.mBB2NnjW049843@svn.freebsd.org> From: Paul Saab Date: Thu, 11 Dec 2008 02:23: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: r185902 - head/sys/boot/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, 11 Dec 2008 02:23:49 -0000 Author: ps Date: Thu Dec 11 02:23:49 2008 New Revision: 185902 URL: http://svn.freebsd.org/changeset/base/185902 Log: Avoid a double free in devopen by not freeing the device structure in zfs_dev_open. This stops a panic in the loader when trying to read from a zfs device and no zfs devices exist. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Thu Dec 11 01:41:38 2008 (r185901) +++ head/sys/boot/zfs/zfs.c Thu Dec 11 02:23:49 2008 (r185902) @@ -474,7 +474,6 @@ zfs_dev_open(struct open_file *f, ...) * the pool. */ unit = dev->d_unit; - free(dev); i = 0; STAILQ_FOREACH(spa, &zfs_pools, spa_link) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 02:24:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B42C1065749; Thu, 11 Dec 2008 02:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275DD8FC12; Thu, 11 Dec 2008 02:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB2OBi9049892; Thu, 11 Dec 2008 02:24:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB2OBns049890; Thu, 11 Dec 2008 02:24:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110224.mBB2OBns049890@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 02:24: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: r185903 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 02:24:12 -0000 Author: yongari Date: Thu Dec 11 02:24:11 2008 New Revision: 185903 URL: http://svn.freebsd.org/changeset/base/185903 Log: Make WOL work on RTL8168B. This controller seems to require explicit command to enable Rx MAC prior to entering D3. Tested by: Cyrus Rahman gmail DOT com> Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Dec 11 02:23:49 2008 (r185902) +++ head/sys/dev/re/if_re.c Thu Dec 11 02:24:11 2008 (r185903) @@ -1256,6 +1256,8 @@ re_attach(device_t dev) break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: + sc->rl_flags |= RL_FLAG_WOLRXENB; + /* FALLTHROUGH */ case RL_HWREV_8168_SPIN3: sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; @@ -3016,6 +3018,9 @@ re_setwol(struct rl_softc *sc) return; ifp = sc->rl_ifp; + if ((ifp->if_capenable & IFCAP_WOL) != 0 && + (sc->rl_flags & RL_FLAG_WOLRXENB) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); /* Enable config register write. */ CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Dec 11 02:23:49 2008 (r185902) +++ head/sys/pci/if_rlreg.h Thu Dec 11 02:24:11 2008 (r185903) @@ -887,6 +887,7 @@ struct rl_softc { #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_PHY8169 0x0400 #define RL_FLAG_PHY8110S 0x0800 +#define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_LINK 0x8000 }; From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 02:39:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA0E106564A; Thu, 11 Dec 2008 02:39:28 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AADE8FC1A; Thu, 11 Dec 2008 02:39:28 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB2dSkL050590; Thu, 11 Dec 2008 02:39:28 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB2dSnv050588; Thu, 11 Dec 2008 02:39:28 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200812110239.mBB2dSnv050588@svn.freebsd.org> From: David Schultz Date: Thu, 11 Dec 2008 02:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185904 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 02:39:28 -0000 Author: das Date: Thu Dec 11 02:39:27 2008 New Revision: 185904 URL: http://svn.freebsd.org/changeset/base/185904 Log: Consolidate some variable initializations. No substantive change. Modified: head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Thu Dec 11 02:24:11 2008 (r185903) +++ head/lib/libc/stdio/vfprintf.c Thu Dec 11 02:39:27 2008 (r185904) @@ -567,13 +567,6 @@ __vfprintf(FILE *fp, const char *fmt0, v if (__use_xprintf > 0) return (__xvprintf(fp, fmt0, ap)); - thousands_sep = '\0'; - grouping = NULL; - convbuf = NULL; -#ifndef NO_FLOATING_POINT - dtoaresult = NULL; - decimal_point = localeconv()->decimal_point; -#endif /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ if (prepwrite(fp) != 0) return (EOF); @@ -583,6 +576,9 @@ __vfprintf(FILE *fp, const char *fmt0, v fp->_file >= 0) return (__sbprintf(fp, fmt0, ap)); + thousands_sep = '\0'; + grouping = NULL; + convbuf = NULL; fmt = (char *)fmt0; argtable = NULL; nextarg = 1; @@ -591,6 +587,10 @@ __vfprintf(FILE *fp, const char *fmt0, v uio.uio_resid = 0; uio.uio_iovcnt = 0; ret = 0; +#ifndef NO_FLOATING_POINT + dtoaresult = NULL; + decimal_point = localeconv()->decimal_point; +#endif /* * Scan the format for conversions (`%' character). Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Thu Dec 11 02:24:11 2008 (r185903) +++ head/lib/libc/stdio/vfwprintf.c Thu Dec 11 02:39:27 2008 (r185904) @@ -575,12 +575,6 @@ __vfwprintf(FILE *fp, const wchar_t *fmt } - thousands_sep = '\0'; - grouping = NULL; -#ifndef NO_FLOATING_POINT - decimal_point = localeconv()->decimal_point; -#endif - convbuf = NULL; /* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */ if (prepwrite(fp) != 0) return (EOF); @@ -590,11 +584,17 @@ __vfwprintf(FILE *fp, const wchar_t *fmt fp->_file >= 0) return (__sbprintf(fp, fmt0, ap)); + thousands_sep = '\0'; + grouping = NULL; + convbuf = NULL; fmt = (wchar_t *)fmt0; argtable = NULL; nextarg = 1; va_copy(orgap, ap); ret = 0; +#ifndef NO_FLOATING_POINT + decimal_point = localeconv()->decimal_point; +#endif /* * Scan the format for conversions (`%' character). From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 04:03:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEAF5106564A; Thu, 11 Dec 2008 04:03:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9358FC0C; Thu, 11 Dec 2008 04:03:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB43D2Y053536; Thu, 11 Dec 2008 04:03:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB43D1J053535; Thu, 11 Dec 2008 04:03:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812110403.mBB43D1J053535@svn.freebsd.org> From: Sam Leffler Date: Thu, 11 Dec 2008 04:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185906 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 04:03:14 -0000 Author: sam Date: Thu Dec 11 04:03:13 2008 New Revision: 185906 URL: http://svn.freebsd.org/changeset/base/185906 Log: add missing break Coverity ID: 4151 Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Thu Dec 11 02:47:41 2008 (r185905) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Thu Dec 11 04:03:13 2008 (r185906) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v14.c,v 1.4 2008/11/10 19:04:26 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -54,6 +54,7 @@ v14EepromGet(struct ath_hal *ah, int par __func__, ath_hal_ether_sprintf(macaddr)); return HAL_EEBADMAC; } + return HAL_OK; case AR_EEP_REGDMN_0: return pBase->regDmn[0]; case AR_EEP_REGDMN_1: From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 04:03:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EBEB106567A; Thu, 11 Dec 2008 04:03:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB7B8FC1E; Thu, 11 Dec 2008 04:03:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB43pIR053585; Thu, 11 Dec 2008 04:03:51 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB43p2N053584; Thu, 11 Dec 2008 04:03:51 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812110403.mBB43p2N053584@svn.freebsd.org> From: Sam Leffler Date: Thu, 11 Dec 2008 04:03: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: r185907 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 04:03:51 -0000 Author: sam Date: Thu Dec 11 04:03:50 2008 New Revision: 185907 URL: http://svn.freebsd.org/changeset/base/185907 Log: add missing break Coverity ID: 4159 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu Dec 11 04:03:13 2008 (r185906) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu Dec 11 04:03:50 2008 (r185907) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_misc.c,v 1.12 2008/11/27 22:30:00 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -803,6 +803,7 @@ ar5212GetCapability(struct ath_hal *ah, return (ahp->ah_staId1Defaults & AR_STA_ID1_CRPT_MIC_ENABLE) ? HAL_OK : HAL_ENXIO; } + return HAL_EINVAL; case HAL_CAP_TKIP_SPLIT: /* hardware TKIP uses split keys */ switch (capability) { case 0: /* hardware capability */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 06:27:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961621065670; Thu, 11 Dec 2008 06:27:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 848C08FC13; Thu, 11 Dec 2008 06:27:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB6RJDQ056417; Thu, 11 Dec 2008 06:27:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB6RJFS056416; Thu, 11 Dec 2008 06:27:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110627.mBB6RJFS056416@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 06:27: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: r185910 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 06:27:19 -0000 Author: imp Date: Thu Dec 11 06:27:18 2008 New Revision: 185910 URL: http://svn.freebsd.org/changeset/base/185910 Log: Update to the interrupt handling code: o Try to be smarter about reading the ExCA CSC register. Now, we only do it for 16-bit cards. Add some experimental code to treat it like a power interrupt, but I'm not 100% sure that I like it. It may be removed upon further testing. It seemed to help in one test case, but the evidence may be inconclusive. This may be beneficial for cleaning up exca_reset and exca_wait_ready. o Check for CSTS events on the socket event register. We ask for it when we're powering up a card, but I don't think we're otherwise using it. Just ACK the interrupt for now. In theory, we can use it instead of the busy wait we do in cbb_cardbus_reset. More research is necessary to see if we can optimize things there when we're waiting for the DEVVENDOR register to become valid. o Rework the comments a bit. Minor tidying up. Etc. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Thu Dec 11 05:56:47 2008 (r185909) +++ head/sys/dev/pccbb/pccbb_pci.c Thu Dec 11 06:27:18 2008 (r185910) @@ -682,40 +682,67 @@ cbb_pci_shutdown(device_t brdev) return (0); } -#define DELTA (CBB_SOCKET_MASK_CD) static int cbb_pci_filt(void *arg) { struct cbb_softc *sc = arg; uint32_t sockevent; + uint8_t csc; int retval = FILTER_STRAY; /* - * Read the socket event. Sometimes, the theory goes, the PCI - * bus is so loaded that it cannot satisfy the read request, so - * we get garbage back from the following read. We have to filter - * out the garbage so that we don't spontaneously reset the card - * under high load. PCI isn't supposed to act like this. No doubt - * this is a bug in the PCI bridge chipset (or cbb brige) that's being - * used in certain amd64 laptops today. Work around the issue by - * assuming that any bits we don't know about being set means that - * we got garbage. + * Some chips also require us to read the old ExCA registe for card + * status change when we route CSC vis PCI. This isn't supposed to be + * required, but it clears the interrupt state on some chipsets. + * Maybe there's a setting that would obviate its need. Maybe we + * should test the status bits and deal with them, but so far we've + * not found any machines that don't also give us the socket status + * indication above. + * + * This call used to be unconditional. However, further research + * suggests that we hit this condition when the card READY interrupt + * fired. So now we only read it for 16-bit cards, and we only claim + * the interrupt if READY is set. If this still causes problems, then + * the next step would be to read this if we have a 16-bit card *OR* + * we have no card. We treat the READY signal as if it were the power + * completion signal. Some bridges may double signal things here, bit + * signalling twice should be OK since we only sleep on the powerintr + * in one place and a double wakeup would be benign there. + */ + if (sc->flags & CBB_16BIT_CARD) { + csc = exca_getb(&sc->exca[0], EXCA_CSC); + if (csc & EXCA_CSC_READY) { + atomic_add_int(&sc->powerintr, 1); + wakeup((void *)&sc->powerintr); + retval = FILTER_HANDLED; + } + } + + /* + * Read the socket event. Sometimes, the theory goes, the PCI bus is + * so loaded that it cannot satisfy the read request, so we get + * garbage back from the following read. We have to filter out the + * garbage so that we don't spontaneously reset the card under high + * load. PCI isn't supposed to act like this. No doubt this is a bug + * in the PCI bridge chipset (or cbb brige) that's being used in + * certain amd64 laptops today. Work around the issue by assuming + * that any bits we don't know about being set means that we got + * garbage. */ sockevent = cbb_get(sc, CBB_SOCKET_EVENT); if (sockevent != 0 && (sockevent & ~CBB_SOCKET_EVENT_VALID_MASK) == 0) { /* - * If anything has happened to the socket, we assume that - * the card is no longer OK, and we shouldn't call its - * ISR. We set cardok as soon as we've attached the - * card. This helps in a noisy eject, which happens - * all too often when users are ejecting their PC Cards. + * If anything has happened to the socket, we assume that the + * card is no longer OK, and we shouldn't call its ISR. We + * set cardok as soon as we've attached the card. This helps + * in a noisy eject, which happens all too often when users + * are ejecting their PC Cards. * - * We use this method in preference to checking to see if - * the card is still there because the check suffers from - * a race condition in the bouncing case. Prior versions - * of the pccard software used a similar trick and achieved - * excellent results. + * We use this method in preference to checking to see if the + * card is still there because the check suffers from a race + * condition in the bouncing case. */ +#define DELTA (CBB_SOCKET_MASK_CD) if (sockevent & DELTA) { cbb_clrb(sc, CBB_SOCKET_MASK, DELTA); cbb_set(sc, CBB_SOCKET_EVENT, DELTA); @@ -723,9 +750,11 @@ cbb_pci_filt(void *arg) cbb_disable_func_intr(sc); wakeup(&sc->intrhand); } +#undef DELTA + /* - * If we get a power interrupt, wakeup anybody that might - * be waiting for one. + * Wakeup anybody waiting for a power interrupt. We have to + * use atomic_add_int for wakups on other cores. */ if (sockevent & CBB_SOCKET_EVENT_POWER) { cbb_clrb(sc, CBB_SOCKET_MASK, CBB_SOCKET_EVENT_POWER); @@ -733,21 +762,15 @@ cbb_pci_filt(void *arg) atomic_add_int(&sc->powerintr, 1); wakeup((void *)&sc->powerintr); } + + /* + * Status change interrupts aren't presently used in the + * rest of the driver. For now, just ACK them. + */ + if (sockevent & CBB_SOCKET_EVENT_CSTS) + cbb_set(sc, CBB_SOCKET_EVENT, CBB_SOCKET_EVENT_CSTS); retval = FILTER_HANDLED; } - /* - * Some chips also require us to read the old ExCA registe for - * card status change when we route CSC vis PCI. This isn't supposed - * to be required, but it clears the interrupt state on some chipsets. - * Maybe there's a setting that would obviate its need. Maybe we - * should test the status bits and deal with them, but so far we've - * not found any machines that don't also give us the socket status - * indication above. - * - * We have to call this unconditionally because some bridges deliver - * the event independent of the CBB_SOCKET_EVENT_CD above. - */ - exca_getb(&sc->exca[0], EXCA_CSC); return retval; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 06:54:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030461065676; Thu, 11 Dec 2008 06:54:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E76BC8FC16; Thu, 11 Dec 2008 06:54:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB6saxr056967; Thu, 11 Dec 2008 06:54:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB6saef056966; Thu, 11 Dec 2008 06:54:36 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200812110654.mBB6saef056966@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 11 Dec 2008 06:54: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: r185912 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 06:54:37 -0000 Author: des Date: Thu Dec 11 06:54:36 2008 New Revision: 185912 URL: http://svn.freebsd.org/changeset/base/185912 Log: Apply the same defaults to https as to http. Submitted by: Mike Tancsa MFC after: 1 week Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Thu Dec 11 06:53:53 2008 (r185911) +++ head/usr.bin/fetch/fetch.c Thu Dec 11 06:54:36 2008 (r185912) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -375,7 +375,8 @@ fetch(char *URL, const char *path) } /* HTTP specific flags */ - if (strcmp(url->scheme, SCHEME_HTTP) == 0) { + if (strcmp(url->scheme, SCHEME_HTTP) == 0 || + strcmp(url->scheme, SCHEME_HTTPS) == 0) { if (d_flag) strcat(flags, "d"); if (A_flag) From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 07:00:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 251A61065676; Thu, 11 Dec 2008 07:00:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F188FC13; Thu, 11 Dec 2008 07:00:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB70Nuu057279; Thu, 11 Dec 2008 07:00:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB70N6t057278; Thu, 11 Dec 2008 07:00:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110700.mBB70N6t057278@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 07:00: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: r185915 - head/sys/mips/adm5120 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 07:00:24 -0000 Author: imp Date: Thu Dec 11 07:00:23 2008 New Revision: 185915 URL: http://svn.freebsd.org/changeset/base/185915 Log: Remove redundant assignment. Modified: head/sys/mips/adm5120/adm5120_machdep.c Modified: head/sys/mips/adm5120/adm5120_machdep.c ============================================================================== --- head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 11 06:57:27 2008 (r185914) +++ head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 11 07:00:23 2008 (r185915) @@ -150,8 +150,5 @@ platform_start(__register_t a0 __unused, cninit(); mips_init(); - /* Set counter_freq for tick_init_params() */ - platform_counter_freq = 175 * 1000 * 1000; - mips_timer_init_params(platform_counter_freq, 0); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 08:15:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DB191065680; Thu, 11 Dec 2008 08:15:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7168FC25; Thu, 11 Dec 2008 08:15:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB8FFXX059056; Thu, 11 Dec 2008 08:15:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB8FFOL059053; Thu, 11 Dec 2008 08:15:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110815.mBB8FFOL059053@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 08:15: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: r185922 - in head/gnu/usr.bin/binutils/as: . mips-freebsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 08:15:15 -0000 Author: imp Date: Thu Dec 11 08:15:14 2008 New Revision: 185922 URL: http://svn.freebsd.org/changeset/base/185922 Log: Push mips support for as into the tree. Added: head/gnu/usr.bin/binutils/as/mips-freebsd/ head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h (contents, props changed) head/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h (contents, props changed) Modified: head/gnu/usr.bin/binutils/as/Makefile Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Thu Dec 11 08:08:28 2008 (r185921) +++ head/gnu/usr.bin/binutils/as/Makefile Thu Dec 11 08:15:14 2008 (r185922) @@ -20,6 +20,10 @@ SRCS+= app.c as.c atof-generic.c atof-ie # DEO: why not used? #SRCS+= itbl-ops.c +.if ${TARGET_ARCH} == "mips" +SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l +.endif + .if ${TARGET_ARCH} == "amd64" SRCS+= tc-i386.c .elif ${TARGET_ARCH} == "powerpc" Added: head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h Thu Dec 11 08:15:14 2008 (r185922) @@ -0,0 +1,19 @@ +/* $FreeBSD$ */ + +#include "itbl-mips.h" + +/* Choose a default ABI for MIPS targets. */ +/* XXX: Where should this be ? */ +#define MIPS_DEFAULT_ABI NO_ABI + +/* Default CPU for MIPS targets. */ +#define MIPS_CPU_STRING_DEFAULT "from-abi" + +/* Generate 64-bit code by default on MIPS targets. */ +#define MIPS_DEFAULT_64BIT 0 + +/* Allow use of E_MIPS_ABI_O32 on MIPS targets. */ +#define USE_E_MIPS_ABI_O32 1 + +/* Use traditional mips */ +#define TE_TMIPS 1 Added: head/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h Thu Dec 11 08:15:14 2008 (r185922) @@ -0,0 +1,4 @@ +/* $FreeBSD$ */ +#define TE_TMIPS 1 + +#include "tc-mips.h" From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 08:18:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEEA1106564A; Thu, 11 Dec 2008 08:18:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFFD78FC1B; Thu, 11 Dec 2008 08:18:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB8IjOf059174; Thu, 11 Dec 2008 08:18:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB8IjpT059169; Thu, 11 Dec 2008 08:18:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110818.mBB8IjpT059169@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 08:18: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: r185923 - head/gnu/usr.bin/binutils/ld X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 08:18:45 -0000 Author: imp Date: Thu Dec 11 08:18:45 2008 New Revision: 185923 URL: http://svn.freebsd.org/changeset/base/185923 Log: Push mips support for ld into the tree. Added: head/gnu/usr.bin/binutils/ld/Makefile.mips (contents, props changed) head/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh (contents, props changed) head/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh (contents, props changed) head/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh (contents, props changed) head/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh (contents, props changed) Added: head/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/ld/Makefile.mips Thu Dec 11 08:18:45 2008 (r185923) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +#xxxIMPxxx: size? +#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention +# of mipsel and mips. +_sz?=32 +.if defined(TARGET_BIG_ENDIAN) +NATIVE_EMULATION=elf${_sz}btsmip_fbsd +.else +NATIVE_EMULATION=elf${_sz}ltsmip_fbsd +.endif + +SRCS+= e${NATIVE_EMULATION}.c +CLEANFILES+= e${NATIVE_EMULATION}.c + +# nb: elf32 handles both elf32 and elf64 targets +e${NATIVE_EMULATION}.c: ${.CURDIR}/${NATIVE_EMULATION}.sh emultempl/elf32.em \ + scripttempl/elf.sc genscripts.sh stringify.sed + sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \ + ${TOOLS_PREFIX}/usr \ + ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ + ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} \ + ${.CURDIR}/${NATIVE_EMULATION}.sh + Added: head/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh Thu Dec 11 08:18:45 2008 (r185923) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf32btsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: head/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh Thu Dec 11 08:18:45 2008 (r185923) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf32ltsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: head/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh Thu Dec 11 08:18:45 2008 (r185923) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf64btsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: head/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh Thu Dec 11 08:18:45 2008 (r185923) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf64ltsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 08:20:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1BAE1065672; Thu, 11 Dec 2008 08:20:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C2F8FC1C; Thu, 11 Dec 2008 08:20:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB8KYcK059242; Thu, 11 Dec 2008 08:20:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB8KYFt059239; Thu, 11 Dec 2008 08:20:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110820.mBB8KYFt059239@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 08:20: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: r185924 - in head/gnu/usr.bin/binutils: libbfd libopcodes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 08:20:34 -0000 Author: imp Date: Thu Dec 11 08:20:34 2008 New Revision: 185924 URL: http://svn.freebsd.org/changeset/base/185924 Log: Push mips support into the tree. Added: head/gnu/usr.bin/binutils/libbfd/Makefile.mips (contents, props changed) head/gnu/usr.bin/binutils/libopcodes/Makefile.mips (contents, props changed) Modified: head/gnu/usr.bin/binutils/libbfd/bfd.h Added: head/gnu/usr.bin/binutils/libbfd/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.mips Thu Dec 11 08:20:34 2008 (r185924) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +#xxxIMPxxx: endian and size +DEFAULT_VECTOR= bfd_elf32_tradbigmips_vec + +SRCS+= coff-mips.c \ + cpu-mips.c \ + ecoff.c \ + ecofflink.c \ + elf32.c \ + elf64.c \ + elfn32-mips.c \ + elf32-mips.c \ + elf64-mips.c \ + elfxx-mips.c \ + elf32-target.h \ + elf64-target.h \ + elflink.c + +VECS= bfd_elf32_tradbigmips_vec \ + bfd_elf32_tradlittlemips_vec \ + bfd_elf32_ntradbigmips_vec \ + bfd_elf32_ntradlittlemips_vec \ + bfd_elf64_tradbigmips_vec \ + bfd_elf64_tradlittlemips_vec \ + ecoff_little_vec \ + ecoff_big_vec Modified: head/gnu/usr.bin/binutils/libbfd/bfd.h ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/bfd.h Thu Dec 11 08:18:45 2008 (r185923) +++ head/gnu/usr.bin/binutils/libbfd/bfd.h Thu Dec 11 08:20:34 2008 (r185924) @@ -57,7 +57,7 @@ extern "C" { #define BFD_ARCH_SIZE 64 -#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) +#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) || defined(__mips__) #define BFD_HOST_64BIT_LONG 0 #define BFD_HOST_64_BIT long long #define BFD_HOST_U_64_BIT unsigned long long Added: head/gnu/usr.bin/binutils/libopcodes/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/libopcodes/Makefile.mips Thu Dec 11 08:20:34 2008 (r185924) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SRCS+= mips-dis.c mips-opc.c mips16-opc.c +CFLAGS+= -DARCH_mips From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 08:22:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47E4B1065673; Thu, 11 Dec 2008 08:22:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38A0B8FC12; Thu, 11 Dec 2008 08:22:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB8MLeB059323; Thu, 11 Dec 2008 08:22:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB8MKLd059320; Thu, 11 Dec 2008 08:22:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110822.mBB8MKLd059320@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 08:22: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: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 08:22:21 -0000 Author: imp Date: Thu Dec 11 08:22:20 2008 New Revision: 185925 URL: http://svn.freebsd.org/changeset/base/185925 Log: Push mips support into the tree. Added: head/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh (contents, props changed) Modified: head/contrib/binutils/bfd/config.bfd head/contrib/binutils/gas/config/tc-mips.c Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Thu Dec 11 08:20:34 2008 (r185924) +++ head/contrib/binutils/bfd/config.bfd Thu Dec 11 08:22:20 2008 (r185925) @@ -768,6 +768,10 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; + mips*-*-freebsd*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; mips*-*-netbsd*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" Modified: head/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- head/contrib/binutils/gas/config/tc-mips.c Thu Dec 11 08:20:34 2008 (r185924) +++ head/contrib/binutils/gas/config/tc-mips.c Thu Dec 11 08:22:20 2008 (r185925) @@ -281,6 +281,9 @@ static int mips_32bitmode = 0; #define HAVE_64BIT_OBJECTS (mips_abi == N64_ABI) +/* True if relocations are stored in-place. */ +#define HAVE_IN_PLACE_ADDENDS (!HAVE_NEWABI) + /* We can only have 64bit addresses if the object file format supports it. */ #define HAVE_32BIT_ADDRESSES \ @@ -13020,6 +13023,26 @@ mips_fix_adjustable (fixS *fixp) if (fixp->fx_addsy == NULL) return 1; + /* If symbol SYM is in a mergeable section, relocations of the form + SYM + 0 can usually be made section-relative. The mergeable data + is then identified by the section offset rather than by the symbol. + + However, if we're generating REL LO16 relocations, the offset is split + between the LO16 and parterning high part relocation. The linker will + need to recalculate the complete offset in order to correctly identify + the merge data. + + The linker has traditionally not looked for the parterning high part + relocation, and has thus allowed orphaned R_MIPS_LO16 relocations to be + placed anywhere. Rather than break backwards compatibility by changing + this, it seems better not to force the issue, and instead keep the + original symbol. This will work with either linker behavior. */ + if ((fixp->fx_r_type == BFD_RELOC_LO16 + || reloc_needs_lo_p (fixp->fx_r_type)) + && HAVE_IN_PLACE_ADDENDS + && (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE) != 0) + return 0; + #ifdef OBJ_ELF if (OUTPUT_FLAVOR == bfd_target_elf_flavour && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 Added: head/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh Thu Dec 11 08:22:20 2008 (r185925) @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf32bmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 09:08:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B33921065675; Thu, 11 Dec 2008 09:08:06 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.238]) by mx1.freebsd.org (Postfix) with ESMTP id 754548FC19; Thu, 11 Dec 2008 09:08:06 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so772347rvf.43 for ; Thu, 11 Dec 2008 01:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=2wYDaOIebL2LT97HhkwZMOy9jQgF3hMKSQSZsIHBs3Q=; b=MfmtkZJK4SNZQa+WlQzsdVLi5LNdaoRhV/iVb7dxZleW1ysXVzfRisBiNe3S2G15DH mWGdt28c/oqevOA4JVEjZF7I1lyjQ5g3iYS+gikJ4roLmL+S3vBJpWOoXIAzUjC19bLB rGv1ikDXd9j7eDTEvJkgFAp4Sdoo6SyLzQt0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=oE0mTrHHdhBS1oqLg6e2iY30E2avd20sdHfEf3CPRMLC9PCxvz2QJp8aeHbf71gLTu ZgorxvANITQimTFWBI5cpFdM9eJaq9AIk47csJhLVq5CpwpSnufHSh4nPXMEOxTWlbwB nxrHir/A7CN31ozCHHZbZMe8d8pyHc32m6D5k= Received: by 10.141.152.8 with SMTP id e8mr1153885rvo.273.1228986486230; Thu, 11 Dec 2008 01:08:06 -0800 (PST) Received: by 10.140.158.13 with HTTP; Thu, 11 Dec 2008 01:08:06 -0800 (PST) Message-ID: <7d6fde3d0812110108u3dc979a9tf393a3520c248c59@mail.gmail.com> Date: Thu, 11 Dec 2008 01:08:06 -0800 From: "Garrett Cooper" To: "Warner Losh" In-Reply-To: <200812110822.mBB8MKLd059320@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812110822.mBB8MKLd059320@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 09:08:06 -0000 On Thu, Dec 11, 2008 at 12:22 AM, Warner Losh wrote: > Author: imp > Date: Thu Dec 11 08:22:20 2008 > New Revision: 185925 > URL: http://svn.freebsd.org/changeset/base/185925 > > Log: > Push mips support into the tree. Hip, hip, hooray for MIPS! -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 10:29:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1C7106564A; Thu, 11 Dec 2008 10:29: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 5FBC48FC19; Thu, 11 Dec 2008 10:29:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBATZbP062800; Thu, 11 Dec 2008 10:29:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBATZmH062799; Thu, 11 Dec 2008 10:29:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812111029.mBBATZmH062799@svn.freebsd.org> From: Robert Watson Date: Thu, 11 Dec 2008 10:29: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: r185928 - head/sys/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, 11 Dec 2008 10:29:35 -0000 Author: rwatson Date: Thu Dec 11 10:29:35 2008 New Revision: 185928 URL: http://svn.freebsd.org/changeset/base/185928 Log: Add missing "goto set_head" for SO_IPX_CHECKSUM; otherwise we fall through to the SO_HEADERS_ON_OUTPUT case and set that instead. MFC after: 1 week Found with: Coverity Prevent(tm) Coverity ID: 3988 Modified: head/sys/netipx/ipx_usrreq.c Modified: head/sys/netipx/ipx_usrreq.c ============================================================================== --- head/sys/netipx/ipx_usrreq.c Thu Dec 11 09:52:45 2008 (r185927) +++ head/sys/netipx/ipx_usrreq.c Thu Dec 11 10:29:35 2008 (r185928) @@ -412,6 +412,7 @@ ipx_ctloutput(struct socket *so, struct case SO_IPX_CHECKSUM: mask = IPXP_CHECKSUM; + goto set_head; case SO_HEADERS_ON_OUTPUT: mask = IPXP_RAWOUT; From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 11:17:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0AAE1065673; Thu, 11 Dec 2008 11:17:44 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE368FC12; Thu, 11 Dec 2008 11:17:44 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 6A8F86D43F; Thu, 11 Dec 2008 11:17:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 51324844B1; Thu, 11 Dec 2008 12:17:43 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh References: <200812110822.mBB8MKLd059320@svn.freebsd.org> Date: Thu, 11 Dec 2008 12:17:43 +0100 In-Reply-To: <200812110822.mBB8MKLd059320@svn.freebsd.org> (Warner Losh's message of "Thu, 11 Dec 2008 08:22:20 +0000 (UTC)") Message-ID: <86oczjklk8.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 11:17:44 -0000 Warner Losh writes: > Author: imp > Date: Thu Dec 11 08:22:20 2008 > New Revision: 185925 > URL: http://svn.freebsd.org/changeset/base/185925 > > Log: > Push mips support into the tree. Just to pick a random mips commit - There is something wrong with the mips toolchain. The build breaks in libpam, while building the static version, which includes all modules: ../modules/pam_deny/libpam_deny.a(pam_deny.o)(.text+0x3c): In function `pam= _sm_open_session': /src/lib/libpam/modules/pam_deny/pam_deny.c:80: multiple definition of `pam= _sm_open_session' ../modules/pam_chroot/libpam_chroot.a(pam_chroot.o)(.text+0x14):/src/lib/li= bpam/modules/pam_chroot/pam_chroot.c:54: first defined here [lather, rinse, repeat for every service function in every module] The service functions should be static. The logic PAM uses to determine whether it is building static or shared modules is as follows: #if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES) The command line used to compile the pam_deny.o that goes into libpam_deny.= a: cc -O2 -pipe -EL -msoft-float -G0 -mno-dsp -mabicalls -I/src/lib/libpam/mo= dules/pam_deny/../../../../contrib/openpam/include -I/src/lib/libpam/module= s/pam_deny/../../libpam -g -Wsystem-headers -Werror -Wall -Wno-format-y2k -= W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-= arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-al= ign -Wunused-parameter -Wno-uninitialized -Wno-pointer-sign -c /src/lib/lib= pam/modules/pam_deny/pam_deny.c The corresponding command line for amd64: cc -O2 -pipe -march=3Dnocona -I/src/lib/libpam/modules/pam_deny/../../../..= /contrib/openpam/include -I/src/lib/libpam/modules/pam_deny/../../libpam -g= -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-u= nused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -W= return-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wun= used-parameter -Wno-uninitialized -Wno-pointer-sign -c /src/lib/libpam/modu= les/pam_deny/pam_deny.c DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 13:55:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EE151065673; Thu, 11 Dec 2008 13:55:37 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (unknown [IPv6:2002:50b1:e8f2:1::143]) by mx1.freebsd.org (Postfix) with ESMTP id B9B028FC21; Thu, 11 Dec 2008 13:55:36 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc] (unknown [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc]) by itchy.rabson.org (Postfix) with ESMTP id 670E73FA9; Thu, 11 Dec 2008 13:55:08 +0000 (GMT) Message-Id: <25FCC66F-902B-49AF-9B9C-07AE3446B13B@rabson.org> From: Doug Rabson To: Paul Saab In-Reply-To: <200812110223.mBB2NnjW049843@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Thu, 11 Dec 2008 13:55:32 +0000 References: <200812110223.mBB2NnjW049843@svn.freebsd.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185902 - head/sys/boot/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, 11 Dec 2008 13:55:37 -0000 On 11 Dec 2008, at 02:23, Paul Saab wrote: > Author: ps > Date: Thu Dec 11 02:23:49 2008 > New Revision: 185902 > URL: http://svn.freebsd.org/changeset/base/185902 > > Log: > Avoid a double free in devopen by not freeing the device structure > in zfs_dev_open. This stops a panic in the loader when trying to > read from a zfs device and no zfs devices exist. > > Modified: > head/sys/boot/zfs/zfs.c > > Modified: head/sys/boot/zfs/zfs.c > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/boot/zfs/zfs.c Thu Dec 11 01:41:38 2008 (r185901) > +++ head/sys/boot/zfs/zfs.c Thu Dec 11 02:23:49 2008 (r185902) > @@ -474,7 +474,6 @@ zfs_dev_open(struct open_file *f, ...) > * the pool. > */ > unit = dev->d_unit; > - free(dev); > > i = 0; > STAILQ_FOREACH(spa, &zfs_pools, spa_link) { Doesn't this introduce a memory leak in the case where there is a ZFS pool? In that case, zfs_dev_open replaces f->f_devdata with a reference to the pool structure. Probably a better fix would be to move the free(dev) to just before the 'return (0)' statement. From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 15:42:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77C3A106573E; Thu, 11 Dec 2008 15:42: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 637908FC16; Thu, 11 Dec 2008 15:42:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBFgx7Q068830; Thu, 11 Dec 2008 15:42:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBFgxXJ068829; Thu, 11 Dec 2008 15:42:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812111542.mBBFgxXJ068829@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 15:42: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: r185931 - 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, 11 Dec 2008 15:42:59 -0000 Author: bz Date: Thu Dec 11 15:42:59 2008 New Revision: 185931 URL: http://svn.freebsd.org/changeset/base/185931 Log: Whitespace changes only - tabs must have been converted to spaces somehow, when moving the code from p4 to svn. Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Dec 11 13:30:29 2008 (r185930) +++ head/sys/net/if.c Thu Dec 11 15:42:59 2008 (r185931) @@ -169,11 +169,11 @@ static struct filterops netdev_filtops = #ifndef VIMAGE_GLOBALS static struct vnet_symmap vnet_net_symmap[] = { - VNET_SYMMAP(net, ifnet), - VNET_SYMMAP(net, rt_tables), - VNET_SYMMAP(net, rtstat), - VNET_SYMMAP(net, rttrash), - VNET_SYMMAP_END + VNET_SYMMAP(net, ifnet), + VNET_SYMMAP(net, rt_tables), + VNET_SYMMAP(net, rtstat), + VNET_SYMMAP(net, rttrash), + VNET_SYMMAP_END }; VNET_MOD_DECLARE(NET, net, vnet_net_iattach, vnet_net_idetach, From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 15:44:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C057E1065680; Thu, 11 Dec 2008 15:44:53 +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 AF8408FC16; Thu, 11 Dec 2008 15:44:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBFirkU068919; Thu, 11 Dec 2008 15:44:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBFir50068918; Thu, 11 Dec 2008 15:44:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812111544.mBBFir50068918@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 15:44: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: r185932 - 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, 11 Dec 2008 15:44:53 -0000 Author: bz Date: Thu Dec 11 15:44:53 2008 New Revision: 185932 URL: http://svn.freebsd.org/changeset/base/185932 Log: Error in case anyone tried to compile with both options VIMAGE and the (temporary) option VIMAGE_GLOBALS. Sponsored by: The FreeBSD Foundation: Modified: head/sys/sys/vimage.h Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Thu Dec 11 15:42:59 2008 (r185931) +++ head/sys/sys/vimage.h Thu Dec 11 15:44:53 2008 (r185932) @@ -60,6 +60,10 @@ struct vnet_modlink { .vmi_symmap = m_symmap \ }; +#if defined(VIMAGE) && defined(VIMAGE_GLOBALS) +#error "You cannot have both option VIMAGE and option VIMAGE_GLOBALS!" +#endif + #ifdef VIMAGE_GLOBALS #define VSYM(base, sym) (sym) #else From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 15:56:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E05B1065673; Thu, 11 Dec 2008 15:56:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C4178FC0C; Thu, 11 Dec 2008 15:56:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBFuVaa069173; Thu, 11 Dec 2008 15:56:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBFuU05069167; Thu, 11 Dec 2008 15:56:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812111556.mBBFuU05069167@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Dec 2008 15:56: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: r185933 - in head/sys: amd64/amd64 amd64/include i386/i386 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, 11 Dec 2008 15:56:31 -0000 Author: jhb Date: Thu Dec 11 15:56:30 2008 New Revision: 185933 URL: http://svn.freebsd.org/changeset/base/185933 Log: Add constants for fields in the local APIC error status register and a routine to read it. Modified: head/sys/amd64/amd64/local_apic.c head/sys/amd64/include/apicreg.h head/sys/amd64/include/apicvar.h head/sys/i386/i386/local_apic.c head/sys/i386/include/apicreg.h head/sys/i386/include/apicvar.h Modified: head/sys/amd64/amd64/local_apic.c ============================================================================== --- head/sys/amd64/amd64/local_apic.c Thu Dec 11 15:44:53 2008 (r185932) +++ head/sys/amd64/amd64/local_apic.c Thu Dec 11 15:56:30 2008 (r185933) @@ -299,6 +299,7 @@ lapic_setup(int boot) /* Program LINT[01] LVT entries. */ lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + #ifdef HWPMC_HOOKS /* Program the PMC LVT entry if present. */ if (maxlvt >= LVT_PMC) @@ -644,6 +645,18 @@ lapic_eoi(void) lapic->eoi = 0; } +/* + * Read the contents of the error status register. We have to write + * to the register first before reading from it. + */ +u_int +lapic_error(void) +{ + + lapic->esr = 0; + return (lapic->esr); +} + void lapic_handle_intr(int vector, struct trapframe *frame) { Modified: head/sys/amd64/include/apicreg.h ============================================================================== --- head/sys/amd64/include/apicreg.h Thu Dec 11 15:44:53 2008 (r185932) +++ head/sys/amd64/include/apicreg.h Thu Dec 11 15:56:30 2008 (r185933) @@ -260,6 +260,14 @@ typedef struct IOAPIC ioapic_t; # define APIC_TPR_INT 0x000000f0 # define APIC_TPR_SUB 0x0000000f +/* fields in ESR */ +#define APIC_ESR_SEND_CS_ERROR 0x00000001 +#define APIC_ESR_RECEIVE_CS_ERROR 0x00000002 +#define APIC_ESR_SEND_ACCEPT 0x00000004 +#define APIC_ESR_RECEIVE_ACCEPT 0x00000008 +#define APIC_ESR_SEND_ILLEGAL_VECTOR 0x00000020 +#define APIC_ESR_RECEIVE_ILLEGAL_VECTOR 0x00000040 +#define APIC_ESR_ILLEGAL_REGISTER 0x00000080 /* fields in ICR_LOW */ #define APIC_VECTOR_MASK 0x000000ff Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Thu Dec 11 15:44:53 2008 (r185932) +++ head/sys/amd64/include/apicvar.h Thu Dec 11 15:56:30 2008 (r185933) @@ -200,6 +200,7 @@ void lapic_create(u_int apic_id, int boo void lapic_disable(void); void lapic_dump(const char *str); void lapic_eoi(void); +u_int lapic_error(void); int lapic_id(void); void lapic_init(vm_paddr_t addr); int lapic_intr_pending(u_int vector); Modified: head/sys/i386/i386/local_apic.c ============================================================================== --- head/sys/i386/i386/local_apic.c Thu Dec 11 15:44:53 2008 (r185932) +++ head/sys/i386/i386/local_apic.c Thu Dec 11 15:56:30 2008 (r185933) @@ -301,6 +301,7 @@ lapic_setup(int boot) /* Program LINT[01] LVT entries. */ lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + #ifdef HWPMC_HOOKS /* Program the PMC LVT entry if present. */ if (maxlvt >= LVT_PMC) @@ -646,6 +647,18 @@ lapic_eoi(void) lapic->eoi = 0; } +/* + * Read the contents of the error status register. We have to write + * to the register first before reading from it. + */ +u_int +lapic_error(void) +{ + + lapic->esr = 0; + return (lapic->esr); +} + void lapic_handle_intr(int vector, struct trapframe *frame) { Modified: head/sys/i386/include/apicreg.h ============================================================================== --- head/sys/i386/include/apicreg.h Thu Dec 11 15:44:53 2008 (r185932) +++ head/sys/i386/include/apicreg.h Thu Dec 11 15:56:30 2008 (r185933) @@ -260,6 +260,14 @@ typedef struct IOAPIC ioapic_t; # define APIC_TPR_INT 0x000000f0 # define APIC_TPR_SUB 0x0000000f +/* fields in ESR */ +#define APIC_ESR_SEND_CS_ERROR 0x00000001 +#define APIC_ESR_RECEIVE_CS_ERROR 0x00000002 +#define APIC_ESR_SEND_ACCEPT 0x00000004 +#define APIC_ESR_RECEIVE_ACCEPT 0x00000008 +#define APIC_ESR_SEND_ILLEGAL_VECTOR 0x00000020 +#define APIC_ESR_RECEIVE_ILLEGAL_VECTOR 0x00000040 +#define APIC_ESR_ILLEGAL_REGISTER 0x00000080 /* fields in ICR_LOW */ #define APIC_VECTOR_MASK 0x000000ff Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Thu Dec 11 15:44:53 2008 (r185932) +++ head/sys/i386/include/apicvar.h Thu Dec 11 15:56:30 2008 (r185933) @@ -211,6 +211,7 @@ void lapic_create(u_int apic_id, int boo void lapic_disable(void); void lapic_dump(const char *str); void lapic_eoi(void); +u_int lapic_error(void); int lapic_id(void); void lapic_init(vm_paddr_t addr); int lapic_intr_pending(u_int vector); From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:05:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70D131065675; Thu, 11 Dec 2008 16:05:08 +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 605DE8FC08; Thu, 11 Dec 2008 16:05:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBG57Nj069377; Thu, 11 Dec 2008 16:05:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBG57HC069376; Thu, 11 Dec 2008 16:05:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812111605.mBBG57HC069376@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 16:05: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: r185934 - 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, 11 Dec 2008 16:05:08 -0000 Author: bz Date: Thu Dec 11 16:05:07 2008 New Revision: 185934 URL: http://svn.freebsd.org/changeset/base/185934 Log: Use the correct INIT_VNET_INET() as the virtualized variable here are in vinet.h not in vinet6.h Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Dec 11 15:56:30 2008 (r185933) +++ head/sys/netinet/tcp_subr.c Thu Dec 11 16:05:07 2008 (r185934) @@ -155,7 +155,7 @@ SYSCTL_V_PROC(V_NET, vnet_inet, _net_ine static int sysctl_net_inet_tcp_mss_v6_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET6(curvnet); + INIT_VNET_INET(curvnet); int error, new; new = V_tcp_v6mssdflt; From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:09:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4374D1065670; Thu, 11 Dec 2008 16:09:32 +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 335818FC1D; Thu, 11 Dec 2008 16:09:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBG9V7o069490; Thu, 11 Dec 2008 16:09:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBG9VC2069489; Thu, 11 Dec 2008 16:09:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812111609.mBBG9VC2069489@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 16:09: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: r185935 - 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, 11 Dec 2008 16:09:32 -0000 Author: bz Date: Thu Dec 11 16:09:31 2008 New Revision: 185935 URL: http://svn.freebsd.org/changeset/base/185935 Log: Order #includes - also to reduce diffs with vimage branches in p4. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_poll.c Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Thu Dec 11 16:05:07 2008 (r185934) +++ head/sys/kern/kern_poll.c Thu Dec 11 16:09:31 2008 (r185935) @@ -33,20 +33,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include /* needed by net/if.h */ #include #include #include +#include #include /* for IFF_* flags */ #include /* for NETISR_POLL */ #include -#include -#include -#include -#include - static void netisr_poll(void); /* the two netisr handlers */ static void netisr_pollmore(void); static int poll_switch(SYSCTL_HANDLER_ARGS); From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:13:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915681065673; Thu, 11 Dec 2008 16:13:17 +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 8188E8FC08; Thu, 11 Dec 2008 16:13:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBGDHdA069604; Thu, 11 Dec 2008 16:13:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBGDHRM069603; Thu, 11 Dec 2008 16:13:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812111613.mBBGDHRM069603@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 16:13: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: r185936 - 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: Thu, 11 Dec 2008 16:13:17 -0000 Author: bz Date: Thu Dec 11 16:13:17 2008 New Revision: 185936 URL: http://svn.freebsd.org/changeset/base/185936 Log: Put the VIMAGE options together in one place. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Dec 11 16:09:31 2008 (r185935) +++ head/sys/conf/options Thu Dec 11 16:13:17 2008 (r185936) @@ -415,7 +415,6 @@ TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h -VIMAGE_GLOBALS opt_global.h XBONEHACK # @@ -786,3 +785,4 @@ IEEE80211_AMPDU_AGE opt_wlan.h # Virtualize the network stack VIMAGE opt_global.h +VIMAGE_GLOBALS opt_global.h From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:15:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 444631065672; Thu, 11 Dec 2008 16:15:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id DA5EA8FC26; Thu, 11 Dec 2008 16:15:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mBBGFUPn034949; Thu, 11 Dec 2008 11:15:30 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 10:22:42 -0500 User-Agent: KMail/1.9.7 References: <200812110058.mBB0w6HD048102@svn.freebsd.org> In-Reply-To: <200812110058.mBB0w6HD048102@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812111022.42911.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Thu, 11 Dec 2008 11:15:30 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8746/Wed Dec 10 23:14:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185898 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 16:15:37 -0000 On Wednesday 10 December 2008 07:58:06 pm Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Dec 11 00:58:05 2008 > New Revision: 185898 > URL: http://svn.freebsd.org/changeset/base/185898 > > Log: > Add 32-bit compat support for AIO. > > jhb probably forgot to commit this file with r185878 and will want to > review this. It unbreaks the build here. > > Obtained from: p4 //depot/user/jhb/lock/compat/freebsd32/freebsd32_signal.h#2 Yes, I missed this file in all the noise of the regen'd files, sorry. :( Thanks for fixing this. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:15:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D94E1065749; Thu, 11 Dec 2008 16:15:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6428FC1D; Thu, 11 Dec 2008 16:15:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mBBGFUPo034949; Thu, 11 Dec 2008 11:15:36 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Doug Rabson Date: Thu, 11 Dec 2008 10:42:47 -0500 User-Agent: KMail/1.9.7 References: <200812110223.mBB2NnjW049843@svn.freebsd.org> <25FCC66F-902B-49AF-9B9C-07AE3446B13B@rabson.org> In-Reply-To: <25FCC66F-902B-49AF-9B9C-07AE3446B13B@rabson.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812111042.48029.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Thu, 11 Dec 2008 11:15:36 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8746/Wed Dec 10 23:14:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Paul Saab Subject: Re: svn commit: r185902 - head/sys/boot/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, 11 Dec 2008 16:15:44 -0000 On Thursday 11 December 2008 08:55:32 am Doug Rabson wrote: > > On 11 Dec 2008, at 02:23, Paul Saab wrote: > > > Author: ps > > Date: Thu Dec 11 02:23:49 2008 > > New Revision: 185902 > > URL: http://svn.freebsd.org/changeset/base/185902 > > > > Log: > > Avoid a double free in devopen by not freeing the device structure > > in zfs_dev_open. This stops a panic in the loader when trying to > > read from a zfs device and no zfs devices exist. > > > > Modified: > > head/sys/boot/zfs/zfs.c > > > > Modified: head/sys/boot/zfs/zfs.c > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- head/sys/boot/zfs/zfs.c Thu Dec 11 01:41:38 2008 (r185901) > > +++ head/sys/boot/zfs/zfs.c Thu Dec 11 02:23:49 2008 (r185902) > > @@ -474,7 +474,6 @@ zfs_dev_open(struct open_file *f, ...) > > * the pool. > > */ > > unit = dev->d_unit; > > - free(dev); > > > > i = 0; > > STAILQ_FOREACH(spa, &zfs_pools, spa_link) { > > Doesn't this introduce a memory leak in the case where there is a ZFS > pool? In that case, zfs_dev_open replaces f->f_devdata with a > reference to the pool structure. Probably a better fix would be to > move the free(dev) to just before the 'return (0)' statement. Yes, that would work. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:26:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0236A1065677; Thu, 11 Dec 2008 16:26:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5A718FC1E; Thu, 11 Dec 2008 16:26:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBGQcgD069884; Thu, 11 Dec 2008 16:26:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBGQcbf069870; Thu, 11 Dec 2008 16:26:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812111626.mBBGQcbf069870@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Dec 2008 16:26: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: r185937 - in head/sys: net 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: Thu, 11 Dec 2008 16:26:39 -0000 Author: bz Date: Thu Dec 11 16:26:38 2008 New Revision: 185937 URL: http://svn.freebsd.org/changeset/base/185937 Log: Put a global variables, which were virtualized but formerly missed under VIMAGE_GLOBAL. Start putting the extern declarations of the virtualized globals under VIMAGE_GLOBAL as the globals themsevles are already. This will help by the time when we are going to remove the globals entirely. While there garbage collect a few dead externs from ip6_var.h. Sponsored by: The FreeBSD Foundation Modified: head/sys/net/raw_cb.h head/sys/netinet/in_pcb.h head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_nat.c head/sys/netinet/ip_fw_pfil.c head/sys/netinet/ip_var.h head/sys/netinet/tcp_var.h head/sys/netinet/udp_var.h head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6.h head/sys/netinet6/tcp6_var.h head/sys/netinet6/vinet6.h Modified: head/sys/net/raw_cb.h ============================================================================== --- head/sys/net/raw_cb.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/net/raw_cb.h Thu Dec 11 16:26:38 2008 (r185937) @@ -55,7 +55,9 @@ struct rawcb { #define RAWRCVQ 8192 #ifdef _KERNEL +#ifdef VIMAGE_GLOBALS extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list; +#endif extern struct mtx rawcb_mtx; /* Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/in_pcb.h Thu Dec 11 16:26:38 2008 (r185937) @@ -450,6 +450,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_CHECK_SOCKAF(so, af) (INP_SOCKAF(so) == af) #ifdef _KERNEL +#ifdef VIMAGE_GLOBALS extern int ipport_reservedhigh; extern int ipport_reservedlow; extern int ipport_lowfirstauto; @@ -463,6 +464,7 @@ extern int ipport_randomcps; extern int ipport_randomtime; extern int ipport_stoprandom; extern int ipport_tcpallocs; +#endif extern struct callout ipport_tick_callout; void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/ip_fw2.c Thu Dec 11 16:26:38 2008 (r185937) @@ -149,7 +149,9 @@ struct ip_fw_ugid { /* * list of rules for layer 3 */ +#ifdef VIMAGE_GLOBALS struct ip_fw_chain layer3_chain; +#endif MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables"); Modified: head/sys/netinet/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ip_fw_nat.c Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/ip_fw_nat.c Thu Dec 11 16:26:38 2008 (r185937) @@ -69,9 +69,8 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_IPFW); -extern struct ip_fw_chain layer3_chain; - #ifdef VIMAGE_GLOBALS +extern struct ip_fw_chain layer3_chain; static eventhandler_tag ifaddr_event_tag; #endif Modified: head/sys/netinet/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ip_fw_pfil.c Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/ip_fw_pfil.c Thu Dec 11 16:26:38 2008 (r185937) @@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$"); #include +#ifdef VIMAGE_GLOBALS int fw_enable = 1; #ifdef INET6 int fw6_enable = 1; #endif +#endif int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/ip_var.h Thu Dec 11 16:26:38 2008 (r185937) @@ -175,6 +175,7 @@ struct inpcb; struct route; struct sockopt; +#ifdef VIMAGE_GLOBALS extern struct ipstat ipstat; extern u_short ip_id; /* ip packet ctr, for ids */ extern int ip_do_randomid; @@ -183,12 +184,13 @@ extern int ipforwarding; /* ip forwardi #ifdef IPSTEALTH extern int ipstealth; /* stealth forwarding */ #endif -extern u_char ip_protox[]; +extern int rsvp_on; extern struct socket *ip_rsvpd; /* reservation protocol daemon */ extern struct socket *ip_mrouter; /* multicast routing daemon */ +#endif +extern u_char ip_protox[]; extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); -extern int rsvp_on; extern struct pr_usrreqs rip_usrreqs; void inp_freemoptions(struct ip_moptions *); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/tcp_var.h Thu Dec 11 16:26:38 2008 (r185937) @@ -513,10 +513,12 @@ SYSCTL_DECL(_net_inet_tcp_sack); MALLOC_DECLARE(M_TCPLOG); #endif +extern int tcp_log_in_vain; + +#ifdef VIMAGE_GLOBALS extern struct inpcbhead tcb; /* head of queue of active tcpcb's */ extern struct inpcbinfo tcbinfo; extern struct tcpstat tcpstat; /* tcp statistics */ -extern int tcp_log_in_vain; extern int tcp_mssdflt; /* XXX */ extern int tcp_minmss; extern int tcp_delack_enabled; @@ -548,6 +550,7 @@ extern int tcp_sack_globalholes; extern int tcp_sc_rst_sock_fail; /* RST on sock alloc failure */ extern int tcp_do_ecn; /* TCP ECN enabled/disabled */ extern int tcp_ecn_maxretries; +#endif /* VIMAGE_GLOBALS */ int tcp_addoptions(struct tcpopt *, u_char *); struct tcpcb * Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet/udp_var.h Thu Dec 11 16:26:38 2008 (r185937) @@ -94,12 +94,15 @@ struct udpstat { SYSCTL_DECL(_net_inet_udp); extern struct pr_usrreqs udp_usrreqs; + +#ifdef VIMAGE_GLOBALS extern struct inpcbhead udb; extern struct inpcbinfo udbinfo; -extern u_long udp_sendspace; -extern u_long udp_recvspace; extern struct udpstat udpstat; extern int udp_blackhole; +#endif +extern u_long udp_sendspace; +extern u_long udp_recvspace; extern int udp_log_in_vain; void udp_ctlinput(int, struct sockaddr *, void *); Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet6/in6_proto.c Thu Dec 11 16:26:38 2008 (r185937) @@ -390,9 +390,7 @@ int ip6_keepfaith; time_t ip6_log_time; int ip6stealth; int nd6_onlink_ns_rfc4861; -#endif -#ifdef VIMAGE_GLOBALS /* icmp6 */ /* * BSDI4 defines these variables in in_proto.c... Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet6/in6_var.h Thu Dec 11 16:26:38 2008 (r185937) @@ -470,9 +470,11 @@ struct in6_rrenumreq { #endif #ifdef _KERNEL +#ifdef VIMAGE_GLOBALS extern struct in6_ifaddr *in6_ifaddr; extern struct icmp6stat icmp6stat; +#endif /* VIMAGE_GLOBALS */ #define in6_ifstat_inc(ifp, tag) \ do { \ if (ifp) \ Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet6/ip6_var.h Thu Dec 11 16:26:38 2008 (r185937) @@ -279,6 +279,7 @@ struct ip6aux { #define IP6_HDR_ALIGNED_P(ip) ((((intptr_t) (ip)) & 3) == 0) #endif +#ifdef VIMAGE_GLOBALS extern struct ip6stat ip6stat; /* statistics */ extern int ip6_defhlim; /* default hop limit */ extern int ip6_defmcasthlim; /* default multicast hop limit */ @@ -290,8 +291,10 @@ extern int ip6_rr_prune; /* router renu * walk list every 5 sec. */ extern int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */ extern int ip6_v6only; +#endif /* VIMAGE_GLOBALS */ extern struct socket *ip6_mrouter; /* multicast routing daemon */ +#ifdef VIMAGE_GLOBALS extern int ip6_sendredirects; /* send IP redirects when forwarding? */ extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */ extern int ip6_maxfrags; /* Maximum fragments in reassembly queue */ @@ -304,17 +307,13 @@ extern time_t ip6_log_time; extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */ extern int ip6_dad_count; /* DupAddrDetectionTransmits */ -extern int ip6_auto_flowlabel; -extern int ip6_auto_linklocal; - -extern int ip6_anonportmin; /* minimum ephemeral port */ -extern int ip6_anonportmax; /* maximum ephemeral port */ -extern int ip6_lowportmin; /* minimum reserved port */ -extern int ip6_lowportmax; /* maximum reserved port */ +extern int ip6_auto_flowlabel; +extern int ip6_auto_linklocal; extern int ip6_use_tempaddr; /* whether to use temporary addresses. */ extern int ip6_prefer_tempaddr; /* whether to prefer temporary addresses in the source address selection */ +#endif /* VIMAGE_GLOBALS */ extern int ip6_use_defzone; /* whether to use the default scope zone when unspecified */ Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet6/nd6.h Thu Dec 11 16:26:38 2008 (r185937) @@ -328,6 +328,7 @@ struct nd_pfxrouter { LIST_HEAD(nd_prhead, nd_prefix); /* nd6.c */ +#ifdef VIMAGE_GLOBALS extern int nd6_prune; extern int nd6_delay; extern int nd6_umaxtries; @@ -341,8 +342,6 @@ extern struct nd_prhead nd_prefix; extern int nd6_debug; extern int nd6_onlink_ns_rfc4861; -#define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) - extern struct callout nd6_timer_ch; /* nd6_rtr.c */ @@ -351,6 +350,9 @@ extern int ip6_desync_factor; /* seconds extern u_int32_t ip6_temp_preferred_lifetime; /* seconds */ extern u_int32_t ip6_temp_valid_lifetime; /* seconds */ extern int ip6_temp_regen_advance; /* seconds */ +#endif /* VIMAGE_GLOBALS */ + +#define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) union nd_opts { struct nd_opt_hdr *nd_opt_array[8]; /* max = target address list */ Modified: head/sys/netinet6/tcp6_var.h ============================================================================== --- head/sys/netinet6/tcp6_var.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet6/tcp6_var.h Thu Dec 11 16:26:38 2008 (r185937) @@ -67,7 +67,9 @@ SYSCTL_DECL(_net_inet6_tcp6); #endif +#ifdef VIMAGE_GLOBALS extern int tcp_v6mssdflt; /* XXX */ +#endif struct ip6_hdr; void tcp6_ctlinput __P((int, struct sockaddr *, void *)); Modified: head/sys/netinet6/vinet6.h ============================================================================== --- head/sys/netinet6/vinet6.h Thu Dec 11 16:13:17 2008 (r185936) +++ head/sys/netinet6/vinet6.h Thu Dec 11 16:26:38 2008 (r185937) @@ -77,6 +77,7 @@ struct vnet_inet6 { int _nd6_inuse; int _nd6_allocated; + int _nd6_onlink_ns_rfc4861; struct llinfo_nd6 _llinfo_nd6; struct nd_drhead _nd_defrouter; struct nd_prhead _nd_prefix; @@ -109,7 +110,6 @@ struct vnet_inet6 { int _ip6_keepfaith; int _ip6stealth; time_t _ip6_log_time; - int _nd6_onlink_ns_rfc4861; int _pmtu_expire; int _pmtu_probe; From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 16:48:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE54E1065670; Thu, 11 Dec 2008 16:48:35 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67008FC0C; Thu, 11 Dec 2008 16:48:35 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBGmZcT070380; Thu, 11 Dec 2008 16:48:35 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBGmZFD070379; Thu, 11 Dec 2008 16:48:35 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200812111648.mBBGmZFD070379@svn.freebsd.org> From: Paul Saab Date: Thu, 11 Dec 2008 16:48: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: r185938 - head/sys/boot/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, 11 Dec 2008 16:48:36 -0000 Author: ps Date: Thu Dec 11 16:48:35 2008 New Revision: 185938 URL: http://svn.freebsd.org/changeset/base/185938 Log: Fix a leak introduced in r185902. We should free the devspec if we've successfully found a zfs pool. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Thu Dec 11 16:26:38 2008 (r185937) +++ head/sys/boot/zfs/zfs.c Thu Dec 11 16:48:35 2008 (r185938) @@ -486,6 +486,7 @@ zfs_dev_open(struct open_file *f, ...) } f->f_devdata = spa; + free(dev); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 17:00:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBBAA1065673; Thu, 11 Dec 2008 17:00:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0558FC1F; Thu, 11 Dec 2008 17:00:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id C1F4941C735; Thu, 11 Dec 2008 18:00:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id PyE3-VK0sEcm; Thu, 11 Dec 2008 18:00:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 72CAC41C734; Thu, 11 Dec 2008 18:00:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 5F2EC4448DD; Thu, 11 Dec 2008 16:57:24 +0000 (UTC) Date: Thu, 11 Dec 2008 16:57:24 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200812111544.mBBFir50068918@svn.freebsd.org> Message-ID: <20081211165343.T97918@maildrop.int.zabbadoz.net> References: <200812111544.mBBFir50068918@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r185932 - 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, 11 Dec 2008 17:00:09 -0000 On Thu, 11 Dec 2008, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Dec 11 15:44:53 2008 > New Revision: 185932 > URL: http://svn.freebsd.org/changeset/base/185932 > > Log: > Error in case anyone tried to compile with both options VIMAGE and > the (temporary) option VIMAGE_GLOBALS. Hi, in case anyone wonders what those options mean, do or ill do, there is a wiki page here: http://wiki.freebsd.org/Image/KernelOptions > Sponsored by: The FreeBSD Foundation: > > Modified: > head/sys/sys/vimage.h > > Modified: head/sys/sys/vimage.h > ============================================================================== > --- head/sys/sys/vimage.h Thu Dec 11 15:42:59 2008 (r185931) > +++ head/sys/sys/vimage.h Thu Dec 11 15:44:53 2008 (r185932) > @@ -60,6 +60,10 @@ struct vnet_modlink { > .vmi_symmap = m_symmap \ > }; > > +#if defined(VIMAGE) && defined(VIMAGE_GLOBALS) > +#error "You cannot have both option VIMAGE and option VIMAGE_GLOBALS!" > +#endif > + > #ifdef VIMAGE_GLOBALS > #define VSYM(base, sym) (sym) > #else > -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 17:06:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81333106564A; Thu, 11 Dec 2008 17:06:07 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (unknown [IPv6:2002:50b1:e8f2:1::143]) by mx1.freebsd.org (Postfix) with ESMTP id A4B728FC17; Thu, 11 Dec 2008 17:06:06 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc] (unknown [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc]) by itchy.rabson.org (Postfix) with ESMTP id 0BC433FA8; Thu, 11 Dec 2008 17:05:40 +0000 (GMT) Message-Id: From: Doug Rabson To: Paul Saab In-Reply-To: <200812111648.mBBGmZFD070379@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Thu, 11 Dec 2008 17:06:04 +0000 References: <200812111648.mBBGmZFD070379@svn.freebsd.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185938 - head/sys/boot/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, 11 Dec 2008 17:06:07 -0000 On 11 Dec 2008, at 16:48, Paul Saab wrote: > Author: ps > Date: Thu Dec 11 16:48:35 2008 > New Revision: 185938 > URL: http://svn.freebsd.org/changeset/base/185938 > > Log: > Fix a leak introduced in r185902. We should free the devspec if > we've successfully found a zfs pool. Thanks. From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 18:32:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC8F41065672; Thu, 11 Dec 2008 18:32:05 +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 9ED8C8FC1C; Thu, 11 Dec 2008 18:32:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBIW5td072502; Thu, 11 Dec 2008 18:32:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBIW5v0072501; Thu, 11 Dec 2008 18:32:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812111832.mBBIW5v0072501@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Dec 2008 18:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185940 - 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, 11 Dec 2008 18:32:05 -0000 Author: ed Date: Thu Dec 11 18:32:05 2008 New Revision: 185940 URL: http://svn.freebsd.org/changeset/base/185940 Log: Don't forget to add "npts" to rlimit_ident[] as well. When I added RLIMIT_NPTS, I forgot to add it to rlimit_ident[]. Make sure the rlimit_ident[] array is always RLIM_NLIMITS elements big. So if we ever forget to add new rlimits to this list again. it will contain a null pointer, instead of random data. Spotted by: rwatson Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Thu Dec 11 18:07:54 2008 (r185939) +++ head/sys/sys/resource.h Thu Dec 11 18:32:05 2008 (r185940) @@ -106,7 +106,7 @@ struct rusage { */ #ifdef _RLIMIT_IDENT -static char *rlimit_ident[] = { +static char *rlimit_ident[RLIM_NLIMITS] = { "cpu", "fsize", "data", @@ -118,6 +118,7 @@ static char *rlimit_ident[] = { "nofile", "sbsize", "vmem", + "npts", }; #endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 18:46:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E389B106564A; Thu, 11 Dec 2008 18:46:28 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8DE8FC0C; Thu, 11 Dec 2008 18:46:28 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id mBBIkQe6046619; Thu, 11 Dec 2008 11:46:27 -0700 (MST) Message-ID: <49415FFD.5070400@gritton.org> Date: Thu, 11 Dec 2008 11:46:21 -0700 From: James Gritton User-Agent: Thunderbird 2.0.0.9 (X11/20080228) MIME-Version: 1.0 To: John Baldwin References: <200812102056.mBAKuJ97042379@svn.freebsd.org> In-Reply-To: <200812102056.mBAKuJ97042379@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.93, clamav-milter version 0.93 on gritton.org X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185878 - in head/sys: compat/freebsd32 kern modules/aio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 18:46:29 -0000 freebsd32_aio_waitcomplete() has a small error: @@ -2824,7 +2824,7 @@ freebsd32_aio_waitcomplete(struct thread *td, struct freebsd32_aio_waitcomplete_args *uap) { - struct timespec ts32; + struct timespec32 ts32; struct timespec ts, *tsp; int error; - Jamie John Baldwin wrote: > Author: jhb > Date: Wed Dec 10 20:56:19 2008 > New Revision: 185878 > URL: http://svn.freebsd.org/changeset/base/185878 > > Log: > - Add 32-bit compat system calls for VFS_AIO. The system calls live in the > aio code and are registered via the recently added SYSCALL32_*() helpers. > - Since the aio code likes to invoke fuword and suword a lot down in the > "bowels" of system calls, add a structure holding a set of operations for > things like storing errors, copying in the aiocb structure, storing > status, etc. The 32-bit system calls use a separate operations vector to > handle fuword32 vs fuword, etc. Also, the oldsigevent handling is now > done by having seperate operation vectors with different aiocb copyin > routines. > - Split out kern_foo() functions for the various AIO system calls so the > 32-bit front ends can manage things like copying in and converting > timespec structures, etc. > - For both the native and 32-bit aio_suspend() and lio_listio() calls, > just use copyin() to read the array of aiocb pointers instead of using > a for loop that iterated over fuword/fuword32. The error handling in > the old case was incomplete (lio_listio() just ignored any aiocb's that > it got an EFAULT trying to read rather than reporting an error), and > possibly slower. > > MFC after: 1 month > > Modified: > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/vfs_aio.c > head/sys/modules/aio/Makefile > > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- head/sys/compat/freebsd32/syscalls.master Wed Dec 10 20:55:44 2008 (r185877) > +++ head/sys/compat/freebsd32/syscalls.master Wed Dec 10 20:56:19 2008 (r185878) > @@ -454,9 +454,13 @@ > u_int nfds, int timeout); } > 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } > 254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } > -255 AUE_NULL UNIMPL nosys > -256 AUE_NULL UNIMPL nosys > -257 AUE_NULL UNIMPL nosys > +255 AUE_NULL NOSTD { int freebsd32_aio_read( \ > + struct aiocb32 *aiocbp); } > +256 AUE_NULL NOSTD { int freebsd32_aio_write( \ > + struct aiocb32 *aiocbp); } > +257 AUE_NULL NOSTD { int freebsd32_lio_listio(int mode, \ > + struct aiocb32 * const *acb_list, \ > + int nent, struct sigevent *sig); } > 258 AUE_NULL UNIMPL nosys > 259 AUE_NULL UNIMPL nosys > 260 AUE_NULL UNIMPL nosys > @@ -535,13 +539,22 @@ > 312 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ > gid_t sgid); } > 313 AUE_NULL OBSOL signanosleep > -314 AUE_NULL UNIMPL aio_return > -315 AUE_NULL UNIMPL aio_suspend > -316 AUE_NULL UNIMPL aio_cancel > -317 AUE_NULL UNIMPL aio_error > -318 AUE_NULL UNIMPL aio_read > -319 AUE_NULL UNIMPL aio_write > -320 AUE_NULL UNIMPL lio_listio > +314 AUE_NULL NOSTD { int freebsd32_aio_return( \ > + struct aiocb32 *aiocbp); } > +315 AUE_NULL NOSTD { int freebsd32_aio_suspend( \ > + struct aiocb32 * const * aiocbp, int nent, \ > + const struct timespec32 *timeout); } > +316 AUE_NULL NOSTD { int freebsd32_aio_cancel(int fd, \ > + struct aiocb32 *aiocbp); } > +317 AUE_NULL NOSTD { int freebsd32_aio_error( \ > + struct aiocb32 *aiocbp); } > +318 AUE_NULL NOSTD { int freebsd32_oaio_read( \ > + struct oaiocb32 *aiocbp); } > +319 AUE_NULL NOSTD { int freebsd32_oaio_write( \ > + struct oaiocb32 *aiocbp); } > +320 AUE_NULL NOSTD { int freebsd32_olio_listio(int mode, \ > + struct oaiocb32 * const *acb_list, \ > + int nent, struct osigevent32 *sig); } > 321 AUE_NULL NOPROTO { int yield(void); } > 322 AUE_NULL OBSOL thr_sleep > 323 AUE_NULL OBSOL thr_wakeup > @@ -618,7 +631,9 @@ > 358 AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \ > const char *path, int attrnamespace, \ > const char *attrname); } > -359 AUE_NULL UNIMPL aio_waitcomplete > +359 AUE_NULL NOSTD { int freebsd32_aio_waitcomplete( \ > + struct aiocb32 **aiocbp, \ > + struct timespec32 *timeout); } > 360 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ > uid_t *suid); } > 361 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ > @@ -766,7 +781,8 @@ > 462 AUE_NULL UNIMPL kmq_unlink > 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } > 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } > -465 AUE_NULL UNIMPL aio_fsync > +465 AUE_NULL NOSTD { int freebsd32_aio_fsync(int op, \ > + struct aiocb32 *aiocbp); } > 466 AUE_RTPRIO NOPROTO { int rtprio_thread(int function, \ > lwpid_t lwpid, struct rtprio *rtp); } > 467 AUE_NULL UNIMPL nosys > > Modified: head/sys/kern/vfs_aio.c > ============================================================================== > --- head/sys/kern/vfs_aio.c Wed Dec 10 20:55:44 2008 (r185877) > +++ head/sys/kern/vfs_aio.c Wed Dec 10 20:56:19 2008 (r185878) > @@ -21,6 +21,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_compat.h" > + > #include > #include > #include > @@ -121,6 +123,8 @@ static uint64_t jobseqno; > > FEATURE(aio, "Asynchronous I/O"); > > +static MALLOC_DEFINE(M_LIO, "lio", "listio aio control block list"); > + > static SYSCTL_NODE(_vfs, OID_AUTO, aio, CTLFLAG_RW, 0, "Async IO management"); > > static int max_aio_procs = MAX_AIO_PROCS; > @@ -308,6 +312,20 @@ struct kaioinfo { > #define KAIO_RUNDOWN 0x1 /* process is being run down */ > #define KAIO_WAKEUP 0x2 /* wakeup process when there is a significant event */ > > +/* > + * Operations used to interact with userland aio control blocks. > + * Different ABIs provide their own operations. > + */ > +struct aiocb_ops { > + int (*copyin)(struct aiocb *ujob, struct aiocb *kjob); > + long (*fetch_status)(struct aiocb *ujob); > + long (*fetch_error)(struct aiocb *ujob); > + int (*store_status)(struct aiocb *ujob, long status); > + int (*store_error)(struct aiocb *ujob, long error); > + int (*store_kernelinfo)(struct aiocb *ujob, long jobref); > + int (*store_aiocb)(struct aiocb **ujobp, struct aiocb *ujob); > +}; > + > static TAILQ_HEAD(,aiothreadlist) aio_freeproc; /* (c) Idle daemons */ > static struct sema aio_newproc_sem; > static struct mtx aio_job_mtx; > @@ -321,7 +339,7 @@ static int aio_free_entry(struct aiocbli > static void aio_process(struct aiocblist *aiocbe); > static int aio_newproc(int *); > int aio_aqueue(struct thread *td, struct aiocb *job, > - struct aioliojob *lio, int type, int osigev); > + struct aioliojob *lio, int type, struct aiocb_ops *ops); > static void aio_physwakeup(struct buf *bp); > static void aio_proc_rundown(void *arg, struct proc *p); > static void aio_proc_rundown_exec(void *arg, struct proc *p, struct image_params *imgp); > @@ -333,7 +351,6 @@ static int aio_unload(void); > static void aio_bio_done_notify(struct proc *userp, struct aiocblist *aiocbe, int type); > #define DONE_BUF 1 > #define DONE_QUEUE 2 > -static int do_lio_listio(struct thread *td, struct lio_listio_args *uap, int oldsigev); > static int aio_kick(struct proc *userp); > static void aio_kick_nowait(struct proc *userp); > static void aio_kick_helper(void *context, int pending); > @@ -1322,13 +1339,122 @@ aio_swake_cb(struct socket *so, struct s > SOCKBUF_UNLOCK(sb); > } > > +static int > +convert_old_sigevent(struct osigevent *osig, struct sigevent *nsig) > +{ > + > + /* > + * Only SIGEV_NONE, SIGEV_SIGNAL, and SIGEV_KEVENT are > + * supported by AIO with the old sigevent structure. > + */ > + nsig->sigev_notify = osig->sigev_notify; > + switch (nsig->sigev_notify) { > + case SIGEV_NONE: > + break; > + case SIGEV_SIGNAL: > + nsig->sigev_signo = osig->__sigev_u.__sigev_signo; > + break; > + case SIGEV_KEVENT: > + nsig->sigev_notify_kqueue = > + osig->__sigev_u.__sigev_notify_kqueue; > + nsig->sigev_value.sival_ptr = osig->sigev_value.sival_ptr; > + break; > + default: > + return (EINVAL); > + } > + return (0); > +} > + > +static int > +aiocb_copyin_old_sigevent(struct aiocb *ujob, struct aiocb *kjob) > +{ > + struct oaiocb *ojob; > + int error; > + > + bzero(kjob, sizeof(struct aiocb)); > + error = copyin(ujob, kjob, sizeof(struct oaiocb)); > + if (error) > + return (error); > + ojob = (struct oaiocb *)kjob; > + return (convert_old_sigevent(&ojob->aio_sigevent, &kjob->aio_sigevent)); > +} > + > +static int > +aiocb_copyin(struct aiocb *ujob, struct aiocb *kjob) > +{ > + > + return (copyin(ujob, kjob, sizeof(struct aiocb))); > +} > + > +static long > +aiocb_fetch_status(struct aiocb *ujob) > +{ > + > + return (fuword(&ujob->_aiocb_private.status)); > +} > + > +static long > +aiocb_fetch_error(struct aiocb *ujob) > +{ > + > + return (fuword(&ujob->_aiocb_private.error)); > +} > + > +static int > +aiocb_store_status(struct aiocb *ujob, long status) > +{ > + > + return (suword(&ujob->_aiocb_private.status, status)); > +} > + > +static int > +aiocb_store_error(struct aiocb *ujob, long error) > +{ > + > + return (suword(&ujob->_aiocb_private.error, error)); > +} > + > +static int > +aiocb_store_kernelinfo(struct aiocb *ujob, long jobref) > +{ > + > + return (suword(&ujob->_aiocb_private.kernelinfo, jobref)); > +} > + > +static int > +aiocb_store_aiocb(struct aiocb **ujobp, struct aiocb *ujob) > +{ > + > + return (suword(ujobp, (long)ujob)); > +} > + > +static struct aiocb_ops aiocb_ops = { > + .copyin = aiocb_copyin, > + .fetch_status = aiocb_fetch_status, > + .fetch_error = aiocb_fetch_error, > + .store_status = aiocb_store_status, > + .store_error = aiocb_store_error, > + .store_kernelinfo = aiocb_store_kernelinfo, > + .store_aiocb = aiocb_store_aiocb, > +}; > + > +static struct aiocb_ops aiocb_ops_osigevent = { > + .copyin = aiocb_copyin_old_sigevent, > + .fetch_status = aiocb_fetch_status, > + .fetch_error = aiocb_fetch_error, > + .store_status = aiocb_store_status, > + .store_error = aiocb_store_error, > + .store_kernelinfo = aiocb_store_kernelinfo, > + .store_aiocb = aiocb_store_aiocb, > +}; > + > /* > * Queue a new AIO request. Choosing either the threaded or direct physio VCHR > * technique is done in this code. > */ > int > aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj, > - int type, int oldsigev) > + int type, struct aiocb_ops *ops) > { > struct proc *p = td->td_proc; > struct file *fp; > @@ -1347,13 +1473,13 @@ aio_aqueue(struct thread *td, struct aio > > ki = p->p_aioinfo; > > - suword(&job->_aiocb_private.status, -1); > - suword(&job->_aiocb_private.error, 0); > - suword(&job->_aiocb_private.kernelinfo, -1); > + ops->store_status(job, -1); > + ops->store_error(job, 0); > + ops->store_kernelinfo(job, -1); > > if (num_queue_count >= max_queue_count || > ki->kaio_count >= ki->kaio_qallowed_count) { > - suword(&job->_aiocb_private.error, EAGAIN); > + ops->store_error(job, EAGAIN); > return (EAGAIN); > } > > @@ -1362,16 +1488,9 @@ aio_aqueue(struct thread *td, struct aio > aiocbe->outputcharge = 0; > knlist_init(&aiocbe->klist, AIO_MTX(ki), NULL, NULL, NULL); > > - if (oldsigev) { > - bzero(&aiocbe->uaiocb, sizeof(struct aiocb)); > - error = copyin(job, &aiocbe->uaiocb, sizeof(struct oaiocb)); > - bcopy(&aiocbe->uaiocb.__spare__, &aiocbe->uaiocb.aio_sigevent, > - sizeof(struct osigevent)); > - } else { > - error = copyin(job, &aiocbe->uaiocb, sizeof(struct aiocb)); > - } > + error = ops->copyin(job, &aiocbe->uaiocb); > if (error) { > - suword(&job->_aiocb_private.error, error); > + ops->store_error(job, error); > uma_zfree(aiocb_zone, aiocbe); > return (error); > } > @@ -1380,11 +1499,11 @@ aio_aqueue(struct thread *td, struct aio > aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_SIGNAL && > aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_THREAD_ID && > aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_NONE) { > - suword(&job->_aiocb_private.error, EINVAL); > + ops->store_error(job, EINVAL); > uma_zfree(aiocb_zone, aiocbe); > return (EINVAL); > } > - > + > if ((aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL || > aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_THREAD_ID) && > !_SIG_VALID(aiocbe->uaiocb.aio_sigevent.sigev_signo)) { > @@ -1416,7 +1535,7 @@ aio_aqueue(struct thread *td, struct aio > } > if (error) { > uma_zfree(aiocb_zone, aiocbe); > - suword(&job->_aiocb_private.error, error); > + ops->store_error(job, error); > return (error); > } > > @@ -1436,7 +1555,7 @@ aio_aqueue(struct thread *td, struct aio > jid = jobrefid++; > aiocbe->seqno = jobseqno++; > mtx_unlock(&aio_job_mtx); > - error = suword(&job->_aiocb_private.kernelinfo, jid); > + error = ops->store_kernelinfo(job, jid); > if (error) { > error = EINVAL; > goto aqueue_fail; > @@ -1467,12 +1586,12 @@ aqueue_fail: > if (error) { > fdrop(fp, td); > uma_zfree(aiocb_zone, aiocbe); > - suword(&job->_aiocb_private.error, error); > + ops->store_error(job, error); > goto done; > } > no_kqueue: > > - suword(&job->_aiocb_private.error, EINPROGRESS); > + ops->store_error(job, EINPROGRESS); > aiocbe->uaiocb._aiocb_private.error = EINPROGRESS; > aiocbe->userproc = p; > aiocbe->cred = crhold(td->td_ucred); > @@ -1528,7 +1647,7 @@ no_kqueue: > #if 0 > if (error > 0) { > aiocbe->uaiocb._aiocb_private.error = error; > - suword(&job->_aiocb_private.error, error); > + ops->store_error(job, error); > goto done; > } > #endif > @@ -1643,19 +1762,17 @@ aio_kick_helper(void *context, int pendi > * Support the aio_return system call, as a side-effect, kernel resources are > * released. > */ > -int > -aio_return(struct thread *td, struct aio_return_args *uap) > +static int > +kern_aio_return(struct thread *td, struct aiocb *uaiocb, struct aiocb_ops *ops) > { > struct proc *p = td->td_proc; > struct aiocblist *cb; > - struct aiocb *uaiocb; > struct kaioinfo *ki; > int status, error; > > ki = p->p_aioinfo; > if (ki == NULL) > return (EINVAL); > - uaiocb = uap->aiocbp; > AIO_LOCK(ki); > TAILQ_FOREACH(cb, &ki->kaio_done, plist) { > if (cb->uuaiocb == uaiocb) > @@ -1675,8 +1792,8 @@ aio_return(struct thread *td, struct aio > } > aio_free_entry(cb); > AIO_UNLOCK(ki); > - suword(&uaiocb->_aiocb_private.error, error); > - suword(&uaiocb->_aiocb_private.status, status); > + ops->store_error(uaiocb, error); > + ops->store_status(uaiocb, status); > } else { > error = EINVAL; > AIO_UNLOCK(ki); > @@ -1684,37 +1801,32 @@ aio_return(struct thread *td, struct aio > return (error); > } > > +int > +aio_return(struct thread *td, struct aio_return_args *uap) > +{ > + > + return (kern_aio_return(td, uap->aiocbp, &aiocb_ops)); > +} > + > /* > * Allow a process to wakeup when any of the I/O requests are completed. > */ > -int > -aio_suspend(struct thread *td, struct aio_suspend_args *uap) > +static int > +kern_aio_suspend(struct thread *td, int njoblist, struct aiocb **ujoblist, > + struct timespec *ts) > { > struct proc *p = td->td_proc; > struct timeval atv; > - struct timespec ts; > - struct aiocb *const *cbptr, *cbp; > struct kaioinfo *ki; > struct aiocblist *cb, *cbfirst; > - struct aiocb **ujoblist; > - int njoblist; > - int error; > - int timo; > - int i; > - > - if (uap->nent < 0 || uap->nent > AIO_LISTIO_MAX) > - return (EINVAL); > + int error, i, timo; > > timo = 0; > - if (uap->timeout) { > - /* Get timespec struct. */ > - if ((error = copyin(uap->timeout, &ts, sizeof(ts))) != 0) > - return (error); > - > - if (ts.tv_nsec < 0 || ts.tv_nsec >= 1000000000) > + if (ts) { > + if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000) > return (EINVAL); > > - TIMESPEC_TO_TIMEVAL(&atv, &ts); > + TIMESPEC_TO_TIMEVAL(&atv, ts); > if (itimerfix(&atv)) > return (EINVAL); > timo = tvtohz(&atv); > @@ -1724,22 +1836,8 @@ aio_suspend(struct thread *td, struct ai > if (ki == NULL) > return (EAGAIN); > > - njoblist = 0; > - ujoblist = uma_zalloc(aiol_zone, M_WAITOK); > - cbptr = uap->aiocbp; > - > - for (i = 0; i < uap->nent; i++) { > - cbp = (struct aiocb *)(intptr_t)fuword(&cbptr[i]); > - if (cbp == 0) > - continue; > - ujoblist[njoblist] = cbp; > - njoblist++; > - } > - > - if (njoblist == 0) { > - uma_zfree(aiol_zone, ujoblist); > + if (njoblist == 0) > return (0); > - } > > AIO_LOCK(ki); > for (;;) { > @@ -1769,6 +1867,31 @@ aio_suspend(struct thread *td, struct ai > } > RETURN: > AIO_UNLOCK(ki); > + return (error); > +} > + > +int > +aio_suspend(struct thread *td, struct aio_suspend_args *uap) > +{ > + struct timespec ts, *tsp; > + struct aiocb **ujoblist; > + int error; > + > + if (uap->nent < 0 || uap->nent > AIO_LISTIO_MAX) > + return (EINVAL); > + > + if (uap->timeout) { > + /* Get timespec struct. */ > + if ((error = copyin(uap->timeout, &ts, sizeof(ts))) != 0) > + return (error); > + tsp = &ts; > + } else > + tsp = NULL; > + > + ujoblist = uma_zalloc(aiol_zone, M_WAITOK); > + error = copyin(uap->aiocbp, ujoblist, uap->nent * sizeof(ujoblist[0])); > + if (error == 0) > + error = kern_aio_suspend(td, uap->nent, ujoblist, tsp); > uma_zfree(aiol_zone, ujoblist); > return (error); > } > @@ -1876,8 +1999,8 @@ done: > * only. For a user mode async implementation, it would be best to do it in > * a userland subroutine. > */ > -int > -aio_error(struct thread *td, struct aio_error_args *uap) > +static int > +kern_aio_error(struct thread *td, struct aiocb *aiocbp, struct aiocb_ops *ops) > { > struct proc *p = td->td_proc; > struct aiocblist *cb; > @@ -1892,7 +2015,7 @@ aio_error(struct thread *td, struct aio_ > > AIO_LOCK(ki); > TAILQ_FOREACH(cb, &ki->kaio_all, allist) { > - if (cb->uuaiocb == uap->aiocbp) { > + if (cb->uuaiocb == aiocbp) { > if (cb->jobstate == JOBST_JOBFINISHED) > td->td_retval[0] = > cb->uaiocb._aiocb_private.error; > @@ -1907,9 +2030,9 @@ aio_error(struct thread *td, struct aio_ > /* > * Hack for failure of aio_aqueue. > */ > - status = fuword(&uap->aiocbp->_aiocb_private.status); > + status = ops->fetch_status(aiocbp); > if (status == -1) { > - td->td_retval[0] = fuword(&uap->aiocbp->_aiocb_private.error); > + td->td_retval[0] = ops->fetch_error(aiocbp); > return (0); > } > > @@ -1917,19 +2040,27 @@ aio_error(struct thread *td, struct aio_ > return (0); > } > > +int > +aio_error(struct thread *td, struct aio_error_args *uap) > +{ > + > + return (kern_aio_error(td, uap->aiocbp, &aiocb_ops)); > +} > + > /* syscall - asynchronous read from a file (REALTIME) */ > int > oaio_read(struct thread *td, struct oaio_read_args *uap) > { > > - return aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_READ, 1); > + return (aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_READ, > + &aiocb_ops_osigevent)); > } > > int > aio_read(struct thread *td, struct aio_read_args *uap) > { > > - return aio_aqueue(td, uap->aiocbp, NULL, LIO_READ, 0); > + return (aio_aqueue(td, uap->aiocbp, NULL, LIO_READ, &aiocb_ops)); > } > > /* syscall - asynchronous write to a file (REALTIME) */ > @@ -1937,47 +2068,34 @@ int > oaio_write(struct thread *td, struct oaio_write_args *uap) > { > > - return aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_WRITE, 1); > + return (aio_aqueue(td, (struct aiocb *)uap->aiocbp, NULL, LIO_WRITE, > + &aiocb_ops_osigevent)); > } > > int > aio_write(struct thread *td, struct aio_write_args *uap) > { > > - return aio_aqueue(td, uap->aiocbp, NULL, LIO_WRITE, 0); > -} > - > -/* syscall - list directed I/O (REALTIME) */ > -int > -olio_listio(struct thread *td, struct olio_listio_args *uap) > -{ > - return do_lio_listio(td, (struct lio_listio_args *)uap, 1); > -} > - > -/* syscall - list directed I/O (REALTIME) */ > -int > -lio_listio(struct thread *td, struct lio_listio_args *uap) > -{ > - return do_lio_listio(td, uap, 0); > + return (aio_aqueue(td, uap->aiocbp, NULL, LIO_WRITE, &aiocb_ops)); > } > > static int > -do_lio_listio(struct thread *td, struct lio_listio_args *uap, int oldsigev) > +kern_lio_listio(struct thread *td, int mode, struct aiocb * const *uacb_list, > + struct aiocb **acb_list, int nent, struct sigevent *sig, > + struct aiocb_ops *ops) > { > struct proc *p = td->td_proc; > - struct aiocb *iocb, * const *cbptr; > + struct aiocb *iocb; > struct kaioinfo *ki; > struct aioliojob *lj; > struct kevent kev; > - int nent; > int error; > int nerror; > int i; > > - if ((uap->mode != LIO_NOWAIT) && (uap->mode != LIO_WAIT)) > + if ((mode != LIO_NOWAIT) && (mode != LIO_WAIT)) > return (EINVAL); > > - nent = uap->nent; > if (nent < 0 || nent > AIO_LISTIO_MAX) > return (EINVAL); > > @@ -1996,21 +2114,13 @@ do_lio_listio(struct thread *td, struct > /* > * Setup signal. > */ > - if (uap->sig && (uap->mode == LIO_NOWAIT)) { > - bzero(&lj->lioj_signal, sizeof(&lj->lioj_signal)); > - error = copyin(uap->sig, &lj->lioj_signal, > - oldsigev ? sizeof(struct osigevent) : > - sizeof(struct sigevent)); > - if (error) { > - uma_zfree(aiolio_zone, lj); > - return (error); > - } > - > + if (sig && (mode == LIO_NOWAIT)) { > + bcopy(sig, &lj->lioj_signal, sizeof(lj->lioj_signal)); > if (lj->lioj_signal.sigev_notify == SIGEV_KEVENT) { > /* Assume only new style KEVENT */ > kev.filter = EVFILT_LIO; > kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; > - kev.ident = (uintptr_t)uap->acb_list; /* something unique */ > + kev.ident = (uintptr_t)uacb_list; /* something unique */ > kev.data = (intptr_t)lj; > /* pass user defined sigval data */ > kev.udata = lj->lioj_signal.sigev_value.sival_ptr; > @@ -2050,11 +2160,10 @@ do_lio_listio(struct thread *td, struct > * Get pointers to the list of I/O requests. > */ > nerror = 0; > - cbptr = uap->acb_list; > - for (i = 0; i < uap->nent; i++) { > - iocb = (struct aiocb *)(intptr_t)fuword(&cbptr[i]); > - if (((intptr_t)iocb != -1) && ((intptr_t)iocb != 0)) { > - error = aio_aqueue(td, iocb, lj, LIO_NOP, oldsigev); > + for (i = 0; i < nent; i++) { > + iocb = acb_list[i]; > + if (iocb != NULL) { > + error = aio_aqueue(td, iocb, lj, LIO_NOP, ops); > if (error != 0) > nerror++; > } > @@ -2062,7 +2171,7 @@ do_lio_listio(struct thread *td, struct > > error = 0; > AIO_LOCK(ki); > - if (uap->mode == LIO_WAIT) { > + if (mode == LIO_WAIT) { > while (lj->lioj_count - 1 != lj->lioj_finished_count) { > ki->kaio_flags |= KAIO_WAKEUP; > error = msleep(&p->p_aioinfo, AIO_MTX(ki), > @@ -2105,6 +2214,75 @@ do_lio_listio(struct thread *td, struct > return (error); > } > > +/* syscall - list directed I/O (REALTIME) */ > +int > +olio_listio(struct thread *td, struct olio_listio_args *uap) > +{ > + struct aiocb **acb_list; > + struct sigevent *sigp, sig; > + struct osigevent osig; > + int error, nent; > + > + if ((uap->mode != LIO_NOWAIT) && (uap->mode != LIO_WAIT)) > + return (EINVAL); > + > + nent = uap->nent; > + if (nent < 0 || nent > AIO_LISTIO_MAX) > + return (EINVAL); > + > + if (uap->sig && (uap->mode == LIO_NOWAIT)) { > + error = copyin(uap->sig, &osig, sizeof(osig)); > + if (error) > + return (error); > + error = convert_old_sigevent(&osig, &sig); > + if (error) > + return (error); > + sigp = &sig; > + } else > + sigp = NULL; > + > + acb_list = malloc(sizeof(struct aiocb *) * nent, M_LIO, M_WAITOK); > + error = copyin(uap->acb_list, acb_list, nent * sizeof(acb_list[0])); > + if (error == 0) > + error = kern_lio_listio(td, uap->mode, > + (struct aiocb * const *)uap->acb_list, acb_list, nent, sigp, > + &aiocb_ops_osigevent); > + free(acb_list, M_LIO); > + return (error); > +} > + > +/* syscall - list directed I/O (REALTIME) */ > +int > +lio_listio(struct thread *td, struct lio_listio_args *uap) > +{ > + struct aiocb **acb_list; > + struct sigevent *sigp, sig; > + int error, nent; > + > + if ((uap->mode != LIO_NOWAIT) && (uap->mode != LIO_WAIT)) > + return (EINVAL); > + > + nent = uap->nent; > + if (nent < 0 || nent > AIO_LISTIO_MAX) > + return (EINVAL); > + > + if (uap->sig && (uap->mode == LIO_NOWAIT)) { > + error = copyin(uap->sig, &sig, sizeof(sig)); > + if (error) > + return (error); > + sigp = &sig; > + } else > + sigp = NULL; > + > + acb_list = malloc(sizeof(struct aiocb *) * nent, M_LIO, M_WAITOK); > + error = copyin(uap->acb_list, acb_list, nent * sizeof(acb_list[0])); > + if (error == 0) > + error = kern_lio_listio(td, uap->mode, uap->acb_list, acb_list, > + nent, sigp, &aiocb_ops); > + free(acb_list, M_LIO); > + return (error); > +} > + > /* > * Called from interrupt thread for physio, we should return as fast > * as possible, so we schedule a biohelper task. > @@ -2156,30 +2334,25 @@ biohelper(void *context, int pending) > } > > /* syscall - wait for the next completion of an aio request */ > -int > -aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap) > +static int > +kern_aio_waitcomplete(struct thread *td, struct aiocb **aiocbp, > + struct timespec *ts, struct aiocb_ops *ops) > { > struct proc *p = td->td_proc; > struct timeval atv; > - struct timespec ts; > struct kaioinfo *ki; > struct aiocblist *cb; > struct aiocb *uuaiocb; > int error, status, timo; > > - suword(uap->aiocbp, (long)NULL); > + ops->store_aiocb(aiocbp, NULL); > > timo = 0; > - if (uap->timeout) { > - /* Get timespec struct. */ > - error = copyin(uap->timeout, &ts, sizeof(ts)); > - if (error) > - return (error); > - > - if ((ts.tv_nsec < 0) || (ts.tv_nsec >= 1000000000)) > + if (ts) { > + if ((ts->tv_nsec < 0) || (ts->tv_nsec >= 1000000000)) > return (EINVAL); > > - TIMESPEC_TO_TIMEVAL(&atv, &ts); > + TIMESPEC_TO_TIMEVAL(&atv, ts); > if (itimerfix(&atv)) > return (EINVAL); > timo = tvtohz(&atv); > @@ -2217,9 +2390,9 @@ aio_waitcomplete(struct thread *td, stru > } > aio_free_entry(cb); > AIO_UNLOCK(ki); > - suword(uap->aiocbp, (long)uuaiocb); > - suword(&uuaiocb->_aiocb_private.error, error); > - suword(&uuaiocb->_aiocb_private.status, status); > + ops->store_aiocb(aiocbp, uuaiocb); > + ops->store_error(uuaiocb, error); > + ops->store_status(uuaiocb, status); > } else > AIO_UNLOCK(ki); > > @@ -2227,17 +2400,43 @@ aio_waitcomplete(struct thread *td, stru > } > > int > -aio_fsync(struct thread *td, struct aio_fsync_args *uap) > +aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap) > +{ > + struct timespec ts, *tsp; > + int error; > + > + if (uap->timeout) { > + /* Get timespec struct. */ > + error = copyin(uap->timeout, &ts, sizeof(ts)); > + if (error) > + return (error); > + tsp = &ts; > + } else > + tsp = NULL; > + > + return (kern_aio_waitcomplete(td, uap->aiocbp, tsp, &aiocb_ops)); > +} > + > +static int > +kern_aio_fsync(struct thread *td, int op, struct aiocb *aiocbp, > + struct aiocb_ops *ops) > { > struct proc *p = td->td_proc; > struct kaioinfo *ki; > > - if (uap->op != O_SYNC) /* XXX lack of O_DSYNC */ > + if (op != O_SYNC) /* XXX lack of O_DSYNC */ > return (EINVAL); > ki = p->p_aioinfo; > if (ki == NULL) > aio_init_aioinfo(p); > - return aio_aqueue(td, uap->aiocbp, NULL, LIO_SYNC, 0); > + return (aio_aqueue(td, aiocbp, NULL, LIO_SYNC, ops)); > +} > + > +int > +aio_fsync(struct thread *td, struct aio_fsync_args *uap) > +{ > + > + return (kern_aio_fsync(td, uap->op, uap->aiocbp, &aiocb_ops)); > } > > /* kqueue attach function */ > @@ -2325,3 +2524,433 @@ filt_lio(struct knote *kn, long hint) > > return (lj->lioj_flags & LIOJ_KEVENT_POSTED); > } > + > +#ifdef COMPAT_IA32 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +struct __aiocb_private32 { > + int32_t status; > + int32_t error; > + uint32_t kernelinfo; > +}; > + > +typedef struct oaiocb32 { > + int aio_fildes; /* File descriptor */ > + uint64_t aio_offset __packed; /* File offset for I/O */ > + uint32_t aio_buf; /* I/O buffer in process space */ > + uint32_t aio_nbytes; /* Number of bytes for I/O */ > + struct osigevent32 aio_sigevent; /* Signal to deliver */ > + int aio_lio_opcode; /* LIO opcode */ > + int aio_reqprio; /* Request priority -- ignored */ > + struct __aiocb_private32 _aiocb_private; > +} oaiocb32_t; > + > +typedef struct aiocb32 { > + int32_t aio_fildes; /* File descriptor */ > + uint64_t aio_offset __packed; /* File offset for I/O */ > + uint32_t aio_buf; /* I/O buffer in process space */ > + uint32_t aio_nbytes; /* Number of bytes for I/O */ > + int __spare__[2]; > + uint32_t __spare2__; > + int aio_lio_opcode; /* LIO opcode */ > + int aio_reqprio; /* Request priority -- ignored */ > + struct __aiocb_private32 _aiocb_private; > + struct sigevent32 aio_sigevent; /* Signal to deliver */ > +} aiocb32_t; > + > +static int > +convert_old_sigevent32(struct osigevent32 *osig, struct sigevent *nsig) > +{ > + > + /* > + * Only SIGEV_NONE, SIGEV_SIGNAL, and SIGEV_KEVENT are > + * supported by AIO with the old sigevent structure. > + */ > + CP(*osig, *nsig, sigev_notify); > + switch (nsig->sigev_notify) { > + case SIGEV_NONE: > + break; > + case SIGEV_SIGNAL: > + nsig->sigev_signo = osig->__sigev_u.__sigev_signo; > + break; > + case SIGEV_KEVENT: > + nsig->sigev_notify_kqueue = > + osig->__sigev_u.__sigev_notify_kqueue; > + PTRIN_CP(*osig, *nsig, sigev_value.sival_ptr); > + break; > + default: > + return (EINVAL); > + } > + return (0); > +} > + > +static int > +aiocb32_copyin_old_sigevent(struct aiocb *ujob, struct aiocb *kjob) > +{ > + struct oaiocb32 job32; > + int error; > + > + bzero(kjob, sizeof(struct aiocb)); > + error = copyin(ujob, &job32, sizeof(job32)); > + if (error) > + return (error); > + > + CP(job32, *kjob, aio_fildes); > + CP(job32, *kjob, aio_offset); > + PTRIN_CP(job32, *kjob, aio_buf); > + CP(job32, *kjob, aio_nbytes); > + CP(job32, *kjob, aio_lio_opcode); > + CP(job32, *kjob, aio_reqprio); > + CP(job32, *kjob, _aiocb_private.status); > + CP(job32, *kjob, _aiocb_private.error); > + PTRIN_CP(job32, *kjob, _aiocb_private.kernelinfo); > + return (convert_old_sigevent32(&job32.aio_sigevent, > + &kjob->aio_sigevent)); > +} > + > +static int > +convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) > +{ > + > + CP(*sig32, *sig, sigev_notify); > + switch (sig->sigev_notify) { > + case SIGEV_NONE: > + break; > + case SIGEV_THREAD_ID: > + CP(*sig32, *sig, sigev_notify_thread_id); > + /* FALLTHROUGH */ > + case SIGEV_SIGNAL: > + CP(*sig32, *sig, sigev_signo); > + break; > + case SIGEV_KEVENT: > + CP(*sig32, *sig, sigev_notify_kqueue); > + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); > + break; > + default: > + return (EINVAL); > + } > + return (0); > +} > + > +static int > +aiocb32_copyin(struct aiocb *ujob, struct aiocb *kjob) > +{ > + struct aiocb32 job32; > + int error; > + > + error = copyin(ujob, &job32, sizeof(job32)); > + if (error) > + return (error); > + CP(job32, *kjob, aio_fildes); > + CP(job32, *kjob, aio_offset); > + PTRIN_CP(job32, *kjob, aio_buf); > + CP(job32, *kjob, aio_nbytes); > + CP(job32, *kjob, aio_lio_opcode); > + CP(job32, *kjob, aio_reqprio); > + CP(job32, *kjob, _aiocb_private.status); > + CP(job32, *kjob, _aiocb_private.error); > + PTRIN_CP(job32, *kjob, _aiocb_private.kernelinfo); > + return (convert_sigevent32(&job32.aio_sigevent, &kjob->aio_sigevent)); > +} > + > +static long > +aiocb32_fetch_status(struct aiocb *ujob) > +{ > + struct aiocb32 *ujob32; > + > + ujob32 = (struct aiocb32 *)ujob; > + return (fuword32(&ujob32->_aiocb_private.status)); > +} > + > +static long > +aiocb32_fetch_error(struct aiocb *ujob) > +{ > + struct aiocb32 *ujob32; > + > + ujob32 = (struct aiocb32 *)ujob; > + return (fuword32(&ujob32->_aiocb_private.error)); > +} > + > +static int > +aiocb32_store_status(struct aiocb *ujob, long status) > +{ > + struct aiocb32 *ujob32; > + > + ujob32 = (struct aiocb32 *)ujob; > + return (suword32(&ujob32->_aiocb_private.status, status)); > +} > + > +static int > +aiocb32_store_error(struct aiocb *ujob, long error) > +{ > + struct aiocb32 *ujob32; > + > + ujob32 = (struct aiocb32 *)ujob; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 19:03:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84931106564A; Thu, 11 Dec 2008 19:03:20 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from core.tav.kiev.ua (tavex.colocall.com [62.149.10.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCA88FC14; Thu, 11 Dec 2008 19:03:19 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from 204-174-83-31.static569.dsl.ucc-net.ca ([204.174.83.31] helo=[10.80.5.156]) by core.tav.kiev.ua with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.52 (FreeBSD)) id 1LAqLj-000Es7-9n; Thu, 11 Dec 2008 20:33:25 +0200 Message-ID: <49415CD4.7090904@bluezbox.com> Date: Thu, 11 Dec 2008 10:32:52 -0800 From: Oleksandr Tymoshenko User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200812110822.mBB8MKLd059320@svn.freebsd.org> <86oczjklk8.fsf@ds4.des.no> In-Reply-To: <86oczjklk8.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Core-Spam-Level: ---- X-Core-Spam-Report: Spam detection software, running on the system "core.tav.kiev.ua", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dag-Erling Smørgrav wrote: > Warner Losh writes: >> Author: imp >> Date: Thu Dec 11 08:22:20 2008 >> New Revision: 185925 >> URL: http://svn.freebsd.org/changeset/base/185925 >> >> Log: >> Push mips support into the tree. > > Just to pick a random mips commit - > > There is something wrong with the mips toolchain. The build breaks in > libpam, while building the static version, which includes all modules: > > ../modules/pam_deny/libpam_deny.a(pam_deny.o)(.text+0x3c): In function `pam_sm_open_session': > /src/lib/libpam/modules/pam_deny/pam_deny.c:80: multiple definition of `pam_sm_open_session' > ../modules/pam_chroot/libpam_chroot.a(pam_chroot.o)(.text+0x14):/src/lib/libpam/modules/pam_chroot/pam_chroot.c:54: first defined here > [lather, rinse, repeat for every service function in every module] > > The service functions should be static. The logic PAM uses to determine > whether it is building static or shared modules is as follows: > > #if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES) Using ABI calls (-mabicalls) assume -fPIC. This issue is known for a long time now and I proposed a fix but didn't have enough time to get/commit proper solution. We discussed it about three months ago: http://lists.freebsd.org/pipermail/freebsd-arch/2008-August/008430.html [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 19:03:20 -0000 Dag-Erling Smørgrav wrote: > Warner Losh writes: >> Author: imp >> Date: Thu Dec 11 08:22:20 2008 >> New Revision: 185925 >> URL: http://svn.freebsd.org/changeset/base/185925 >> >> Log: >> Push mips support into the tree. > > Just to pick a random mips commit - > > There is something wrong with the mips toolchain. The build breaks in > libpam, while building the static version, which includes all modules: > > ../modules/pam_deny/libpam_deny.a(pam_deny.o)(.text+0x3c): In function `pam_sm_open_session': > /src/lib/libpam/modules/pam_deny/pam_deny.c:80: multiple definition of `pam_sm_open_session' > ../modules/pam_chroot/libpam_chroot.a(pam_chroot.o)(.text+0x14):/src/lib/libpam/modules/pam_chroot/pam_chroot.c:54: first defined here > [lather, rinse, repeat for every service function in every module] > > The service functions should be static. The logic PAM uses to determine > whether it is building static or shared modules is as follows: > > #if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES) Using ABI calls (-mabicalls) assume -fPIC. This issue is known for a long time now and I proposed a fix but didn't have enough time to get/commit proper solution. We discussed it about three months ago: http://lists.freebsd.org/pipermail/freebsd-arch/2008-August/008430.html From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 19:59:36 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5FB51065670; Thu, 11 Dec 2008 19:59:36 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id A8A578FC0C; Thu, 11 Dec 2008 19:59:36 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id mBBJMlRA028565; Thu, 11 Dec 2008 11:22:47 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id mBBJMlmD028564; Thu, 11 Dec 2008 11:22:47 -0800 (PST) (envelope-from obrien) Date: Thu, 11 Dec 2008 11:22:47 -0800 From: "David O'Brien" To: Luigi Rizzo Message-ID: <20081211192247.GB28382@dragon.NUXI.org> References: <200812021457.mB2Evmha063418@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812021457.mB2Evmha063418@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r185562 - head/sys/boot/i386/boot0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@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: Thu, 11 Dec 2008 19:59:36 -0000 On Tue, Dec 02, 2008 at 02:57:48PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Tue Dec 2 14:57:48 2008 > New Revision: 185562 > URL: http://svn.freebsd.org/changeset/base/185562 .. > BIOSes can be hooked to PXE) by pressing F6. There is unfortunately > no room to print the additional menu option. > Also, to make room for the code, the 'Default: ' string is > changed to 'Boot: ' JHB had patches to increase the size of boot0 to two sectors. It was at first deemed unsuitable due to buggy BIOS's. This isn't really an issue any more. After that, other things were done that a single sector was enough space for boot0. What do you think about growing boot0 to two sectors to give more room for features? From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 19:59:37 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 097371065673; Thu, 11 Dec 2008 19:59:37 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id E0F8F8FC1D; Thu, 11 Dec 2008 19:59:36 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id mBBJKArx028480; Thu, 11 Dec 2008 11:20:10 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id mBBJKAx5028479; Thu, 11 Dec 2008 11:20:10 -0800 (PST) (envelope-from obrien) Date: Thu, 11 Dec 2008 11:20:10 -0800 From: "David O'Brien" To: Luigi Rizzo Message-ID: <20081211192010.GA28382@dragon.NUXI.org> References: <200812021457.mB2Evmha063418@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812021457.mB2Evmha063418@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r185562 - head/sys/boot/i386/boot0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@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: Thu, 11 Dec 2008 19:59:37 -0000 Luigi, If I understand this correctly: On Tue, Dec 02, 2008 at 02:57:48PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Tue Dec 2 14:57:48 2008 > New Revision: 185562 > URL: http://svn.freebsd.org/changeset/base/185562 .. > The behaviour of the standard build differs from the previous > version in the following, minor things: > + 'noupdate' is the default, which means the code does not > write back the selection to disk. You can enable the feature > at runtime with boot0cfg, or changing the flags in the Makefile. .. > MFC after: 6 weeks If this means hitting "F2" in head will not longer be remembered, please back out this part of the change. The FreeBSD boot selector has acted this way for over a decade - changing it now is against POLA. If I've misunderstood the comment, never mind. :-) thanks, -- David From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 21:08:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537811065670; Thu, 11 Dec 2008 21:08:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428F28FC13; Thu, 11 Dec 2008 21:08:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBL8FLp076746; Thu, 11 Dec 2008 21:08:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBL8Fe3076745; Thu, 11 Dec 2008 21:08:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812112108.mBBL8Fe3076745@svn.freebsd.org> From: Andrew Thompson Date: Thu, 11 Dec 2008 21:08: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: r185941 - head/sys/dev/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: Thu, 11 Dec 2008 21:08:15 -0000 Author: thompsa Date: Thu Dec 11 21:08:14 2008 New Revision: 185941 URL: http://svn.freebsd.org/changeset/base/185941 Log: Add entries for some Option, Sierra and Stelera 3G cards. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Dec 11 18:32:05 2008 (r185940) +++ head/sys/dev/usb/usbdevs Thu Dec 11 21:08:14 2008 (r185941) @@ -620,6 +620,7 @@ vendor AMIT 0x18c5 AMIT vendor QCOM 0x18e8 Qcom vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor STELERA 0x1a8d Stelera Wireless vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor ERICSSON 0x2282 Ericsson @@ -1876,6 +1877,7 @@ product OPTION VODAFONEMC3G 0x5000 Vodaf product OPTION GT3G 0x6000 GlobeTrotter 3G datacard product OPTION GT3GQUAD 0x6300 GlobeTrotter 3G QUAD datacard product OPTION GT3GPLUS 0x6600 GlobeTrotter 3G+ datacard +product OPTION GTICON322 0xd033 GlobeTrotter Icon322 storage product OPTION GTMAX36 0x6701 GlobeTrotter Max 3.6 Modem product OPTION GTMAXHSUPA 0x7001 GlobeTrotter HSUPA @@ -2125,12 +2127,14 @@ product SIERRA AIRCARD595 0x0019 Sierra product SIERRA AC595U 0x0120 Sierra Wireless AirCard 595U product SIERRA AC597E 0x0021 Sierra Wireless AirCard 597E product SIERRA C597 0x0023 Sierra Wireless Compass 597 +product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 product SIERRA AC880E 0x6852 Sierra Wireless AirCard 880E product SIERRA AC881E 0x6853 Sierra Wireless AirCard 881E product SIERRA AC880U 0x6855 Sierra Wireless AirCard 880U product SIERRA AC881U 0x6856 Sierra Wireless AirCard 881U +product SIERRA AC885U 0x6880 Sierra Wireless AirCard 885U product SIERRA EM5625 0x0017 EM5625 product SIERRA MC5720 0x0218 MC5720 Wireless Modem product SIERRA MC5720_2 0x0018 MC5720 @@ -2253,6 +2257,10 @@ product SPARKLAN RT2573 0x0004 RT2573 /* Sphairon Access Systems GmbH products */ product SPHAIRON UB801R 0x0110 UB801R +/* Stelera Wireless products */ +product STELERA ZEROCD 0x1000 Zerocd Installer +product STELERA C105 0x1002 Stelera/Bandrish C105 USB + /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 21:37:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB6010656D3; Thu, 11 Dec 2008 21:37:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 010928FC13; Thu, 11 Dec 2008 21:37:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mBBLbaos037626; Thu, 11 Dec 2008 16:37:42 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: James Gritton Date: Thu, 11 Dec 2008 15:32:17 -0500 User-Agent: KMail/1.9.7 References: <200812102056.mBAKuJ97042379@svn.freebsd.org> <49415FFD.5070400@gritton.org> In-Reply-To: <49415FFD.5070400@gritton.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812111532.17651.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Thu, 11 Dec 2008 16:37:42 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8747/Thu Dec 11 14:22:53 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185878 - in head/sys: compat/freebsd32 kern modules/aio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Dec 2008 21:37:48 -0000 On Thursday 11 December 2008 01:46:21 pm James Gritton wrote: > freebsd32_aio_waitcomplete() has a small error: > > @@ -2824,7 +2824,7 @@ > freebsd32_aio_waitcomplete(struct thread *td, > struct freebsd32_aio_waitcomplete_args *uap) > { > - struct timespec ts32; > + struct timespec32 ts32; > struct timespec ts, *tsp; > int error; > > - Jamie Oof. :( I think my aiotest thing doesn't call aio_waitcomplete() so I missed this. :( -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 21:44:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B7631065672; Thu, 11 Dec 2008 21:44:03 +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 4A1388FC18; Thu, 11 Dec 2008 21:44:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBLi3MB077428; Thu, 11 Dec 2008 21:44:03 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBLi3sY077427; Thu, 11 Dec 2008 21:44:03 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812112144.mBBLi3sY077427@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Dec 2008 21:44: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: r185942 - 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, 11 Dec 2008 21:44:03 -0000 Author: ed Date: Thu Dec 11 21:44:02 2008 New Revision: 185942 URL: http://svn.freebsd.org/changeset/base/185942 Log: Add kqueue()-support to pseudo-terminal master devices. One thing I didn't expect many applications to use, was kqueue() on pseudo-terminal master devices. There are applications that use kqueue() on the TTY itself (rtorrent, etc). That doesn't mean we shouldn't implement this. Libraries like libevent use kqueue() by default, which means they wouldn't be able to use kqueue(). The old TTY layer implements a very broken version of kqueue() by performing the actual polling on the TTY device. Discussed with: peter Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Thu Dec 11 21:08:14 2008 (r185941) +++ head/sys/kern/tty_pts.c Thu Dec 11 21:44:02 2008 (r185942) @@ -254,6 +254,14 @@ done: ttydisc_rint_done(tp); } static int +ptsdev_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) +{ + + return (EINVAL); +} + +static int ptsdev_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { @@ -423,6 +431,94 @@ ptsdev_poll(struct file *fp, int events, return (revents); } +/* + * kqueue support. + */ + +static void +pts_kqops_read_detach(struct knote *kn) +{ + struct file *fp = kn->kn_fp; + struct tty *tp = fp->f_data; + struct pts_softc *psc = tty_softc(tp); + + knlist_remove(&psc->pts_outpoll.si_note, kn, 0); +} + +static int +pts_kqops_read_event(struct knote *kn, long hint) +{ + struct file *fp = kn->kn_fp; + struct tty *tp = fp->f_data; + struct pts_softc *psc = tty_softc(tp); + + if (psc->pts_flags & PTS_FINISHED) { + kn->kn_flags |= EV_EOF; + return (1); + } else { + kn->kn_data = ttydisc_getc_poll(tp); + return (kn->kn_data > 0); + } +} + +static void +pts_kqops_write_detach(struct knote *kn) +{ + struct file *fp = kn->kn_fp; + struct tty *tp = fp->f_data; + struct pts_softc *psc = tty_softc(tp); + + knlist_remove(&psc->pts_inpoll.si_note, kn, 0); +} + +static int +pts_kqops_write_event(struct knote *kn, long hint) +{ + struct file *fp = kn->kn_fp; + struct tty *tp = fp->f_data; + struct pts_softc *psc = tty_softc(tp); + + if (psc->pts_flags & PTS_FINISHED) { + kn->kn_flags |= EV_EOF; + return (1); + } else { + kn->kn_data = ttydisc_rint_poll(tp); + return (kn->kn_data > 0); + } +} + +static struct filterops pts_kqops_read = + { 1, NULL, pts_kqops_read_detach, pts_kqops_read_event }; +static struct filterops pts_kqops_write = + { 1, NULL, pts_kqops_write_detach, pts_kqops_write_event }; + +static int +ptsdev_kqfilter(struct file *fp, struct knote *kn) +{ + struct tty *tp = fp->f_data; + struct pts_softc *psc = tty_softc(tp); + int error = 0; + + tty_lock(tp); + + switch (kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &pts_kqops_read; + knlist_add(&psc->pts_outpoll.si_note, kn, 1); + break; + case EVFILT_WRITE: + kn->kn_fop = &pts_kqops_write; + knlist_add(&psc->pts_inpoll.si_note, kn, 1); + break; + default: + error = EINVAL; + break; + } + + tty_unlock(tp); + return (error); +} + static int ptsdev_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td) @@ -475,8 +571,10 @@ ptsdev_close(struct file *fp, struct thr static struct fileops ptsdev_ops = { .fo_read = ptsdev_read, .fo_write = ptsdev_write, + .fo_truncate = ptsdev_truncate, .fo_ioctl = ptsdev_ioctl, .fo_poll = ptsdev_poll, + .fo_kqfilter = ptsdev_kqfilter, .fo_stat = ptsdev_stat, .fo_close = ptsdev_close, .fo_flags = DFLAG_PASSABLE, @@ -493,6 +591,7 @@ ptsdrv_outwakeup(struct tty *tp) cv_broadcast(&psc->pts_outwait); selwakeup(&psc->pts_outpoll); + KNOTE_LOCKED(&psc->pts_outpoll.si_note, 0); } static void @@ -502,6 +601,7 @@ ptsdrv_inwakeup(struct tty *tp) cv_broadcast(&psc->pts_inwait); selwakeup(&psc->pts_inpoll); + KNOTE_LOCKED(&psc->pts_inpoll.si_note, 0); } static int @@ -566,6 +666,9 @@ ptsdrv_free(void *softc) chgptscnt(psc->pts_uidinfo, -1, 0); uifree(psc->pts_uidinfo); + knlist_destroy(&psc->pts_inpoll.si_note); + knlist_destroy(&psc->pts_outpoll.si_note); + #ifdef PTS_EXTERNAL /* Destroy master device as well. */ if (psc->pts_cdev != NULL) @@ -618,6 +721,8 @@ pts_alloc(int fflags, struct thread *td, uihold(uid); tp = tty_alloc(&pts_class, psc, NULL); + knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); + knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL); /* Expose the slave device as well. */ tty_makedev(tp, td->td_ucred, "pts/%u", psc->pts_unit); @@ -656,6 +761,8 @@ pts_alloc_external(int fflags, struct th uihold(uid); tp = tty_alloc(&pts_class, psc, NULL); + knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); + knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL); /* Expose the slave device as well. */ tty_makedev(tp, td->td_ucred, "%s", name); From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 22:51:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C62081065695; Thu, 11 Dec 2008 22:51:11 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 800568FC21; Thu, 11 Dec 2008 22:51:11 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBMpB4x078754; Thu, 11 Dec 2008 22:51:11 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBMpB1Z078753; Thu, 11 Dec 2008 22:51:11 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812112251.mBBMpB1Z078753@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Dec 2008 22:51: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: r185945 - 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: Thu, 11 Dec 2008 22:51:11 -0000 Author: kmacy Date: Thu Dec 11 22:51:11 2008 New Revision: 185945 URL: http://svn.freebsd.org/changeset/base/185945 Log: Add entry for if_transmit and if_qflush Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Thu Dec 11 22:28:29 2008 (r185944) +++ head/share/man/man9/ifnet.9 Thu Dec 11 22:51:11 2008 (r185945) @@ -103,6 +103,10 @@ .Ft void .Fn \*(lp*if_start\*(rp "struct ifnet *ifp" .Ft int +.Fn \*(lp*if_transmit\*(rp "struct ifnet *ifp" "struct mbuf *m" +.Ft void +.Fn \*(lp*if_qflush\*(rp "struct ifnet *ifp" +.Ft int .Fn \*(lp*if_ioctl\*(rp "struct ifnet *ifp" "int cmd" "caddr_t data" .Ft void .Fn \*(lp*if_watchdog\*(rp "struct ifnet *ifp" @@ -350,6 +354,20 @@ framing, e.g., Ethernet. Output a packet on interface .Fa ifp , or queue it on the output queue if the interface is already active. +.It Fn if_transmit +Transmit a packet on an interface or queue it if the interface is +in use. This function will return +.Dv ENOBUFS +if the devices software and hardware queues are both full. This +function must be installed after +.It Fn if_qflush +Free mbufs in internally managed queues when the interface is marked down. +This function must be installed after +.Fn if_attach +to override the default implementation. This function is exposed in order +to allow drivers to manage their own queues and to reduce the latency +caused by a frequently gratuitous enqueue / dequeue pair to ifq. The +suggested internal software queueing mechanism is buf_ring. .It Fn if_start Start queued output on an interface. This function is exposed in @@ -363,7 +381,8 @@ flag is not set. (Thus, .Dv IFF_OACTIVE does not literally mean that output is active, but rather that the -device's internal output queue is full.) +device's internal output queue is full.) Please note that this function +will soon be deprecated. .It Fn if_done Not used. We are not even sure what it was ever for. From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 23:13:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C0E51065673; Thu, 11 Dec 2008 23:13:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBEDC8FC18; Thu, 11 Dec 2008 23:13:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBND3cm079372; Thu, 11 Dec 2008 23:13:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBND2Xq079336; Thu, 11 Dec 2008 23:13:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812112313.mBBND2Xq079336@svn.freebsd.org> From: Andrew Thompson Date: Thu, 11 Dec 2008 23: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: r185948 - in head/sys/dev/usb2: bluetooth controller core ethernet input misc serial sound storage template 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, 11 Dec 2008 23:13:04 -0000 Author: thompsa Date: Thu Dec 11 23:13:02 2008 New Revision: 185948 URL: http://svn.freebsd.org/changeset/base/185948 Log: Format and wrap function declarations. Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb2/core/usb2_busdma.c head/sys/dev/usb2/core/usb2_busdma.h head/sys/dev/usb2/core/usb2_compat_linux.c head/sys/dev/usb2/core/usb2_compat_linux.h head/sys/dev/usb2/core/usb2_config_td.h head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_dev.c head/sys/dev/usb2/core/usb2_dev.h head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_device.h head/sys/dev/usb2/core/usb2_dynamic.h head/sys/dev/usb2/core/usb2_error.c head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb2/core/usb2_handle_request.c head/sys/dev/usb2/core/usb2_hid.h head/sys/dev/usb2/core/usb2_hub.h head/sys/dev/usb2/core/usb2_lookup.h head/sys/dev/usb2/core/usb2_mbuf.h head/sys/dev/usb2/core/usb2_msctest.h head/sys/dev/usb2/core/usb2_parse.h head/sys/dev/usb2/core/usb2_process.h head/sys/dev/usb2/core/usb2_request.h head/sys/dev/usb2/core/usb2_sw_transfer.h head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_transfer.h head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/ethernet/usb2_ethernet.h head/sys/dev/usb2/input/ukbd2.c head/sys/dev/usb2/misc/udbp2.c head/sys/dev/usb2/misc/ufm2.c head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/usb2_serial.c head/sys/dev/usb2/serial/usb2_serial.h head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb2/sound/uaudio2.c head/sys/dev/usb2/sound/uaudio2.h head/sys/dev/usb2/storage/umass2.c head/sys/dev/usb2/template/usb2_template.c head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ng_ubt2.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/bluetooth/ng_ubt2.c Thu Dec 11 23:13:02 2008 (r185948) @@ -193,10 +193,10 @@ static usb2_callback_t ubt_bulk_write_cl static usb2_callback_t ubt_isoc_read_callback; static usb2_callback_t ubt_isoc_write_callback; -static int ubt_modevent(module_t mod, int event, void *data); -static void ubt_intr_read_complete(node_p node, hook_p hook, void *arg1, int arg2); -static void ubt_bulk_read_complete(node_p node, hook_p hook, void *arg1, int arg2); -static void ubt_isoc_read_complete(node_p node, hook_p hook, void *arg1, int arg2); +static int ubt_modevent(module_t, int, void *); +static void ubt_intr_read_complete(node_p, hook_p, void *, int); +static void ubt_bulk_read_complete(node_p, hook_p, void *, int); +static void ubt_isoc_read_complete(node_p, hook_p, void *, int); /* USB config */ static const struct usb2_config ubt_config_if_0[UBT_IF_0_N_TRANSFER] = { Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/controller/at91dci.c Thu Dec 11 23:13:02 2008 (r185948) @@ -99,10 +99,10 @@ static at91dci_cmd_t at91dci_setup_rx; static at91dci_cmd_t at91dci_data_rx; static at91dci_cmd_t at91dci_data_tx; static at91dci_cmd_t at91dci_data_tx_sync; -static void at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error); -static void at91dci_do_poll(struct usb2_bus *bus); -static void at91dci_root_ctrl_poll(struct at91dci_softc *sc); -static void at91dci_standard_done(struct usb2_xfer *xfer); +static void at91dci_device_done(struct usb2_xfer *, usb2_error_t); +static void at91dci_do_poll(struct usb2_bus *); +static void at91dci_root_ctrl_poll(struct at91dci_softc *); +static void at91dci_standard_done(struct usb2_xfer *); static usb2_sw_transfer_func_t at91dci_root_intr_done; static usb2_sw_transfer_func_t at91dci_root_ctrl_done; Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/controller/musb2_otg.c Thu Dec 11 23:13:02 2008 (r185948) @@ -93,11 +93,11 @@ static musbotg_cmd_t musbotg_setup_data_ static musbotg_cmd_t musbotg_setup_status; static musbotg_cmd_t musbotg_data_rx; static musbotg_cmd_t musbotg_data_tx; -static void musbotg_device_done(struct usb2_xfer *xfer, usb2_error_t error); -static void musbotg_do_poll(struct usb2_bus *bus); -static void musbotg_root_ctrl_poll(struct musbotg_softc *sc); -static void musbotg_standard_done(struct usb2_xfer *xfer); -static void musbotg_interrupt_poll(struct musbotg_softc *sc); +static void musbotg_device_done(struct usb2_xfer *, usb2_error_t); +static void musbotg_do_poll(struct usb2_bus *); +static void musbotg_root_ctrl_poll(struct musbotg_softc *); +static void musbotg_standard_done(struct usb2_xfer *); +static void musbotg_interrupt_poll(struct musbotg_softc *); static usb2_sw_transfer_func_t musbotg_root_intr_done; static usb2_sw_transfer_func_t musbotg_root_ctrl_done; Modified: head/sys/dev/usb2/controller/uhci2.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/controller/uhci2.c Thu Dec 11 23:13:02 2008 (r185948) @@ -139,13 +139,13 @@ extern struct usb2_pipe_methods uhci_roo extern struct usb2_pipe_methods uhci_root_intr_methods; static usb2_config_td_command_t uhci_root_ctrl_task; -static void uhci_root_ctrl_poll(struct uhci_softc *sc); -static void uhci_do_poll(struct usb2_bus *bus); -static void uhci_device_done(struct usb2_xfer *xfer, usb2_error_t error); -static void uhci_transfer_intr_enqueue(struct usb2_xfer *xfer); -static void uhci_root_intr_check(void *arg); -static void uhci_timeout(void *arg); -static uint8_t uhci_check_transfer(struct usb2_xfer *xfer); +static void uhci_root_ctrl_poll(struct uhci_softc *); +static void uhci_do_poll(struct usb2_bus *); +static void uhci_device_done(struct usb2_xfer *, usb2_error_t); +static void uhci_transfer_intr_enqueue(struct usb2_xfer *); +static void uhci_root_intr_check(void *); +static void uhci_timeout(void *); +static uint8_t uhci_check_transfer(struct usb2_xfer *); void uhci_iterate_hw_softc(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *cb) Modified: head/sys/dev/usb2/controller/usb2_controller.c ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/controller/usb2_controller.c Thu Dec 11 23:13:02 2008 (r185948) @@ -48,11 +48,17 @@ static device_probe_t usb2_probe; static device_attach_t usb2_attach; static device_detach_t usb2_detach; -static void usb2_attach_sub(device_t dev, struct usb2_bus *bus); -static void usb2_post_init(void *arg); -static void usb2_bus_mem_flush_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc, struct usb2_page *pg, uint32_t size, uint32_t align); -static void usb2_bus_mem_alloc_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc, struct usb2_page *pg, uint32_t size, uint32_t align); -static void usb2_bus_mem_free_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc, struct usb2_page *pg, uint32_t size, uint32_t align); +static void usb2_attach_sub(device_t, struct usb2_bus *); +static void usb2_post_init(void *); +static void usb2_bus_mem_flush_all_cb(struct usb2_bus *, + struct usb2_page_cache *, struct usb2_page *, uint32_t, + uint32_t); +static void usb2_bus_mem_alloc_all_cb(struct usb2_bus *, + struct usb2_page_cache *, struct usb2_page *, uint32_t, + uint32_t); +static void usb2_bus_mem_free_all_cb(struct usb2_bus *, + struct usb2_page_cache *, struct usb2_page *, uint32_t, + uint32_t); /* static variables */ Modified: head/sys/dev/usb2/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb2/controller/uss820dci.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/controller/uss820dci.c Thu Dec 11 23:13:02 2008 (r185948) @@ -88,12 +88,13 @@ static uss820dci_cmd_t uss820dci_setup_r static uss820dci_cmd_t uss820dci_data_rx; static uss820dci_cmd_t uss820dci_data_tx; static uss820dci_cmd_t uss820dci_data_tx_sync; -static void uss820dci_device_done(struct usb2_xfer *xfer, usb2_error_t error); -static void uss820dci_do_poll(struct usb2_bus *bus); -static void uss820dci_root_ctrl_poll(struct uss820dci_softc *sc); -static void uss820dci_standard_done(struct usb2_xfer *xfer); -static void uss820dci_intr_set(struct usb2_xfer *xfer, uint8_t set); -static void uss820dci_update_shared_1(struct uss820dci_softc *sc, uint8_t reg, uint8_t keep_mask, uint8_t set_mask); +static void uss820dci_device_done(struct usb2_xfer *, usb2_error_t); +static void uss820dci_do_poll(struct usb2_bus *); +static void uss820dci_root_ctrl_poll(struct uss820dci_softc *); +static void uss820dci_standard_done(struct usb2_xfer *); +static void uss820dci_intr_set(struct usb2_xfer *, uint8_t); +static void uss820dci_update_shared_1(struct uss820dci_softc *, uint8_t, + uint8_t, uint8_t); static usb2_sw_transfer_func_t uss820dci_root_intr_done; static usb2_sw_transfer_func_t uss820dci_root_ctrl_done; Modified: head/sys/dev/usb2/core/usb2_busdma.c ============================================================================== --- head/sys/dev/usb2/core/usb2_busdma.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_busdma.c Thu Dec 11 23:13:02 2008 (r185948) @@ -39,22 +39,22 @@ #include #include -static void usb2_dma_tag_create(struct usb2_dma_tag *udt, uint32_t size, uint32_t align); -static void usb2_dma_tag_destroy(struct usb2_dma_tag *udt); +static void usb2_dma_tag_create(struct usb2_dma_tag *, uint32_t, uint32_t); +static void usb2_dma_tag_destroy(struct usb2_dma_tag *); #ifdef __FreeBSD__ -static void usb2_dma_lock_cb(void *arg, bus_dma_lock_op_t op); -static int32_t usb2_m_copy_in_cb(void *arg, void *src, uint32_t count); -static void usb2_pc_alloc_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); -static void usb2_pc_load_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); -static void usb2_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error, uint8_t isload); - +static void usb2_dma_lock_cb(void *, bus_dma_lock_op_t); +static int32_t usb2_m_copy_in_cb(void *, void *, uint32_t); +static void usb2_pc_alloc_mem_cb(void *, bus_dma_segment_t *, int, int); +static void usb2_pc_load_mem_cb(void *, bus_dma_segment_t *, int, int); +static void usb2_pc_common_mem_cb(void *, bus_dma_segment_t *, int, int, + uint8_t); #endif #ifdef __NetBSD__ -static int32_t usb2_m_copy_in_cb(void *arg, caddr_t src, uint32_t count); -static void usb2_pc_common_mem_cb(struct usb2_page_cache *pc, bus_dma_segment_t *segs, int nseg, int error, uint8_t isload); - +static int32_t usb2_m_copy_in_cb(void *, caddr_t, uint32_t); +static void usb2_pc_common_mem_cb(struct usb2_page_cache *, + bus_dma_segment_t *, int, int, uint8_t); #endif /*------------------------------------------------------------------------* Modified: head/sys/dev/usb2/core/usb2_busdma.h ============================================================================== --- head/sys/dev/usb2/core/usb2_busdma.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_busdma.h Thu Dec 11 23:13:02 2008 (r185948) @@ -143,24 +143,38 @@ struct usb2_dma_tag { /* function prototypes */ -int usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio, uint32_t pc_offset, uint32_t len); -struct usb2_dma_tag *usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt, uint32_t size, uint32_t align); -uint8_t usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg, uint32_t size, uint32_t align); +int usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio, + uint32_t pc_offset, uint32_t len); +struct usb2_dma_tag *usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt, + uint32_t size, uint32_t align); +uint8_t usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg, + uint32_t size, uint32_t align); uint8_t usb2_pc_dmamap_create(struct usb2_page_cache *pc, uint32_t size); -uint8_t usb2_pc_load_mem(struct usb2_page_cache *pc, uint32_t size, uint8_t sync); +uint8_t usb2_pc_load_mem(struct usb2_page_cache *pc, uint32_t size, + uint8_t sync); void usb2_bdma_done_event(struct usb2_dma_parent_tag *udpt); void usb2_bdma_post_sync(struct usb2_xfer *xfer); void usb2_bdma_pre_sync(struct usb2_xfer *xfer); void usb2_bdma_work_loop(struct usb2_xfer_queue *pq); -void usb2_bzero(struct usb2_page_cache *cache, uint32_t offset, uint32_t len); -void usb2_copy_in(struct usb2_page_cache *cache, uint32_t offset, const void *ptr, uint32_t len); -int usb2_copy_in_user(struct usb2_page_cache *cache, uint32_t offset, const void *ptr, uint32_t len); -void usb2_copy_out(struct usb2_page_cache *cache, uint32_t offset, void *ptr, uint32_t len); -int usb2_copy_out_user(struct usb2_page_cache *cache, uint32_t offset, void *ptr, uint32_t len); -void usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt, struct usb2_dma_tag *udt, bus_dma_tag_t dmat, struct mtx *mtx, usb2_dma_callback_t *func, struct usb2_xfer_root *info, uint8_t ndmabits, uint8_t nudt); +void usb2_bzero(struct usb2_page_cache *cache, uint32_t offset, + uint32_t len); +void usb2_copy_in(struct usb2_page_cache *cache, uint32_t offset, + const void *ptr, uint32_t len); +int usb2_copy_in_user(struct usb2_page_cache *cache, uint32_t offset, + const void *ptr, uint32_t len); +void usb2_copy_out(struct usb2_page_cache *cache, uint32_t offset, + void *ptr, uint32_t len); +int usb2_copy_out_user(struct usb2_page_cache *cache, uint32_t offset, + void *ptr, uint32_t len); +void usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt, + struct usb2_dma_tag *udt, bus_dma_tag_t dmat, struct mtx *mtx, + usb2_dma_callback_t *func, struct usb2_xfer_root *info, + uint8_t ndmabits, uint8_t nudt); void usb2_dma_tag_unsetup(struct usb2_dma_parent_tag *udpt); -void usb2_get_page(struct usb2_page_cache *pc, uint32_t offset, struct usb2_page_search *res); -void usb2_m_copy_in(struct usb2_page_cache *cache, uint32_t dst_offset, struct mbuf *m, uint32_t src_offset, uint32_t src_len); +void usb2_get_page(struct usb2_page_cache *pc, uint32_t offset, + struct usb2_page_search *res); +void usb2_m_copy_in(struct usb2_page_cache *cache, uint32_t dst_offset, + struct mbuf *m, uint32_t src_offset, uint32_t src_len); void usb2_pc_cpu_flush(struct usb2_page_cache *pc); void usb2_pc_cpu_invalidate(struct usb2_page_cache *pc); void usb2_pc_dmamap_destroy(struct usb2_page_cache *pc); Modified: head/sys/dev/usb2/core/usb2_compat_linux.c ============================================================================== --- head/sys/dev/usb2/core/usb2_compat_linux.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_compat_linux.c Thu Dec 11 23:13:02 2008 (r185948) @@ -67,14 +67,17 @@ static usb2_callback_t usb_linux_non_iso static usb_complete_t usb_linux_wait_complete; -static uint16_t usb_max_isoc_frames(struct usb_device *dev); -static int usb_start_wait_urb(struct urb *urb, uint32_t timeout, uint16_t *p_actlen); -static const struct usb_device_id *usb_linux_lookup_id(const struct usb_device_id *id, struct usb2_attach_arg *uaa); -static struct usb_driver *usb_linux_get_usb_driver(struct usb_linux_softc *sc); -static struct usb_device *usb_linux_create_usb_device(struct usb2_device *udev, device_t dev); -static void usb_linux_cleanup_interface(struct usb_device *dev, struct usb_interface *iface); -static void usb_linux_complete(struct usb2_xfer *xfer); -static int usb_unlink_urb_sub(struct urb *urb, uint8_t drain); +static uint16_t usb_max_isoc_frames(struct usb_device *); +static int usb_start_wait_urb(struct urb *, uint32_t, uint16_t *); +static const struct usb_device_id *usb_linux_lookup_id( + const struct usb_device_id *, struct usb2_attach_arg *); +static struct usb_driver *usb_linux_get_usb_driver(struct usb_linux_softc *); +static struct usb_device *usb_linux_create_usb_device(struct usb2_device *, + device_t); +static void usb_linux_cleanup_interface(struct usb_device *, + struct usb_interface *); +static void usb_linux_complete(struct usb2_xfer *); +static int usb_unlink_urb_sub(struct urb *, uint8_t); /*------------------------------------------------------------------------* * FreeBSD USB interface Modified: head/sys/dev/usb2/core/usb2_compat_linux.h ============================================================================== --- head/sys/dev/usb2/core/usb2_compat_linux.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_compat_linux.h Thu Dec 11 23:13:02 2008 (r185948) @@ -439,16 +439,23 @@ struct urb { int usb_submit_urb(struct urb *urb, uint16_t mem_flags); int usb_unlink_urb(struct urb *urb); int usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe); -int usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *pipe, uint8_t request, uint8_t requesttype, uint16_t value, uint16_t index, void *data, uint16_t size, uint32_t timeout); -int usb_set_interface(struct usb_device *dev, uint8_t ifnum, uint8_t alternate); -int usb_setup_endpoint(struct usb_device *dev, struct usb_host_endpoint *uhe, uint32_t bufsize); +int usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *pipe, + uint8_t request, uint8_t requesttype, uint16_t value, + uint16_t index, void *data, uint16_t size, uint32_t timeout); +int usb_set_interface(struct usb_device *dev, uint8_t ifnum, + uint8_t alternate); +int usb_setup_endpoint(struct usb_device *dev, + struct usb_host_endpoint *uhe, uint32_t bufsize); -struct usb_host_endpoint *usb_find_host_endpoint(struct usb_device *dev, uint8_t type, uint8_t ep); +struct usb_host_endpoint *usb_find_host_endpoint(struct usb_device *dev, + uint8_t type, uint8_t ep); struct urb *usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags); -struct usb_host_interface *usb_altnum_to_altsetting(const struct usb_interface *intf, uint8_t alt_index); +struct usb_host_interface *usb_altnum_to_altsetting( + const struct usb_interface *intf, uint8_t alt_index); struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no); -void *usb_buffer_alloc(struct usb_device *dev, uint32_t size, uint16_t mem_flags, uint8_t *dma_addr); +void *usb_buffer_alloc(struct usb_device *dev, uint32_t size, + uint16_t mem_flags, uint8_t *dma_addr); void *usb_get_intfdata(struct usb_interface *intf); void usb_buffer_free(struct usb_device *dev, uint32_t size, void *addr, uint8_t dma_addr); Modified: head/sys/dev/usb2/core/usb2_config_td.h ============================================================================== --- head/sys/dev/usb2/core/usb2_config_td.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_config_td.h Thu Dec 11 23:13:02 2008 (r185948) @@ -60,10 +60,15 @@ struct usb2_config_td { /* prototypes */ -uint8_t usb2_config_td_setup(struct usb2_config_td *ctd, void *priv_sc, struct mtx *priv_mtx, usb2_config_td_end_of_commands_t *p_func_eoc, uint16_t item_size, uint16_t item_count); +uint8_t usb2_config_td_setup(struct usb2_config_td *ctd, void *priv_sc, + struct mtx *priv_mtx, usb2_config_td_end_of_commands_t *p_func_eoc, + uint16_t item_size, uint16_t item_count); void usb2_config_td_drain(struct usb2_config_td *ctd); void usb2_config_td_unsetup(struct usb2_config_td *ctd); -void usb2_config_td_queue_command(struct usb2_config_td *ctd, usb2_config_td_command_t *pre_func, usb2_config_td_command_t *post_func, uint16_t command_sync, uint16_t command_ref); +void usb2_config_td_queue_command(struct usb2_config_td *ctd, + usb2_config_td_command_t *pre_func, + usb2_config_td_command_t *post_func, uint16_t command_sync, + uint16_t command_ref); uint8_t usb2_config_td_is_gone(struct usb2_config_td *ctd); uint8_t usb2_config_td_sleep(struct usb2_config_td *ctd, uint32_t timeout); uint8_t usb2_config_td_sync(struct usb2_config_td *ctd); Modified: head/sys/dev/usb2/core/usb2_core.h ============================================================================== --- head/sys/dev/usb2/core/usb2_core.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_core.h Thu Dec 11 23:13:02 2008 (r185948) @@ -426,17 +426,28 @@ typedef struct malloc_type *usb2_malloc_ /* prototypes */ const char *usb2_errstr(usb2_error_t error); -struct usb2_config_descriptor *usb2_get_config_descriptor(struct usb2_device *udev); -struct usb2_device_descriptor *usb2_get_device_descriptor(struct usb2_device *udev); -struct usb2_interface *usb2_get_iface(struct usb2_device *udev, uint8_t iface_index); -struct usb2_interface_descriptor *usb2_get_interface_descriptor(struct usb2_interface *iface); -uint8_t usb2_clear_stall_callback(struct usb2_xfer *xfer1, struct usb2_xfer *xfer2); +struct usb2_config_descriptor *usb2_get_config_descriptor( + struct usb2_device *udev); +struct usb2_device_descriptor *usb2_get_device_descriptor( + struct usb2_device *udev); +struct usb2_interface *usb2_get_iface(struct usb2_device *udev, + uint8_t iface_index); +struct usb2_interface_descriptor *usb2_get_interface_descriptor( + struct usb2_interface *iface); +uint8_t usb2_clear_stall_callback(struct usb2_xfer *xfer1, + struct usb2_xfer *xfer2); uint8_t usb2_get_interface_altindex(struct usb2_interface *iface); -usb2_error_t usb2_set_alt_interface_index(struct usb2_device *udev, uint8_t iface_index, uint8_t alt_index); +usb2_error_t usb2_set_alt_interface_index(struct usb2_device *udev, + uint8_t iface_index, uint8_t alt_index); uint8_t usb2_get_speed(struct usb2_device *udev); -usb2_error_t usb2_transfer_setup(struct usb2_device *udev, const uint8_t *ifaces, struct usb2_xfer **pxfer, const struct usb2_config *setup_start, uint16_t n_setup, void *priv_sc, struct mtx *priv_mtx); -void usb2_set_frame_data(struct usb2_xfer *xfer, void *ptr, uint32_t frindex); -void usb2_set_frame_offset(struct usb2_xfer *xfer, uint32_t offset, uint32_t frindex); +usb2_error_t usb2_transfer_setup(struct usb2_device *udev, + const uint8_t *ifaces, struct usb2_xfer **pxfer, + const struct usb2_config *setup_start, uint16_t n_setup, + void *priv_sc, struct mtx *priv_mtx); +void usb2_set_frame_data(struct usb2_xfer *xfer, void *ptr, + uint32_t frindex); +void usb2_set_frame_offset(struct usb2_xfer *xfer, uint32_t offset, + uint32_t frindex); void usb2_start_hardware(struct usb2_xfer *xfer); void usb2_transfer_clear_stall(struct usb2_xfer *xfer); void usb2_transfer_drain(struct usb2_xfer *xfer); @@ -444,10 +455,13 @@ void usb2_transfer_set_stall(struct usb2 void usb2_transfer_start(struct usb2_xfer *xfer); void usb2_transfer_stop(struct usb2_xfer *xfer); void usb2_transfer_unsetup(struct usb2_xfer **pxfer, uint16_t n_setup); -usb2_error_t usb2_ref_device(struct file *fp, struct usb2_location *ploc, uint32_t devloc); +usb2_error_t usb2_ref_device(struct file *fp, struct usb2_location *ploc, + uint32_t devloc); void usb2_unref_device(struct usb2_location *ploc); -void usb2_set_parent_iface(struct usb2_device *udev, uint8_t iface_index, uint8_t parent_index); -void usb2_set_iface_perm(struct usb2_device *udev, uint8_t iface_index, uint32_t uid, uint32_t gid, uint16_t mode); +void usb2_set_parent_iface(struct usb2_device *udev, uint8_t iface_index, + uint8_t parent_index); +void usb2_set_iface_perm(struct usb2_device *udev, uint8_t iface_index, + uint32_t uid, uint32_t gid, uint16_t mode); uint8_t usb2_get_bus_index(struct usb2_device *udev); uint8_t usb2_get_device_index(struct usb2_device *udev); Modified: head/sys/dev/usb2/core/usb2_dev.c ============================================================================== --- head/sys/dev/usb2/core/usb2_dev.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_dev.c Thu Dec 11 23:13:02 2008 (r185948) @@ -72,19 +72,22 @@ SYSCTL_INT(_hw_usb2_dev, OID_AUTO, debug /* prototypes */ -static uint32_t usb2_path_convert_one(const char **pp); -static uint32_t usb2_path_convert(const char *path); -static int usb2_check_access(int fflags, struct usb2_perm *puser); -static int usb2_fifo_open(struct usb2_fifo *f, struct file *fp, struct thread *td, int fflags); -static void usb2_fifo_close(struct usb2_fifo *f, struct thread *td, int fflags); -static void usb2_dev_init(void *arg); -static void usb2_dev_init_post(void *arg); -static void usb2_dev_uninit(void *arg); -static int usb2_fifo_uiomove(struct usb2_fifo *f, void *cp, int n, struct uio *uio); -static void usb2_fifo_check_methods(struct usb2_fifo_methods *pm); -static void usb2_clone(void *arg, USB_UCRED char *name, int namelen, struct cdev **dev); -static struct usb2_fifo *usb2_fifo_alloc(void); -static struct usb2_pipe *usb2_dev_get_pipe(struct usb2_device *udev, uint8_t iface_index, uint8_t ep_index, uint8_t dir); +static uint32_t usb2_path_convert_one(const char **); +static uint32_t usb2_path_convert(const char *); +static int usb2_check_access(int, struct usb2_perm *); +static int usb2_fifo_open(struct usb2_fifo *, struct file *, + struct thread *, int); +static void usb2_fifo_close(struct usb2_fifo *, struct thread *, int); +static void usb2_dev_init(void *); +static void usb2_dev_init_post(void *); +static void usb2_dev_uninit(void *); +static int usb2_fifo_uiomove(struct usb2_fifo *, void *, int, + struct uio *); +static void usb2_fifo_check_methods(struct usb2_fifo_methods *); +static void usb2_clone(void *, USB_UCRED char *, int, struct cdev **); +static struct usb2_fifo *usb2_fifo_alloc(void); +static struct usb2_pipe *usb2_dev_get_pipe(struct usb2_device *, uint8_t, + uint8_t, uint8_t); static d_fdopen_t usb2_fdopen; static d_close_t usb2_close; Modified: head/sys/dev/usb2/core/usb2_dev.h ============================================================================== --- head/sys/dev/usb2/core/usb2_dev.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_dev.h Thu Dec 11 23:13:02 2008 (r185948) @@ -130,27 +130,39 @@ struct usb2_fifo_sc { int usb2_fifo_wait(struct usb2_fifo *fifo); void usb2_fifo_signal(struct usb2_fifo *fifo); -int usb2_fifo_alloc_buffer(struct usb2_fifo *f, uint32_t bufsize, uint16_t nbuf); +int usb2_fifo_alloc_buffer(struct usb2_fifo *f, uint32_t bufsize, + uint16_t nbuf); void usb2_fifo_free_buffer(struct usb2_fifo *f); -int usb2_fifo_attach(struct usb2_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb2_fifo_methods *pm, struct usb2_fifo_sc *f_sc, uint16_t unit, uint16_t subunit, uint8_t iface_index); +int usb2_fifo_attach(struct usb2_device *udev, void *priv_sc, + struct mtx *priv_mtx, struct usb2_fifo_methods *pm, + struct usb2_fifo_sc *f_sc, uint16_t unit, uint16_t subunit, + uint8_t iface_index); void usb2_fifo_detach(struct usb2_fifo_sc *f_sc); uint32_t usb2_fifo_put_bytes_max(struct usb2_fifo *fifo); -void usb2_fifo_put_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc, uint32_t offset, uint32_t len, uint8_t what); -void usb2_fifo_put_data_linear(struct usb2_fifo *fifo, void *ptr, uint32_t len, uint8_t what); +void usb2_fifo_put_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc, + uint32_t offset, uint32_t len, uint8_t what); +void usb2_fifo_put_data_linear(struct usb2_fifo *fifo, void *ptr, + uint32_t len, uint8_t what); uint8_t usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, uint32_t len); void usb2_fifo_put_data_error(struct usb2_fifo *fifo); -uint8_t usb2_fifo_get_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc, uint32_t offset, uint32_t len, uint32_t *actlen, uint8_t what); -uint8_t usb2_fifo_get_data_linear(struct usb2_fifo *fifo, void *ptr, uint32_t len, uint32_t *actlen, uint8_t what); -uint8_t usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr, uint32_t *plen); +uint8_t usb2_fifo_get_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc, + uint32_t offset, uint32_t len, uint32_t *actlen, uint8_t what); +uint8_t usb2_fifo_get_data_linear(struct usb2_fifo *fifo, void *ptr, + uint32_t len, uint32_t *actlen, uint8_t what); +uint8_t usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr, + uint32_t *plen); void usb2_fifo_get_data_error(struct usb2_fifo *fifo); uint8_t usb2_fifo_opened(struct usb2_fifo *fifo); void usb2_fifo_free(struct usb2_fifo *f); void usb2_fifo_reset(struct usb2_fifo *f); -int usb2_check_thread_perm(struct usb2_device *udev, struct thread *td, int fflags, uint8_t iface_index, uint8_t ep_index); +int usb2_check_thread_perm(struct usb2_device *udev, struct thread *td, + int fflags, uint8_t iface_index, uint8_t ep_index); void usb2_fifo_wakeup(struct usb2_fifo *f); -struct usb2_symlink *usb2_alloc_symlink(const char *target, const char *fmt,...); +struct usb2_symlink *usb2_alloc_symlink(const char *target, + const char *fmt,...); void usb2_free_symlink(struct usb2_symlink *ps); uint32_t usb2_lookup_symlink(const char *src_ptr, uint8_t src_len); -int usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry, uint32_t user_len); +int usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry, + uint32_t user_len); #endif /* _USB2_DEV_H_ */ Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_device.c Thu Dec 11 23:13:02 2008 (r185948) @@ -56,18 +56,24 @@ /* function prototypes */ -static void usb2_fill_pipe_data(struct usb2_device *udev, uint8_t iface_index, struct usb2_endpoint_descriptor *edesc, struct usb2_pipe *pipe); -static void usb2_free_pipe_data(struct usb2_device *udev, uint8_t iface_index, uint8_t iface_mask); -static void usb2_free_iface_data(struct usb2_device *udev); -static void usb2_detach_device_sub(struct usb2_device *udev, device_t *ppdev, uint8_t free_subdev); -static uint8_t usb2_probe_and_attach_sub(struct usb2_device *udev, struct usb2_attach_arg *uaa); -static void usb2_init_attach_arg(struct usb2_device *udev, struct usb2_attach_arg *uaa); -static void usb2_suspend_resume_sub(struct usb2_device *udev, device_t dev, uint8_t do_suspend); -static void usb2_clear_stall_proc(struct usb2_proc_msg *_pm); -static void usb2_check_strings(struct usb2_device *udev); -static usb2_error_t usb2_fill_iface_data(struct usb2_device *udev, uint8_t iface_index, uint8_t alt_index); -static void usb2_notify_addq(const char *type, struct usb2_device *udev); -static void usb2_fifo_free_wrap(struct usb2_device *udev, uint8_t iface_index, uint8_t flag); +static void usb2_fill_pipe_data(struct usb2_device *, uint8_t, + struct usb2_endpoint_descriptor *, struct usb2_pipe *); +static void usb2_free_pipe_data(struct usb2_device *, uint8_t, uint8_t); +static void usb2_free_iface_data(struct usb2_device *); +static void usb2_detach_device_sub(struct usb2_device *, device_t *, + uint8_t); +static uint8_t usb2_probe_and_attach_sub(struct usb2_device *, + struct usb2_attach_arg *); +static void usb2_init_attach_arg(struct usb2_device *, + struct usb2_attach_arg *); +static void usb2_suspend_resume_sub(struct usb2_device *, device_t, + uint8_t); +static void usb2_clear_stall_proc(struct usb2_proc_msg *_pm); +static void usb2_check_strings(struct usb2_device *); +static usb2_error_t usb2_fill_iface_data(struct usb2_device *, uint8_t, + uint8_t); +static void usb2_notify_addq(const char *type, struct usb2_device *); +static void usb2_fifo_free_wrap(struct usb2_device *, uint8_t, uint8_t); /* static structures */ Modified: head/sys/dev/usb2/core/usb2_device.h ============================================================================== --- head/sys/dev/usb2/core/usb2_device.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_device.h Thu Dec 11 23:13:02 2008 (r185948) @@ -144,19 +144,30 @@ struct usb2_device { /* function prototypes */ -struct usb2_device *usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus, struct usb2_device *parent_hub, uint8_t depth, uint8_t port_index, uint8_t port_no, uint8_t speed, uint8_t usb2_mode); -struct usb2_pipe *usb2_get_pipe(struct usb2_device *udev, uint8_t iface_index, const struct usb2_config *setup); +struct usb2_device *usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus, + struct usb2_device *parent_hub, uint8_t depth, + uint8_t port_index, uint8_t port_no, uint8_t speed, + uint8_t usb2_mode); +struct usb2_pipe *usb2_get_pipe(struct usb2_device *udev, uint8_t iface_index, + const struct usb2_config *setup); struct usb2_pipe *usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val); -usb2_error_t usb2_interface_count(struct usb2_device *udev, uint8_t *count); -usb2_error_t usb2_probe_and_attach(struct usb2_device *udev, uint8_t iface_index); -usb2_error_t usb2_reset_iface_endpoints(struct usb2_device *udev, uint8_t iface_index); -usb2_error_t usb2_set_config_index(struct usb2_device *udev, uint8_t index); -usb2_error_t usb2_set_endpoint_stall(struct usb2_device *udev, struct usb2_pipe *pipe, uint8_t do_stall); -usb2_error_t usb2_suspend_resume(struct usb2_device *udev, uint8_t do_suspend); -void usb2_detach_device(struct usb2_device *udev, uint8_t iface_index, uint8_t free_subdev); +usb2_error_t usb2_interface_count(struct usb2_device *udev, uint8_t *count); +usb2_error_t usb2_probe_and_attach(struct usb2_device *udev, + uint8_t iface_index); +usb2_error_t usb2_reset_iface_endpoints(struct usb2_device *udev, + uint8_t iface_index); +usb2_error_t usb2_set_config_index(struct usb2_device *udev, uint8_t index); +usb2_error_t usb2_set_endpoint_stall(struct usb2_device *udev, + struct usb2_pipe *pipe, uint8_t do_stall); +usb2_error_t usb2_suspend_resume(struct usb2_device *udev, + uint8_t do_suspend); +void usb2_detach_device(struct usb2_device *udev, uint8_t iface_index, + uint8_t free_subdev); void usb2_devinfo(struct usb2_device *udev, char *dst_ptr, uint16_t dst_len); void usb2_free_device(struct usb2_device *udev); -void *usb2_find_descriptor(struct usb2_device *udev, void *id, uint8_t iface_index, uint8_t type, uint8_t type_mask, uint8_t subtype, uint8_t subtype_mask); +void *usb2_find_descriptor(struct usb2_device *udev, void *id, + uint8_t iface_index, uint8_t type, uint8_t type_mask, + uint8_t subtype, uint8_t subtype_mask); void usb_linux_free_device(struct usb_device *dev); #endif /* _USB2_DEVICE_H_ */ Modified: head/sys/dev/usb2/core/usb2_dynamic.h ============================================================================== --- head/sys/dev/usb2/core/usb2_dynamic.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_dynamic.h Thu Dec 11 23:13:02 2008 (r185948) @@ -35,11 +35,16 @@ struct usb2_device_request; /* typedefs */ -typedef usb2_error_t (usb2_temp_setup_by_index_t)(struct usb2_device *udev, uint16_t index); -typedef uint8_t (usb2_test_quirk_t)(const struct usb2_lookup_info *info, uint16_t quirk); -typedef int (usb2_quirk_ioctl_t)(unsigned long cmd, caddr_t data, int fflag, struct thread *td); -typedef void (usb2_temp_get_desc_t)(struct usb2_device *udev, struct usb2_device_request *req, const void **pPtr, uint16_t *pLength); -typedef void (usb2_temp_unsetup_t)(struct usb2_device *udev); +typedef usb2_error_t (usb2_temp_setup_by_index_t)(struct usb2_device *udev, + uint16_t index); +typedef uint8_t (usb2_test_quirk_t)(const struct usb2_lookup_info *info, + uint16_t quirk); +typedef int (usb2_quirk_ioctl_t)(unsigned long cmd, caddr_t data, + int fflag, struct thread *td); +typedef void (usb2_temp_get_desc_t)(struct usb2_device *udev, + struct usb2_device_request *req, const void **pPtr, + uint16_t *pLength); +typedef void (usb2_temp_unsetup_t)(struct usb2_device *udev); /* global function pointers */ Modified: head/sys/dev/usb2/core/usb2_error.c ============================================================================== --- head/sys/dev/usb2/core/usb2_error.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_error.c Thu Dec 11 23:13:02 2008 (r185948) @@ -39,6 +39,5 @@ USB_MAKE_DEBUG_TABLE(USB_ERR); const char * usb2_errstr(usb2_error_t err) { - return ((err < USB_ERR_MAX) ? - USB_ERR[err] : "USB_ERR_UNKNOWN"); + return ((err < USB_ERR_MAX) ? USB_ERR[err] : "USB_ERR_UNKNOWN"); } Modified: head/sys/dev/usb2/core/usb2_generic.c ============================================================================== --- head/sys/dev/usb2/core/usb2_generic.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_generic.c Thu Dec 11 23:13:02 2008 (r185948) @@ -72,17 +72,19 @@ static usb2_fifo_cmd_t ugen_start_read; static usb2_fifo_cmd_t ugen_start_write; static usb2_fifo_cmd_t ugen_stop_io; -static int ugen_transfer_setup(struct usb2_fifo *f, const struct usb2_config *setup, uint8_t n_setup); -static int ugen_open_pipe_write(struct usb2_fifo *f); -static int ugen_open_pipe_read(struct usb2_fifo *f); -static int ugen_set_config(struct usb2_fifo *f, uint8_t index); -static int ugen_set_interface(struct usb2_fifo *f, uint8_t iface_index, uint8_t alt_index); -static int ugen_get_cdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *pgd); -static int ugen_get_sdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd); -static int usb2_gen_fill_deviceinfo(struct usb2_fifo *f, struct usb2_device_info *di); -static int ugen_re_enumerate(struct usb2_fifo *f); -static int ugen_iface_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags); -static uint8_t ugen_fs_get_complete(struct usb2_fifo *f, uint8_t *pindex); +static int ugen_transfer_setup(struct usb2_fifo *, + const struct usb2_config *, uint8_t); +static int ugen_open_pipe_write(struct usb2_fifo *); +static int ugen_open_pipe_read(struct usb2_fifo *); +static int ugen_set_config(struct usb2_fifo *, uint8_t); +static int ugen_set_interface(struct usb2_fifo *, uint8_t, uint8_t); +static int ugen_get_cdesc(struct usb2_fifo *, struct usb2_gen_descriptor *); +static int ugen_get_sdesc(struct usb2_fifo *, struct usb2_gen_descriptor *); +static int usb2_gen_fill_deviceinfo(struct usb2_fifo *, + struct usb2_device_info *); +static int ugen_re_enumerate(struct usb2_fifo *); +static int ugen_iface_ioctl(struct usb2_fifo *, u_long, void *, int); +static uint8_t ugen_fs_get_complete(struct usb2_fifo *, uint8_t *); static int ugen_fs_uninit(struct usb2_fifo *f); /* structures */ Modified: head/sys/dev/usb2/core/usb2_handle_request.c ============================================================================== --- head/sys/dev/usb2/core/usb2_handle_request.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_handle_request.c Thu Dec 11 23:13:02 2008 (r185948) @@ -52,12 +52,15 @@ enum { /* function prototypes */ -static uint8_t usb2_handle_get_stall(struct usb2_device *udev, uint8_t ea_val); -static usb2_error_t usb2_handle_remote_wakeup(struct usb2_xfer *xfer, uint8_t is_on); -static usb2_error_t usb2_handle_request(struct usb2_xfer *xfer); -static usb2_error_t usb2_handle_set_config(struct usb2_xfer *xfer, uint8_t conf_no); -static usb2_error_t usb2_handle_set_stall(struct usb2_xfer *xfer, uint8_t ep, uint8_t do_stall); -static usb2_error_t usb2_handle_iface_request(struct usb2_xfer *xfer, void **ppdata, uint16_t *plen, struct usb2_device_request req, uint16_t off, uint8_t state); +static uint8_t usb2_handle_get_stall(struct usb2_device *, uint8_t); +static usb2_error_t usb2_handle_remote_wakeup(struct usb2_xfer *, uint8_t); +static usb2_error_t usb2_handle_request(struct usb2_xfer *); +static usb2_error_t usb2_handle_set_config(struct usb2_xfer *, uint8_t); +static usb2_error_t usb2_handle_set_stall(struct usb2_xfer *, uint8_t, + uint8_t); +static usb2_error_t usb2_handle_iface_request(struct usb2_xfer *, void **, + uint16_t *, struct usb2_device_request, uint16_t, + uint8_t); /*------------------------------------------------------------------------* * usb2_handle_request_callback Modified: head/sys/dev/usb2/core/usb2_hid.h ============================================================================== --- head/sys/dev/usb2/core/usb2_hid.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_hid.h Thu Dec 11 23:13:02 2008 (r185948) @@ -80,10 +80,16 @@ struct hid_data *hid_start_parse(const v void hid_end_parse(struct hid_data *s); int hid_get_item(struct hid_data *s, struct hid_item *h); int hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *id); -int hid_locate(const void *desc, int size, uint32_t usage, enum hid_kind kind, struct hid_location *loc, uint32_t *flags); -uint32_t hid_get_data(const uint8_t *buf, uint32_t len, struct hid_location *loc); +int hid_locate(const void *desc, int size, uint32_t usage, + enum hid_kind kind, struct hid_location *loc, uint32_t *flags); +uint32_t hid_get_data(const uint8_t *buf, uint32_t len, + struct hid_location *loc); int hid_is_collection(const void *desc, int size, uint32_t usage); -struct usb2_hid_descriptor *hid_get_descriptor_from_usb(struct usb2_config_descriptor *cd, struct usb2_interface_descriptor *id); -usb2_error_t usb2_req_get_hid_desc(struct usb2_device *udev, struct mtx *mtx, void **descp, uint16_t *sizep, usb2_malloc_type mem, uint8_t iface_index); +struct usb2_hid_descriptor *hid_get_descriptor_from_usb( + struct usb2_config_descriptor *cd, + struct usb2_interface_descriptor *id); +usb2_error_t usb2_req_get_hid_desc(struct usb2_device *udev, struct mtx *mtx, + void **descp, uint16_t *sizep, usb2_malloc_type mem, + uint8_t iface_index); #endif /* _USB2_CORE_HID_H_ */ Modified: head/sys/dev/usb2/core/usb2_hub.h ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_hub.h Thu Dec 11 23:13:02 2008 (r185948) @@ -65,10 +65,13 @@ struct usb2_hub { /* function prototypes */ -uint8_t usb2_intr_schedule_adjust(struct usb2_device *udev, int16_t len, uint8_t slot); +uint8_t usb2_intr_schedule_adjust(struct usb2_device *udev, int16_t len, + uint8_t slot); void usb2_fs_isoc_schedule_init_all(struct usb2_fs_isoc_schedule *fss); -void usb2_bus_port_set_device(struct usb2_bus *bus, struct usb2_port *up, struct usb2_device *udev, uint8_t device_index); -struct usb2_device *usb2_bus_port_get_device(struct usb2_bus *bus, struct usb2_port *up); +void usb2_bus_port_set_device(struct usb2_bus *bus, struct usb2_port *up, + struct usb2_device *udev, uint8_t device_index); +struct usb2_device *usb2_bus_port_get_device(struct usb2_bus *bus, + struct usb2_port *up); void usb2_needs_explore(struct usb2_bus *bus, uint8_t do_probe); void usb2_needs_explore_all(void); Modified: head/sys/dev/usb2/core/usb2_lookup.h ============================================================================== --- head/sys/dev/usb2/core/usb2_lookup.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_lookup.h Thu Dec 11 23:13:02 2008 (r185948) @@ -113,7 +113,10 @@ struct usb2_device_id { #define USB_GET_DRIVER_INFO(did) \ (((const uint8_t *)((did)->driver_info)) - ((const uint8_t *)0)) -const struct usb2_device_id *usb2_lookup_id_by_info(const struct usb2_device_id *id, uint32_t sizeof_id, const struct usb2_lookup_info *info); -int usb2_lookup_id_by_uaa(const struct usb2_device_id *id, uint32_t sizeof_id, struct usb2_attach_arg *uaa); +const struct usb2_device_id *usb2_lookup_id_by_info( + const struct usb2_device_id *id, uint32_t sizeof_id, + const struct usb2_lookup_info *info); +int usb2_lookup_id_by_uaa(const struct usb2_device_id *id, + uint32_t sizeof_id, struct usb2_attach_arg *uaa); #endif /* _USB2_LOOKUP_H_ */ Modified: head/sys/dev/usb2/core/usb2_mbuf.h ============================================================================== --- head/sys/dev/usb2/core/usb2_mbuf.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_mbuf.h Thu Dec 11 23:13:02 2008 (r185948) @@ -95,6 +95,7 @@ struct usb2_ifqueue { } while (0) /* prototypes */ -void *usb2_alloc_mbufs(struct malloc_type *type, struct usb2_ifqueue *ifq, uint32_t block_size, uint16_t nblocks); +void *usb2_alloc_mbufs(struct malloc_type *type, struct usb2_ifqueue *ifq, + uint32_t block_size, uint16_t nblocks); #endif /* _USB2_MBUF_H_ */ Modified: head/sys/dev/usb2/core/usb2_msctest.h ============================================================================== --- head/sys/dev/usb2/core/usb2_msctest.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_msctest.h Thu Dec 11 23:13:02 2008 (r185948) @@ -27,8 +27,10 @@ #ifndef _USB2_MSCTEST_H_ #define _USB2_MSCTEST_H_ -usb2_error_t usb2_test_autoinstall(struct usb2_device *udev, uint8_t iface_index, uint8_t do_eject); -usb2_error_t usb2_test_huawei(struct usb2_device *udev, struct usb2_attach_arg *uaa); +usb2_error_t usb2_test_autoinstall(struct usb2_device *udev, + uint8_t iface_index, uint8_t do_eject); +usb2_error_t usb2_test_huawei(struct usb2_device *udev, + struct usb2_attach_arg *uaa); int usb2_lookup_huawei(struct usb2_attach_arg *uaa); /* Huawei specific defines */ Modified: head/sys/dev/usb2/core/usb2_parse.h ============================================================================== --- head/sys/dev/usb2/core/usb2_parse.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_parse.h Thu Dec 11 23:13:02 2008 (r185948) @@ -27,9 +27,14 @@ #ifndef _USB2_PARSE_H_ #define _USB2_PARSE_H_ -struct usb2_descriptor *usb2_desc_foreach(struct usb2_config_descriptor *cd, struct usb2_descriptor *desc); -struct usb2_interface_descriptor *usb2_find_idesc(struct usb2_config_descriptor *cd, uint8_t iface_index, uint8_t alt_index); -struct usb2_endpoint_descriptor *usb2_find_edesc(struct usb2_config_descriptor *cd, uint8_t iface_index, uint8_t alt_index, uint8_t ep_index); +struct usb2_descriptor *usb2_desc_foreach(struct usb2_config_descriptor *cd, + struct usb2_descriptor *desc); +struct usb2_interface_descriptor *usb2_find_idesc( + struct usb2_config_descriptor *cd, uint8_t iface_index, + uint8_t alt_index); +struct usb2_endpoint_descriptor *usb2_find_edesc( + struct usb2_config_descriptor *cd, uint8_t iface_index, + uint8_t alt_index, uint8_t ep_index); uint16_t usb2_get_no_endpoints(struct usb2_config_descriptor *cd); uint16_t usb2_get_no_alts(struct usb2_config_descriptor *cd, uint8_t ifaceno); Modified: head/sys/dev/usb2/core/usb2_process.h ============================================================================== --- head/sys/dev/usb2/core/usb2_process.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_process.h Thu Dec 11 23:13:02 2008 (r185948) @@ -79,7 +79,8 @@ struct usb2_process { uint8_t usb2_proc_cwait(struct usb2_process *up, int timeout); uint8_t usb2_proc_is_gone(struct usb2_process *up); -uint8_t usb2_proc_setup(struct usb2_process *up, struct mtx *p_mtx, uint8_t prio); +uint8_t usb2_proc_setup(struct usb2_process *up, struct mtx *p_mtx, + uint8_t prio); void usb2_proc_csignal(struct usb2_process *up); void usb2_proc_drain(struct usb2_process *up); void usb2_proc_mwait(struct usb2_process *up, void *pm0, void *pm1); Modified: head/sys/dev/usb2/core/usb2_request.h ============================================================================== --- head/sys/dev/usb2/core/usb2_request.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_request.h Thu Dec 11 23:13:02 2008 (r185948) @@ -27,32 +27,67 @@ #ifndef _USB2_REQUEST_H_ #define _USB2_REQUEST_H_ -usb2_error_t usb2_do_request_flags(struct usb2_device *udev, struct mtx *mtx, struct usb2_device_request *req, void *data, uint32_t flags, uint16_t *actlen, uint32_t timeout); -usb2_error_t usb2_req_clear_hub_feature(struct usb2_device *udev, struct mtx *mtx, uint16_t sel); -usb2_error_t usb2_req_clear_port_feature(struct usb2_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel); -usb2_error_t usb2_req_get_alt_interface_no(struct usb2_device *udev, struct mtx *mtx, uint8_t *alt_iface_no, uint8_t iface_index); -usb2_error_t usb2_req_get_config(struct usb2_device *udev, struct mtx *mtx, uint8_t *pconf); -usb2_error_t usb2_req_get_config_desc(struct usb2_device *udev, struct mtx *mtx, struct usb2_config_descriptor *d, uint8_t conf_index); -usb2_error_t usb2_req_get_config_desc_full(struct usb2_device *udev, struct mtx *mtx, struct usb2_config_descriptor **ppcd, struct malloc_type *mtype, uint8_t conf_index); -usb2_error_t usb2_req_get_desc(struct usb2_device *udev, struct mtx *mtx, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, uint8_t index, uint8_t retries); -usb2_error_t usb2_req_get_device_desc(struct usb2_device *udev, struct mtx *mtx, struct usb2_device_descriptor *d); -usb2_error_t usb2_req_get_device_status(struct usb2_device *udev, struct mtx *mtx, struct usb2_status *st); -usb2_error_t usb2_req_get_hub_descriptor(struct usb2_device *udev, struct mtx *mtx, struct usb2_hub_descriptor *hd, uint8_t nports); -usb2_error_t usb2_req_get_hub_status(struct usb2_device *udev, struct mtx *mtx, struct usb2_hub_status *st); -usb2_error_t usb2_req_get_port_status(struct usb2_device *udev, struct mtx *mtx, struct usb2_port_status *ps, uint8_t port); -usb2_error_t usb2_req_get_report(struct usb2_device *udev, struct mtx *mtx, void *data, uint16_t len, uint8_t iface_index, uint8_t type, uint8_t id); -usb2_error_t usb2_req_get_report_descriptor(struct usb2_device *udev, struct mtx *mtx, void *d, uint16_t size, uint8_t iface_index); -usb2_error_t usb2_req_get_string_any(struct usb2_device *udev, struct mtx *mtx, char *buf, uint16_t len, uint8_t string_index); -usb2_error_t usb2_req_get_string_desc(struct usb2_device *udev, struct mtx *mtx, void *sdesc, uint16_t max_len, uint16_t lang_id, uint8_t string_index); -usb2_error_t usb2_req_reset_port(struct usb2_device *udev, struct mtx *mtx, uint8_t port); -usb2_error_t usb2_req_set_address(struct usb2_device *udev, struct mtx *mtx, uint16_t addr); -usb2_error_t usb2_req_set_alt_interface_no(struct usb2_device *udev, struct mtx *mtx, uint8_t iface_index, uint8_t alt_no); -usb2_error_t usb2_req_set_config(struct usb2_device *udev, struct mtx *mtx, uint8_t conf); -usb2_error_t usb2_req_set_hub_feature(struct usb2_device *udev, struct mtx *mtx, uint16_t sel); -usb2_error_t usb2_req_set_idle(struct usb2_device *udev, struct mtx *mtx, uint8_t iface_index, uint8_t duration, uint8_t id); -usb2_error_t usb2_req_set_port_feature(struct usb2_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel); -usb2_error_t usb2_req_set_protocol(struct usb2_device *udev, struct mtx *mtx, uint8_t iface_index, uint16_t report); -usb2_error_t usb2_req_set_report(struct usb2_device *udev, struct mtx *mtx, void *data, uint16_t len, uint8_t iface_index, uint8_t type, uint8_t id); +usb2_error_t usb2_do_request_flags(struct usb2_device *udev, struct mtx *mtx, + struct usb2_device_request *req, void *data, uint32_t flags, + uint16_t *actlen, uint32_t timeout); +usb2_error_t usb2_req_clear_hub_feature(struct usb2_device *udev, + struct mtx *mtx, uint16_t sel); +usb2_error_t usb2_req_clear_port_feature(struct usb2_device *udev, + struct mtx *mtx, uint8_t port, uint16_t sel); +usb2_error_t usb2_req_get_alt_interface_no(struct usb2_device *udev, + struct mtx *mtx, uint8_t *alt_iface_no, + uint8_t iface_index); +usb2_error_t usb2_req_get_config(struct usb2_device *udev, struct mtx *mtx, + uint8_t *pconf); +usb2_error_t usb2_req_get_config_desc(struct usb2_device *udev, struct mtx *mtx, + struct usb2_config_descriptor *d, uint8_t conf_index); +usb2_error_t usb2_req_get_config_desc_full(struct usb2_device *udev, + struct mtx *mtx, struct usb2_config_descriptor **ppcd, + struct malloc_type *mtype, uint8_t conf_index); +usb2_error_t usb2_req_get_desc(struct usb2_device *udev, struct mtx *mtx, + void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, + uint8_t type, uint8_t index, uint8_t retries); +usb2_error_t usb2_req_get_device_desc(struct usb2_device *udev, struct mtx *mtx, + struct usb2_device_descriptor *d); +usb2_error_t usb2_req_get_device_status(struct usb2_device *udev, + struct mtx *mtx, struct usb2_status *st); +usb2_error_t usb2_req_get_hub_descriptor(struct usb2_device *udev, + struct mtx *mtx, struct usb2_hub_descriptor *hd, + uint8_t nports); +usb2_error_t usb2_req_get_hub_status(struct usb2_device *udev, struct mtx *mtx, + struct usb2_hub_status *st); +usb2_error_t usb2_req_get_port_status(struct usb2_device *udev, struct mtx *mtx, + struct usb2_port_status *ps, uint8_t port); +usb2_error_t usb2_req_get_report(struct usb2_device *udev, struct mtx *mtx, + void *data, uint16_t len, uint8_t iface_index, uint8_t type, + uint8_t id); +usb2_error_t usb2_req_get_report_descriptor(struct usb2_device *udev, + struct mtx *mtx, void *d, uint16_t size, + uint8_t iface_index); +usb2_error_t usb2_req_get_string_any(struct usb2_device *udev, struct mtx *mtx, + char *buf, uint16_t len, uint8_t string_index); +usb2_error_t usb2_req_get_string_desc(struct usb2_device *udev, struct mtx *mtx, + void *sdesc, uint16_t max_len, uint16_t lang_id, + uint8_t string_index); +usb2_error_t usb2_req_reset_port(struct usb2_device *udev, struct mtx *mtx, + uint8_t port); +usb2_error_t usb2_req_set_address(struct usb2_device *udev, struct mtx *mtx, + uint16_t addr); +usb2_error_t usb2_req_set_alt_interface_no(struct usb2_device *udev, + struct mtx *mtx, uint8_t iface_index, uint8_t alt_no); +usb2_error_t usb2_req_set_config(struct usb2_device *udev, struct mtx *mtx, + uint8_t conf); +usb2_error_t usb2_req_set_hub_feature(struct usb2_device *udev, struct mtx *mtx, + uint16_t sel); +usb2_error_t usb2_req_set_idle(struct usb2_device *udev, struct mtx *mtx, + uint8_t iface_index, uint8_t duration, uint8_t id); +usb2_error_t usb2_req_set_port_feature(struct usb2_device *udev, + struct mtx *mtx, uint8_t port, uint16_t sel); +usb2_error_t usb2_req_set_protocol(struct usb2_device *udev, struct mtx *mtx, + uint8_t iface_index, uint16_t report); +usb2_error_t usb2_req_set_report(struct usb2_device *udev, struct mtx *mtx, + void *data, uint16_t len, uint8_t iface_index, + uint8_t type, uint8_t id); usb2_error_t usb2_req_re_enumerate(struct usb2_device *udev, struct mtx *mtx); #define usb2_do_request(u,m,r,d) \ Modified: head/sys/dev/usb2/core/usb2_sw_transfer.h ============================================================================== --- head/sys/dev/usb2/core/usb2_sw_transfer.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_sw_transfer.h Thu Dec 11 23:13:02 2008 (r185948) @@ -56,6 +56,7 @@ struct usb2_sw_transfer { /* prototypes */ -void usb2_sw_transfer(struct usb2_sw_transfer *std, usb2_sw_transfer_func_t *func); +void usb2_sw_transfer(struct usb2_sw_transfer *std, + usb2_sw_transfer_func_t *func); #endif /* _USB2_SW_TRANSFER_H_ */ Modified: head/sys/dev/usb2/core/usb2_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_transfer.c Thu Dec 11 23:13:02 2008 (r185948) @@ -119,17 +119,17 @@ static const struct usb2_config usb2_con /* function prototypes */ -static void usb2_update_max_frame_size(struct usb2_xfer *xfer); -static uint32_t usb2_get_dma_delay(struct usb2_bus *bus); -static void usb2_transfer_unsetup_sub(struct usb2_xfer_root *info, uint8_t needs_delay); -static void usb2_control_transfer_init(struct usb2_xfer *xfer); -static uint8_t usb2_start_hardware_sub(struct usb2_xfer *xfer); -static void usb2_callback_proc(struct usb2_proc_msg *_pm); -static void usb2_callback_ss_done_defer(struct usb2_xfer *xfer); -static void usb2_callback_wrapper(struct usb2_xfer_queue *pq); -static void usb2_dma_delay_done_cb(void *arg); -static void usb2_transfer_start_cb(void *arg); -static uint8_t usb2_callback_wrapper_sub(struct usb2_xfer *xfer); +static void usb2_update_max_frame_size(struct usb2_xfer *); +static uint32_t usb2_get_dma_delay(struct usb2_bus *); +static void usb2_transfer_unsetup_sub(struct usb2_xfer_root *, uint8_t); +static void usb2_control_transfer_init(struct usb2_xfer *); +static uint8_t usb2_start_hardware_sub(struct usb2_xfer *); +static void usb2_callback_proc(struct usb2_proc_msg *); +static void usb2_callback_ss_done_defer(struct usb2_xfer *); +static void usb2_callback_wrapper(struct usb2_xfer_queue *); +static void usb2_dma_delay_done_cb(void *); +static void usb2_transfer_start_cb(void *); +static uint8_t usb2_callback_wrapper_sub(struct usb2_xfer *); /*------------------------------------------------------------------------* * usb2_update_max_frame_size Modified: head/sys/dev/usb2/core/usb2_transfer.h ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.h Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/core/usb2_transfer.h Thu Dec 11 23:13:02 2008 (r185948) @@ -103,20 +103,26 @@ struct usb2_setup_params { /* function prototypes */ uint8_t usb2_transfer_pending(struct usb2_xfer *xfer); -uint8_t usb2_transfer_setup_sub_malloc(struct usb2_setup_params *parm, struct usb2_page_cache **ppc, uint32_t size, uint32_t align, uint32_t count); -void usb2_command_wrapper(struct usb2_xfer_queue *pq, struct usb2_xfer *xfer); +uint8_t usb2_transfer_setup_sub_malloc(struct usb2_setup_params *parm, + struct usb2_page_cache **ppc, uint32_t size, uint32_t align, + uint32_t count); +void usb2_command_wrapper(struct usb2_xfer_queue *pq, + struct usb2_xfer *xfer); void usb2_pipe_enter(struct usb2_xfer *xfer); void usb2_pipe_start(struct usb2_xfer_queue *pq); void usb2_transfer_dequeue(struct usb2_xfer *xfer); void usb2_transfer_done(struct usb2_xfer *xfer, usb2_error_t error); -void usb2_transfer_enqueue(struct usb2_xfer_queue *pq, struct usb2_xfer *xfer); +void usb2_transfer_enqueue(struct usb2_xfer_queue *pq, + struct usb2_xfer *xfer); void usb2_transfer_setup_sub(struct usb2_setup_params *parm); void usb2_default_transfer_setup(struct usb2_device *udev); -void usb2_clear_data_toggle(struct usb2_device *udev, struct usb2_pipe *pipe); +void usb2_clear_data_toggle(struct usb2_device *udev, + struct usb2_pipe *pipe); void usb2_do_poll(struct usb2_xfer **ppxfer, uint16_t max); usb2_callback_t usb2_do_request_callback; usb2_callback_t usb2_handle_request_callback; usb2_callback_t usb2_do_clear_stall_callback; -void usb2_transfer_timeout_ms(struct usb2_xfer *xfer, void (*cb) (void *arg), uint32_t ms); +void usb2_transfer_timeout_ms(struct usb2_xfer *xfer, + void (*cb) (void *arg), uint32_t ms); #endif /* _USB2_TRANSFER_H_ */ Modified: head/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_aue2.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/ethernet/if_aue2.c Thu Dec 11 23:13:02 2008 (r185948) @@ -190,13 +190,15 @@ static usb2_callback_t aue_bulk_read_cal static usb2_callback_t aue_bulk_write_clear_stall_callback; static usb2_callback_t aue_bulk_write_callback; -static void aue_cfg_do_request(struct aue_softc *sc, struct usb2_device_request *req, void *data); -static uint8_t aue_cfg_csr_read_1(struct aue_softc *sc, uint16_t reg); -static uint16_t aue_cfg_csr_read_2(struct aue_softc *sc, uint16_t reg); -static void aue_cfg_csr_write_1(struct aue_softc *sc, uint16_t reg, uint8_t val); -static void aue_cfg_csr_write_2(struct aue_softc *sc, uint16_t reg, uint16_t val); -static void aue_cfg_eeprom_getword(struct aue_softc *sc, uint8_t addr, uint8_t *dest); -static void aue_cfg_read_eeprom(struct aue_softc *sc, uint8_t *dest, uint16_t off, uint16_t len); +static void aue_cfg_do_request(struct aue_softc *, + struct usb2_device_request *, void *); +static uint8_t aue_cfg_csr_read_1(struct aue_softc *, uint16_t); +static uint16_t aue_cfg_csr_read_2(struct aue_softc *, uint16_t); +static void aue_cfg_csr_write_1(struct aue_softc *, uint16_t, uint8_t); +static void aue_cfg_csr_write_2(struct aue_softc *, uint16_t, uint16_t); +static void aue_cfg_eeprom_getword(struct aue_softc *, uint8_t, uint8_t *); +static void aue_cfg_read_eeprom(struct aue_softc *, uint8_t *, uint16_t, + uint16_t); static miibus_readreg_t aue_cfg_miibus_readreg; static miibus_writereg_t aue_cfg_miibus_writereg; @@ -213,15 +215,15 @@ static usb2_config_td_command_t aue_cfg_ static usb2_config_td_command_t aue_cfg_pre_stop; static usb2_config_td_command_t aue_cfg_stop; -static void aue_cfg_reset_pegasus_II(struct aue_softc *sc); -static void aue_cfg_reset(struct aue_softc *sc); -static void aue_start_cb(struct ifnet *ifp); -static void aue_init_cb(void *arg); -static void aue_start_transfers(struct aue_softc *sc); -static int aue_ifmedia_upd_cb(struct ifnet *ifp); -static void aue_ifmedia_sts_cb(struct ifnet *ifp, struct ifmediareq *ifmr); -static int aue_ioctl_cb(struct ifnet *ifp, u_long command, caddr_t data); -static void aue_watchdog(void *arg); +static void aue_cfg_reset_pegasus_II(struct aue_softc *); +static void aue_cfg_reset(struct aue_softc *); +static void aue_start_cb(struct ifnet *); +static void aue_init_cb(void *); +static void aue_start_transfers(struct aue_softc *); +static int aue_ifmedia_upd_cb(struct ifnet *); +static void aue_ifmedia_sts_cb(struct ifnet *, struct ifmediareq *); +static int aue_ioctl_cb(struct ifnet *, u_long, caddr_t); +static void aue_watchdog(void *); static const struct usb2_config aue_config[AUE_ENDPT_MAX] = { Modified: head/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_axe2.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/ethernet/if_axe2.c Thu Dec 11 23:13:02 2008 (r185948) @@ -159,8 +159,6 @@ static usb2_callback_t axe_bulk_read_cal static usb2_callback_t axe_bulk_write_clear_stall_callback; static usb2_callback_t axe_bulk_write_callback; -static void axe_cfg_cmd(struct axe_softc *sc, uint16_t cmd, uint16_t index, uint16_t val, void *buf); - static miibus_readreg_t axe_cfg_miibus_readreg; static miibus_writereg_t axe_cfg_miibus_writereg; static miibus_statchg_t axe_cfg_miibus_statchg; @@ -176,16 +174,18 @@ static usb2_config_td_command_t axe_cfg_ static usb2_config_td_command_t axe_cfg_pre_stop; static usb2_config_td_command_t axe_cfg_stop; -static int axe_ifmedia_upd_cb(struct ifnet *ifp); -static void axe_ifmedia_sts_cb(struct ifnet *ifp, struct ifmediareq *ifmr); -static void axe_cfg_reset(struct axe_softc *sc); -static void axe_start_cb(struct ifnet *ifp); -static void axe_start_transfers(struct axe_softc *sc); -static void axe_init_cb(void *arg); -static int axe_ioctl_cb(struct ifnet *ifp, u_long command, caddr_t data); -static void axe_watchdog(void *arg); -static void axe_cfg_ax88178_init(struct axe_softc *); -static void axe_cfg_ax88772_init(struct axe_softc *); +static int axe_ifmedia_upd_cb(struct ifnet *); +static void axe_ifmedia_sts_cb(struct ifnet *, struct ifmediareq *); +static void axe_cfg_reset(struct axe_softc *); +static void axe_start_cb(struct ifnet *); +static void axe_start_transfers(struct axe_softc *); +static void axe_init_cb(void *); +static int axe_ioctl_cb(struct ifnet *, u_long, caddr_t); +static void axe_watchdog(void *); +static void axe_cfg_cmd(struct axe_softc *, uint16_t, uint16_t, uint16_t, + void *); +static void axe_cfg_ax88178_init(struct axe_softc *); +static void axe_cfg_ax88772_init(struct axe_softc *); static const struct usb2_config axe_config[AXE_ENDPT_MAX] = { Modified: head/sys/dev/usb2/ethernet/if_cdce2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdce2.c Thu Dec 11 23:04:34 2008 (r185947) +++ head/sys/dev/usb2/ethernet/if_cdce2.c Thu Dec 11 23:13:02 2008 (r185948) @@ -81,14 +81,14 @@ static usb2_callback_t cdce_bulk_read_ca static usb2_callback_t cdce_intr_read_callback; static usb2_callback_t cdce_intr_write_callback; -static void cdce_start_cb(struct ifnet *ifp); -static void cdce_start_transfers(struct cdce_softc *sc); -static uint32_t cdce_m_crc32(struct mbuf *m, uint32_t src_offset, uint32_t src_len); -static void cdce_stop(struct cdce_softc *sc); -static int cdce_ioctl_cb(struct ifnet *ifp, u_long command, caddr_t data); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 23:17:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD0E8106568C; Thu, 11 Dec 2008 23:17:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8E0F8FC1B; Thu, 11 Dec 2008 23:17:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBBNHm9A079541; Thu, 11 Dec 2008 23:17:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBBNHm77079533; Thu, 11 Dec 2008 23:17:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812112317.mBBNHm77079533@svn.freebsd.org> From: Andrew Thompson Date: Thu, 11 Dec 2008 23:17: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: r185950 - in head/sys/dev/usb2: bluetooth controller core ethernet image input misc quirk serial sound storage template 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, 11 Dec 2008 23:17:49 -0000 Author: thompsa Date: Thu Dec 11 23:17:48 2008 New Revision: 185950 URL: http://svn.freebsd.org/changeset/base/185950 Log: Remove superfluous return statements from the end of void functions. Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c head/sys/dev/usb2/bluetooth/ubtbcmfw2.c head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb2/controller/ehci2.c head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/musb2_otg_atmelarm.c head/sys/dev/usb2/controller/ohci2.c head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb2/core/usb2_busdma.c head/sys/dev/usb2/core/usb2_compat_linux.c head/sys/dev/usb2/core/usb2_config_td.c head/sys/dev/usb2/core/usb2_debug.c head/sys/dev/usb2/core/usb2_dev.c head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_dynamic.c head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb2/core/usb2_handle_request.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/core/usb2_msctest.c head/sys/dev/usb2/core/usb2_process.c head/sys/dev/usb2/core/usb2_request.c head/sys/dev/usb2/core/usb2_sw_transfer.c head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_util.c head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/ethernet/usb2_ethernet.c head/sys/dev/usb2/image/uscanner2.c head/sys/dev/usb2/input/uhid2.c head/sys/dev/usb2/input/ukbd2.c head/sys/dev/usb2/input/ums2.c head/sys/dev/usb2/misc/udbp2.c head/sys/dev/usb2/quirk/usb2_quirk.c head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/usb2_serial.c head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb2/sound/uaudio2.c head/sys/dev/usb2/storage/ata-usb2.c head/sys/dev/usb2/storage/umass2.c head/sys/dev/usb2/storage/urio2.c head/sys/dev/usb2/storage/ustorage2_fs.c head/sys/dev/usb2/template/usb2_template.c head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ng_ubt2.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/bluetooth/ng_ubt2.c Thu Dec 11 23:17:48 2008 (r185950) @@ -818,7 +818,6 @@ ubt_intr_read_clear_stall_callback(struc sc->sc_flags &= ~UBT_FLAG_INTR_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -883,8 +882,6 @@ done: usb2_transfer_start(sc->sc_xfer_if_0[2]); mtx_unlock(&sc->sc_mtx); - - return; } static void @@ -972,7 +969,6 @@ ubt_bulk_read_clear_stall_callback(struc sc->sc_flags &= ~UBT_FLAG_READ_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -1040,8 +1036,6 @@ done: usb2_transfer_start(sc->sc_xfer_if_0[1]); mtx_unlock(&sc->sc_mtx); - - return; } static void @@ -1121,7 +1115,6 @@ ubt_bulk_write_clear_stall_callback(stru sc->sc_flags &= ~UBT_FLAG_WRITE_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -1265,8 +1258,6 @@ done: } mtx_unlock(&sc->sc_mtx); - - return; } static void Modified: head/sys/dev/usb2/bluetooth/ubtbcmfw2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Thu Dec 11 23:17:48 2008 (r185950) @@ -305,7 +305,6 @@ ubtbcmfw_write_clear_stall_callback(stru sc->sc_flags &= ~UBTBCMFW_FLAG_WRITE_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -351,7 +350,6 @@ ubtbcmfw_read_clear_stall_callback(struc sc->sc_flags &= ~UBTBCMFW_FLAG_READ_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -360,7 +358,6 @@ ubtbcmfw_start_read(struct usb2_fifo *fi struct ubtbcmfw_softc *sc = fifo->priv_sc0; usb2_transfer_start(sc->sc_xfer[1]); - return; } static void @@ -370,7 +367,6 @@ ubtbcmfw_stop_read(struct usb2_fifo *fif usb2_transfer_stop(sc->sc_xfer[3]); usb2_transfer_stop(sc->sc_xfer[1]); - return; } static void @@ -379,7 +375,6 @@ ubtbcmfw_start_write(struct usb2_fifo *f struct ubtbcmfw_softc *sc = fifo->priv_sc0; usb2_transfer_start(sc->sc_xfer[0]); - return; } static void @@ -389,7 +384,6 @@ ubtbcmfw_stop_write(struct usb2_fifo *fi usb2_transfer_stop(sc->sc_xfer[2]); usb2_transfer_stop(sc->sc_xfer[0]); - return; } static int @@ -424,7 +418,6 @@ ubtbcmfw_close(struct usb2_fifo *fifo, i if (fflags & (FREAD | FWRITE)) { usb2_fifo_free_buffer(fifo); } - return; } static int Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/controller/at91dci.c Thu Dec 11 23:17:48 2008 (r185950) @@ -200,7 +200,6 @@ at91dci_get_hw_ep_profile(struct usb2_de } else { *ppf = NULL; } - return; } static void @@ -219,7 +218,6 @@ at91dci_clocks_on(struct at91dci_softc * /* enable Transceiver */ AT91_UDP_WRITE_4(sc, AT91_UDP_TXVC, 0); } - return; } static void @@ -237,7 +235,6 @@ at91dci_clocks_off(struct at91dci_softc } sc->sc_flags.clocks_off = 1; } - return; } static void @@ -250,7 +247,6 @@ at91dci_pull_up(struct at91dci_softc *sc sc->sc_flags.d_pulled_up = 1; (sc->sc_pull_up) (sc->sc_pull_arg); } - return; } static void @@ -262,7 +258,6 @@ at91dci_pull_down(struct at91dci_softc * sc->sc_flags.d_pulled_up = 0; (sc->sc_pull_down) (sc->sc_pull_arg); } - return; } static void @@ -279,8 +274,6 @@ at91dci_wakeup_peer(struct at91dci_softc return; } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, temp); - - return; } static void @@ -304,8 +297,6 @@ at91dci_rem_wakeup_set(struct usb2_devic } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, temp); - - return; } static void @@ -315,8 +306,6 @@ at91dci_set_address(struct at91dci_softc AT91_UDP_WRITE_4(sc, AT91_UDP_FADDR, addr | AT91_UDP_FADDR_EN); - - return; } static uint8_t @@ -756,7 +745,6 @@ repeat: goto repeat; } } - return; } static void @@ -792,8 +780,6 @@ at91dci_vbus_interrupt(struct usb2_bus * } USB_BUS_UNLOCK(&sc->sc_bus); - - return; } void @@ -880,8 +866,6 @@ at91dci_interrupt(struct at91dci_softc * at91dci_interrupt_poll(sc); } USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -906,7 +890,6 @@ at91dci_setup_standard_chain_sub(struct td->did_stall = 0; td->short_pkt = temp->short_pkt; td->alt_next = temp->setup_alt_next; - return; } static void @@ -1054,7 +1037,6 @@ at91dci_setup_standard_chain(struct usb2 td = xfer->td_transfer_first; td->fifo_bank = 1; } - return; } static void @@ -1071,8 +1053,6 @@ at91dci_timeout(void *arg) at91dci_device_done(xfer, USB_ERR_TIMEOUT); USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -1104,7 +1084,6 @@ at91dci_start_standard_chain(struct usb2 &at91dci_timeout, xfer->timeout); } } - return; } static void @@ -1240,7 +1219,6 @@ at91dci_standard_done(struct usb2_xfer * } done: at91dci_device_done(xfer, err); - return; } /*------------------------------------------------------------------------* @@ -1270,7 +1248,6 @@ at91dci_device_done(struct usb2_xfer *xf } /* dequeue transfer and start next transfer */ usb2_transfer_done(xfer, error); - return; } static void @@ -1296,7 +1273,6 @@ at91dci_set_stall(struct usb2_device *ud csr_val = AT91_UDP_READ_4(sc, csr_reg); AT91_CSR_ACK(csr_val, AT91_UDP_CSR_FORCESTALL); AT91_UDP_WRITE_4(sc, csr_reg, csr_val); - return; } static void @@ -1393,8 +1369,6 @@ at91dci_clear_stall_sub(struct at91dci_s /* enable endpoint */ AT91_UDP_WRITE_4(sc, AT91_UDP_CSR(ep_no), csr_val); - - return; } static void @@ -1423,7 +1397,6 @@ at91dci_clear_stall(struct usb2_device * (ed->bEndpointAddress & UE_ADDR), (ed->bmAttributes & UE_XFERTYPE), (ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT))); - return; } usb2_error_t @@ -1511,8 +1484,6 @@ at91dci_uninit(struct at91dci_softc *sc) at91dci_pull_down(sc); at91dci_clocks_off(sc); USB_BUS_UNLOCK(&sc->sc_bus); - - return; } void @@ -1536,7 +1507,6 @@ at91dci_do_poll(struct usb2_bus *bus) at91dci_interrupt_poll(sc); at91dci_root_ctrl_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); - return; } /*------------------------------------------------------------------------* @@ -1552,7 +1522,6 @@ static void at91dci_device_bulk_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1567,7 +1536,6 @@ at91dci_device_bulk_start(struct usb2_xf /* setup TDs */ at91dci_setup_standard_chain(xfer); at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_bulk_methods = @@ -1593,7 +1561,6 @@ static void at91dci_device_ctrl_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1608,7 +1575,6 @@ at91dci_device_ctrl_start(struct usb2_xf /* setup TDs */ at91dci_setup_standard_chain(xfer); at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_ctrl_methods = @@ -1634,7 +1600,6 @@ static void at91dci_device_intr_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1649,7 +1614,6 @@ at91dci_device_intr_start(struct usb2_xf /* setup TDs */ at91dci_setup_standard_chain(xfer); at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_intr_methods = @@ -1675,7 +1639,6 @@ static void at91dci_device_isoc_fs_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1728,7 +1691,6 @@ at91dci_device_isoc_fs_enter(struct usb2 /* setup TDs */ at91dci_setup_standard_chain(xfer); - return; } static void @@ -1736,7 +1698,6 @@ at91dci_device_isoc_fs_start(struct usb2 { /* start TD chain */ at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_isoc_fs_methods = @@ -1771,7 +1732,6 @@ at91dci_root_ctrl_close(struct usb2_xfer sc->sc_root_ctrl.xfer = NULL; } at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } /* @@ -1876,8 +1836,6 @@ at91dci_root_ctrl_start(struct usb2_xfer usb2_config_td_queue_command( &sc->sc_config_td, NULL, &at91dci_root_ctrl_task, 0, 0); - - return; } static void @@ -1885,7 +1843,6 @@ at91dci_root_ctrl_task(struct at91dci_so struct at91dci_config_copy *cc, uint16_t refcount) { at91dci_root_ctrl_poll(sc); - return; } static void @@ -2294,7 +2251,6 @@ at91dci_root_ctrl_poll(struct at91dci_so { usb2_sw_transfer(&sc->sc_root_ctrl, &at91dci_root_ctrl_done); - return; } struct usb2_pipe_methods at91dci_root_ctrl_methods = @@ -2325,7 +2281,6 @@ at91dci_root_intr_close(struct usb2_xfer sc->sc_root_intr.xfer = NULL; } at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2340,7 +2295,6 @@ at91dci_root_intr_start(struct usb2_xfer struct at91dci_softc *sc = xfer->usb2_sc; sc->sc_root_intr.xfer = xfer; - return; } struct usb2_pipe_methods at91dci_root_intr_methods = @@ -2465,7 +2419,6 @@ at91dci_xfer_setup(struct usb2_setup_par } xfer->td_start[0] = last_obj; - return; } static void @@ -2530,7 +2483,6 @@ at91dci_pipe_init(struct usb2_device *ud break; } } - return; } struct usb2_bus_methods at91dci_bus_methods = Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/controller/at91dci_atmelarm.c Thu Dec 11 23:17:48 2008 (r185950) @@ -87,7 +87,6 @@ at91_vbus_interrupt(struct at91_udp_soft vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); (sc->sc_dci.sc_bus.methods->vbus_interrupt) (&sc->sc_dci.sc_bus, vbus_val); - return; } static void @@ -97,7 +96,6 @@ at91_udp_clocks_on(void *arg) at91_pmc_clock_enable(sc->sc_iclk); at91_pmc_clock_enable(sc->sc_fclk); - return; } static void @@ -107,21 +105,18 @@ at91_udp_clocks_off(void *arg) at91_pmc_clock_disable(sc->sc_fclk); at91_pmc_clock_disable(sc->sc_iclk); - return; } static void at91_udp_pull_up(void *arg) { at91_pio_gpio_set(PULLUP_BASE, PULLUP_MASK); - return; } static void at91_udp_pull_down(void *arg) { at91_pio_gpio_clear(PULLUP_BASE, PULLUP_MASK); - return; } static int Modified: head/sys/dev/usb2/controller/ehci2.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/controller/ehci2.c Thu Dec 11 23:17:48 2008 (r185950) @@ -152,7 +152,6 @@ ehci_iterate_hw_softc(struct usb2_bus *b sc->sc_hw.isoc_fs_start_pg + i, sizeof(ehci_sitd_t), EHCI_SITD_ALIGN); } - return; } static usb2_error_t @@ -509,8 +508,6 @@ ehci_detach(struct ehci_softc *sc) USB_BUS_UNLOCK(&sc->sc_bus); usb2_callout_drain(&sc->sc_tmo_pcd); - - return; } void @@ -565,7 +562,6 @@ ehci_suspend(struct ehci_softc *sc) "config timeout\n"); } USB_BUS_UNLOCK(&sc->sc_bus); - return; } void @@ -632,8 +628,6 @@ ehci_resume(struct ehci_softc *sc) /* catch any lost interrupts */ ehci_do_poll(&sc->sc_bus); - - return; } void @@ -727,7 +721,6 @@ ehci_dump_regs(ehci_softc_t *sc) printf("port %d status=0x%08x\n", i, EOREAD4(sc, EHCI_PORTSC(i))); } - return; } static void @@ -757,7 +750,6 @@ ehci_dump_link(uint32_t link, int type) } printf(">"); } - return; } static void @@ -793,7 +785,6 @@ ehci_dump_qtd(ehci_qtd_t *qtd) printf(" buffer_hi[%d]=0x%08x\n", s, le32toh(qtd->qtd_buffer_hi[s])); } - return; } static uint8_t @@ -821,7 +812,6 @@ ehci_dump_sqtds(ehci_qtd_t *sqtd) if (sqtd) { printf("dump aborted, too many TDs\n"); } - return; } static void @@ -854,7 +844,6 @@ ehci_dump_sqh(ehci_qh_t *qh) printf("\n"); printf("Overlay qTD:\n"); ehci_dump_qtd((void *)&qh->qh_qtd); - return; } static void @@ -881,7 +870,6 @@ ehci_dump_sitd(ehci_sitd_t *sitd) le32toh(sitd->sitd_bp[1]), le32toh(sitd->sitd_bp_hi[0]), le32toh(sitd->sitd_bp_hi[1])); - return; } static void @@ -929,7 +917,6 @@ ehci_dump_itd(ehci_itd_t *itd) le32toh(itd->itd_bp_hi[4]), le32toh(itd->itd_bp_hi[5]), le32toh(itd->itd_bp_hi[6])); - return; } static void @@ -958,7 +945,6 @@ ehci_dump_isoc(ehci_softc_t *sc) ehci_dump_sitd(sitd); sitd = sitd->prev; } - return; } #endif @@ -977,7 +963,6 @@ ehci_transfer_intr_enqueue(struct usb2_x if (xfer->timeout != 0) { usb2_transfer_timeout_ms(xfer, &ehci_timeout, xfer->timeout); } - return; } #define EHCI_APPEND_FS_TD(std,last) (last) = _ehci_append_fs_td(std,last) @@ -1285,7 +1270,6 @@ ehci_non_isoc_done(struct usb2_xfer *xfe } done: ehci_device_done(xfer, err); - return; } /*------------------------------------------------------------------------* @@ -1429,7 +1413,6 @@ ehci_pcd_enable(ehci_softc_t *sc) &ehci_root_intr_done); USB_BUS_UNLOCK(&sc->sc_bus); - return; } static void @@ -1447,7 +1430,6 @@ repeat: goto repeat; } } - return; } /*------------------------------------------------------------------------* @@ -1520,7 +1502,6 @@ ehci_interrupt(ehci_softc_t *sc) done: USB_BUS_UNLOCK(&sc->sc_bus); - return; } /* @@ -1540,8 +1521,6 @@ ehci_timeout(void *arg) ehci_device_done(xfer, USB_ERR_TIMEOUT); USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -1553,7 +1532,6 @@ ehci_do_poll(struct usb2_bus *bus) ehci_interrupt_poll(sc); ehci_root_ctrl_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); - return; } static void @@ -1726,8 +1704,6 @@ restart: } temp->td = td; temp->td_next = td_next; - - return; } static void @@ -1956,7 +1932,6 @@ ehci_setup_standard_chain(struct usb2_xf usb2_pc_cpu_flush(qh->page_cache); EHCI_APPEND_QH(qh, *qh_last); - return; } static void @@ -2048,8 +2023,6 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru } xfer->aframes = xfer->nframes; - - return; } static void @@ -2113,8 +2086,6 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru } } xfer->aframes = xfer->nframes; - - return; } /* NOTE: "done" can be run two times in a row, @@ -2165,7 +2136,6 @@ ehci_device_done(struct usb2_xfer *xfer, } /* dequeue transfer and start next transfer */ usb2_transfer_done(xfer, error); - return; } /*------------------------------------------------------------------------* @@ -2181,7 +2151,6 @@ static void ehci_device_bulk_close(struct usb2_xfer *xfer) { ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2200,7 +2169,6 @@ ehci_device_bulk_start(struct usb2_xfer /* put transfer on interrupt queue */ ehci_transfer_intr_enqueue(xfer); - return; } struct usb2_pipe_methods ehci_device_bulk_methods = @@ -2226,7 +2194,6 @@ static void ehci_device_ctrl_close(struct usb2_xfer *xfer) { ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2245,7 +2212,6 @@ ehci_device_ctrl_start(struct usb2_xfer /* put transfer on interrupt queue */ ehci_transfer_intr_enqueue(xfer); - return; } struct usb2_pipe_methods ehci_device_ctrl_methods = @@ -2312,7 +2278,6 @@ ehci_device_intr_open(struct usb2_xfer * DPRINTFN(3, "best=%d interval=%d\n", best, xfer->interval); - return; } static void @@ -2327,7 +2292,6 @@ ehci_device_intr_close(struct usb2_xfer sc->sc_intr_stat[xfer->qh_pos]--; ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2346,7 +2310,6 @@ ehci_device_intr_start(struct usb2_xfer /* put transfer on interrupt queue */ ehci_transfer_intr_enqueue(xfer); - return; } struct usb2_pipe_methods ehci_device_intr_methods = @@ -2400,14 +2363,12 @@ ehci_device_isoc_fs_open(struct usb2_xfe usb2_pc_cpu_flush(td->page_cache); } } - return; } static void ehci_device_isoc_fs_close(struct usb2_xfer *xfer) { ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2626,8 +2587,6 @@ ehci_device_isoc_fs_enter(struct usb2_xf /* update isoc_next */ xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_fs_p_last[0]) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); - - return; } static void @@ -2635,7 +2594,6 @@ ehci_device_isoc_fs_start(struct usb2_xf { /* put transfer on interrupt queue */ ehci_transfer_intr_enqueue(xfer); - return; } struct usb2_pipe_methods ehci_device_isoc_fs_methods = @@ -2695,14 +2653,12 @@ ehci_device_isoc_hs_open(struct usb2_xfe usb2_pc_cpu_flush(td->page_cache); } } - return; } static void ehci_device_isoc_hs_close(struct usb2_xfer *xfer) { ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2898,8 +2854,6 @@ ehci_device_isoc_hs_enter(struct usb2_xf /* update isoc_next */ xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_hs_p_last[0]) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); - - return; } static void @@ -2907,7 +2861,6 @@ ehci_device_isoc_hs_start(struct usb2_xf { /* put transfer on interrupt queue */ ehci_transfer_intr_enqueue(xfer); - return; } struct usb2_pipe_methods ehci_device_isoc_hs_methods = @@ -2942,7 +2895,6 @@ ehci_root_ctrl_close(struct usb2_xfer *x sc->sc_root_ctrl.xfer = NULL; } ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } /* data structures and routines @@ -3052,8 +3004,6 @@ ehci_root_ctrl_start(struct usb2_xfer *x usb2_config_td_queue_command (&sc->sc_config_td, NULL, &ehci_root_ctrl_task, 0, 0); - - return; } static void @@ -3061,7 +3011,6 @@ ehci_root_ctrl_task(struct ehci_softc *s struct usb2_config_td_cc *cc, uint16_t refcount) { ehci_root_ctrl_poll(sc); - return; } static void @@ -3459,7 +3408,6 @@ ehci_root_ctrl_poll(struct ehci_softc *s { usb2_sw_transfer(&sc->sc_root_ctrl, &ehci_root_ctrl_done); - return; } struct usb2_pipe_methods ehci_root_ctrl_methods = @@ -3490,7 +3438,6 @@ ehci_root_intr_close(struct usb2_xfer *x sc->sc_root_intr.xfer = NULL; } ehci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -3505,7 +3452,6 @@ ehci_root_intr_start(struct usb2_xfer *x ehci_softc_t *sc = xfer->usb2_sc; sc->sc_root_intr.xfer = xfer; - return; } struct usb2_pipe_methods ehci_root_intr_methods = @@ -3772,7 +3718,6 @@ alloc_dma_set: xfer->flags_int.curr_dma_set = 1; goto alloc_dma_set; } - return; } static void @@ -3853,7 +3798,6 @@ ehci_get_dma_delay(struct usb2_bus *bus, * the transfer descriptor(s) and QH */ *pus = (188); /* microseconds */ - return; } struct usb2_bus_methods ehci_bus_methods = Modified: head/sys/dev/usb2/controller/ehci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2_pci.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/controller/ehci2_pci.c Thu Dec 11 23:17:48 2008 (r185950) @@ -468,7 +468,6 @@ ehci_pci_takecontroller(device_t self) usb2_pause_mtx(NULL, 10); /* wait 10ms */ } } - return; } static driver_t ehci_driver = Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Thu Dec 11 23:15:15 2008 (r185949) +++ head/sys/dev/usb2/controller/musb2_otg.c Thu Dec 11 23:17:48 2008 (r185950) @@ -133,7 +133,6 @@ musbotg_get_hw_ep_profile(struct usb2_de } else { *ppf = NULL; } - return; } static void @@ -151,7 +150,6 @@ musbotg_clocks_on(struct musbotg_softc * /* XXX enable Transceiver */ } - return; } static void @@ -168,7 +166,6 @@ musbotg_clocks_off(struct musbotg_softc } sc->sc_flags.clocks_off = 1; } - return; } static void @@ -183,7 +180,6 @@ musbotg_pull_common(struct musbotg_softc temp &= ~MUSB2_MASK_SOFTC; MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); - return; } static void @@ -196,7 +192,6 @@ musbotg_pull_up(struct musbotg_softc *sc sc->sc_flags.d_pulled_up = 1; musbotg_pull_common(sc, 1); } - return; } static void @@ -208,7 +203,6 @@ musbotg_pull_down(struct musbotg_softc * sc->sc_flags.d_pulled_up = 0; musbotg_pull_common(sc, 0); } - return; } static void @@ -239,14 +233,12 @@ musbotg_wakeup_peer(struct usb2_xfer *xf temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp &= ~MUSB2_MASK_RESUME; MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); - return; } static void musbotg_rem_wakeup_set(struct usb2_device *udev, uint8_t is_on) { DPRINTFN(4, "is_on=%u\n", is_on); - return; } static void @@ -255,7 +247,6 @@ musbotg_set_address(struct musbotg_softc DPRINTFN(4, "addr=%d\n", addr); addr &= 0x7F; MUSB2_WRITE_1(sc, MUSB2_REG_FADDR, addr); - return; } static uint8_t @@ -971,8 +962,6 @@ repeat: goto repeat; } } - - return; } static void @@ -1008,8 +997,6 @@ musbotg_vbus_interrupt(struct usb2_bus * } USB_BUS_UNLOCK(&sc->sc_bus); - - return; } void @@ -1117,8 +1104,6 @@ repeat: goto repeat; USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -1142,7 +1127,6 @@ musbotg_setup_standard_chain_sub(struct td->did_stall = 0; td->short_pkt = temp->short_pkt; td->alt_next = temp->setup_alt_next; - return; } static void @@ -1262,7 +1246,6 @@ musbotg_setup_standard_chain(struct usb2 /* must have at least one frame! */ td = temp.td; xfer->td_transfer_last = td; - return; } static void @@ -1279,8 +1262,6 @@ musbotg_timeout(void *arg) musbotg_device_done(xfer, USB_ERR_TIMEOUT); USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -1321,7 +1302,6 @@ musbotg_ep_int_set(struct usb2_xfer *xfe MUSB2_WRITE_2(sc, MUSB2_REG_INTTXE, temp); } } - return; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 00:57:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A1251065670; Fri, 12 Dec 2008 00:57:39 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490378FC12; Fri, 12 Dec 2008 00:57:39 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC0vd0C081653; Fri, 12 Dec 2008 00:57:39 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC0vdX7081650; Fri, 12 Dec 2008 00:57:39 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812120057.mBC0vdX7081650@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 12 Dec 2008 00:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185956 - 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, 12 Dec 2008 00:57:39 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 12 00:57:38 2008 New Revision: 185956 URL: http://svn.freebsd.org/changeset/base/185956 Log: Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component name on a best-effort basis. Teach vn_fullpath to use this new VOP if a regular VFS cache lookup fails. This VOP is designed to supplement the VFS cache to provide a better chance that a vnode-to-name lookup will succeed. Currently, an implementation for devfs is being committed. The default implementation is to return ENOENT. A big thanks to kib for the mentorship on this, and to pho for running it through his stress test suite. Reviewed by: arch Approved by: kib Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c head/sys/kern/vnode_if.src Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Dec 12 00:56:00 2008 (r185955) +++ head/sys/kern/vfs_cache.c Fri Dec 12 00:57:38 2008 (r185956) @@ -169,6 +169,7 @@ SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchs static void cache_zap(struct namecache *ncp); +static int vn_vptocnp(struct vnode **vp, char **bp, char *buf, u_int *buflen); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, u_int buflen); @@ -840,6 +841,38 @@ vn_fullpath_global(struct thread *td, st return (error); } +static int +vn_vptocnp(struct vnode **vp, char **bp, char *buf, u_int *buflen) +{ + struct vnode *dvp; + int error, vfslocked; + + vhold(*vp); + CACHE_UNLOCK(); + vfslocked = VFS_LOCK_GIANT((*vp)->v_mount); + vn_lock(*vp, LK_SHARED | LK_RETRY); + vdrop(*vp); + error = VOP_VPTOCNP(*vp, &dvp, buf, buflen); + VOP_UNLOCK(*vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + if (error) { + numfullpathfail2++; + return (error); + } + *bp = buf + *buflen; + *vp = dvp; + CACHE_LOCK(); + if ((*vp)->v_iflag & VI_DOOMED) { + /* forced unmount */ + CACHE_UNLOCK(); + vdrop(*vp); + return (ENOENT); + } + vdrop(*vp); + + return (0); +} + /* * The magic behind kern___getcwd() and vn_fullpath(). */ @@ -851,7 +884,8 @@ vn_fullpath1(struct thread *td, struct v int error, i, slash_prefixed; struct namecache *ncp; - bp = buf + buflen - 1; + buflen--; + bp = buf + buflen; *bp = '\0'; error = 0; slash_prefixed = 0; @@ -860,58 +894,77 @@ vn_fullpath1(struct thread *td, struct v numfullpathcalls++; if (vp->v_type != VDIR) { ncp = TAILQ_FIRST(&vp->v_cache_dst); - if (!ncp) { - numfullpathfail2++; - CACHE_UNLOCK(); - return (ENOENT); + if (ncp != NULL) { + for (i = ncp->nc_nlen - 1; i >= 0 && bp > buf; i--) + *--bp = ncp->nc_name[i]; + if (bp == buf) { + numfullpathfail4++; + CACHE_UNLOCK(); + return (ENOMEM); + } + vp = ncp->nc_dvp; + } else { + error = vn_vptocnp(&vp, &bp, buf, &buflen); + if (error) { + return (error); + } } - for (i = ncp->nc_nlen - 1; i >= 0 && bp > buf; i--) - *--bp = ncp->nc_name[i]; - if (bp == buf) { + *--bp = '/'; + buflen--; + if (buflen < 0) { numfullpathfail4++; CACHE_UNLOCK(); return (ENOMEM); } - *--bp = '/'; slash_prefixed = 1; - vp = ncp->nc_dvp; } while (vp != rdir && vp != rootvnode) { if (vp->v_vflag & VV_ROOT) { if (vp->v_iflag & VI_DOOMED) { /* forced unmount */ + CACHE_UNLOCK(); error = EBADF; break; } vp = vp->v_mount->mnt_vnodecovered; continue; } - if (vp->v_dd == NULL) { + if (vp->v_type != VDIR) { numfullpathfail1++; + CACHE_UNLOCK(); error = ENOTDIR; break; } ncp = TAILQ_FIRST(&vp->v_cache_dst); - if (!ncp) { - numfullpathfail2++; - error = ENOENT; - break; + if (ncp != NULL) { + MPASS(ncp->nc_dvp == vp->v_dd); + buflen -= ncp->nc_nlen - 1; + for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--) + *--bp = ncp->nc_name[i]; + if (bp == buf) { + numfullpathfail4++; + CACHE_UNLOCK(); + error = ENOMEM; + break; + } + vp = ncp->nc_dvp; + } else { + error = vn_vptocnp(&vp, &bp, buf, &buflen); + if (error) { + break; + } } - MPASS(ncp->nc_dvp == vp->v_dd); - for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--) - *--bp = ncp->nc_name[i]; - if (bp == buf) { + *--bp = '/'; + buflen--; + if (buflen < 0) { numfullpathfail4++; + CACHE_UNLOCK(); error = ENOMEM; break; } - *--bp = '/'; slash_prefixed = 1; - vp = ncp->nc_dvp; } - if (error) { - CACHE_UNLOCK(); + if (error) return (error); - } if (!slash_prefixed) { if (bp == buf) { numfullpathfail4++; Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Dec 12 00:56:00 2008 (r185955) +++ head/sys/kern/vfs_default.c Fri Dec 12 00:57:38 2008 (r185956) @@ -98,6 +98,7 @@ struct vop_vector default_vnodeops = { .vop_revoke = VOP_PANIC, .vop_strategy = vop_nostrategy, .vop_unlock = vop_stdunlock, + .vop_vptocnp = VOP_ENOENT, .vop_vptofh = vop_stdvptofh, }; @@ -138,6 +139,13 @@ vop_einval(struct vop_generic_args *ap) } int +vop_enoent(struct vop_generic_args *ap) +{ + + return (ENOENT); +} + +int vop_null(struct vop_generic_args *ap) { Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Dec 12 00:56:00 2008 (r185955) +++ head/sys/kern/vnode_if.src Fri Dec 12 00:57:38 2008 (r185956) @@ -595,3 +595,13 @@ vop_vptofh { IN struct vnode *vp; IN struct fid *fhp; }; + +%% vptocnp vp L L L +%% vptocnp vpp - U - + +vop_vptocnp { + IN struct vnode *vp; + OUT struct vnode **vpp; + INOUT char *buf; + INOUT int *buflen; +}; From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 00:58:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA8CA1065675; Fri, 12 Dec 2008 00:58:52 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA5FE8FC12; Fri, 12 Dec 2008 00:58:52 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC0wq4q081717; Fri, 12 Dec 2008 00:58:52 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC0wqAR081716; Fri, 12 Dec 2008 00:58:52 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812120058.mBC0wqAR081716@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 12 Dec 2008 00:58: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: r185957 - 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: Fri, 12 Dec 2008 00:58:52 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 12 00:58:52 2008 New Revision: 185957 URL: http://svn.freebsd.org/changeset/base/185957 Log: Add a new error VOP, VOP_ENOENT. This function will simply return ENOENT. Reviewed by: arch Approved by: kib Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Dec 12 00:57:38 2008 (r185956) +++ head/sys/sys/vnode.h Fri Dec 12 00:58:52 2008 (r185957) @@ -659,6 +659,7 @@ int vop_stdvptofh(struct vop_vptofh_args int vop_eopnotsupp(struct vop_generic_args *ap); int vop_ebadf(struct vop_generic_args *ap); int vop_einval(struct vop_generic_args *ap); +int vop_enoent(struct vop_generic_args *ap); int vop_enotty(struct vop_generic_args *ap); int vop_null(struct vop_generic_args *ap); int vop_panic(struct vop_generic_args *ap); @@ -723,6 +724,7 @@ extern struct vop_vector default_vnodeop #define VOP_EBADF ((void*)(uintptr_t)vop_ebadf) #define VOP_ENOTTY ((void*)(uintptr_t)vop_enotty) #define VOP_EINVAL ((void*)(uintptr_t)vop_einval) +#define VOP_ENOENT ((void*)(uintptr_t)vop_enoent) #define VOP_EOPNOTSUPP ((void*)(uintptr_t)vop_eopnotsupp) /* vfs_hash.c */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 00:59:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DDE7106564A; Fri, 12 Dec 2008 00:59:36 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DEEB8FC23; Fri, 12 Dec 2008 00:59:36 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC0xaFw081766; Fri, 12 Dec 2008 00:59:36 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC0xaXg081765; Fri, 12 Dec 2008 00:59:36 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812120059.mBC0xaXg081765@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 12 Dec 2008 00:59: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: r185958 - head/sys/fs/deadfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 00:59:36 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 12 00:59:36 2008 New Revision: 185958 URL: http://svn.freebsd.org/changeset/base/185958 Log: Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF. Reviewed by: arch Approved by: kib Modified: head/sys/fs/deadfs/dead_vnops.c Modified: head/sys/fs/deadfs/dead_vnops.c ============================================================================== --- head/sys/fs/deadfs/dead_vnops.c Fri Dec 12 00:58:52 2008 (r185957) +++ head/sys/fs/deadfs/dead_vnops.c Fri Dec 12 00:59:36 2008 (r185958) @@ -78,6 +78,7 @@ struct vop_vector dead_vnodeops = { .vop_rmdir = VOP_PANIC, .vop_setattr = VOP_EBADF, .vop_symlink = VOP_PANIC, + .vop_vptocnp = VOP_EBADF, .vop_write = dead_write, }; From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 01:00:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A69C1065688; Fri, 12 Dec 2008 01:00:39 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1A68FC28; Fri, 12 Dec 2008 01:00:39 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC10cbb081843; Fri, 12 Dec 2008 01:00:38 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC10cwZ081842; Fri, 12 Dec 2008 01:00:38 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812120100.mBC10cwZ081842@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 12 Dec 2008 01:00: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: r185959 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 01:00:39 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 12 01:00:38 2008 New Revision: 185959 URL: http://svn.freebsd.org/changeset/base/185959 Log: Implement VOP_VPTOCNP for devfs. Directory and character device vnodes are properly translated to their component names. Reviewed by: arch Approved by: kib Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Fri Dec 12 00:59:36 2008 (r185958) +++ head/sys/fs/devfs/devfs_vnops.c Fri Dec 12 01:00:38 2008 (r185959) @@ -185,6 +185,69 @@ devfs_clear_cdevpriv(void) devfs_fpdrop(fp); } +static int +devfs_vptocnp(struct vop_vptocnp_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct vnode **dvp = ap->a_vpp; + struct devfs_mount *dmp; + char *buf = ap->a_buf; + int *buflen = ap->a_buflen; + struct devfs_dirent *dd, *de; + int i, error; + + dmp = VFSTODEVFS(vp->v_mount); + i = *buflen; + dd = vp->v_data; + error = 0; + + sx_xlock(&dmp->dm_lock); + + if (vp->v_type == VCHR) { + i -= strlen(dd->de_cdp->cdp_c.si_name); + if (i < 0) { + error = ENOMEM; + goto finished; + } + bcopy(dd->de_cdp->cdp_c.si_name, buf + i, + strlen(dd->de_cdp->cdp_c.si_name)); + de = dd->de_dir; + } else if (vp->v_type == VDIR) { + if (dd == dmp->dm_rootdir) { + *dvp = vp; + vhold(*dvp); + goto finished; + } + i -= dd->de_dirent->d_namlen; + if (i < 0) { + error = ENOMEM; + goto finished; + } + bcopy(dd->de_dirent->d_name, buf + i, + dd->de_dirent->d_namlen); + de = dd; + } else { + error = ENOENT; + goto finished; + } + *buflen = i; + de = TAILQ_FIRST(&de->de_dlist); /* "." */ + de = TAILQ_NEXT(de, de_list); /* ".." */ + de = de->de_dir; + mtx_lock(&devfs_de_interlock); + *dvp = de->de_vnode; + if (*dvp != NULL) { + VI_LOCK(*dvp); + mtx_unlock(&devfs_de_interlock); + vholdl(*dvp); + VI_UNLOCK(*dvp); + } else + error = ENOENT; +finished: + sx_xunlock(&dmp->dm_lock); + return (error); +} + /* * Construct the fully qualified path name relative to the mountpoint */ @@ -1465,6 +1528,7 @@ static struct vop_vector devfs_vnodeops .vop_setlabel = devfs_setlabel, #endif .vop_symlink = devfs_symlink, + .vop_vptocnp = devfs_vptocnp, }; static struct vop_vector devfs_specops = { @@ -1499,6 +1563,7 @@ static struct vop_vector devfs_specops = #endif .vop_strategy = VOP_PANIC, .vop_symlink = VOP_PANIC, + .vop_vptocnp = devfs_vptocnp, .vop_write = VOP_PANIC, }; From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 01:08:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC1C61065676; Fri, 12 Dec 2008 01:08:28 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BADFA8FC0C; Fri, 12 Dec 2008 01:08:28 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC18S0p082095; Fri, 12 Dec 2008 01:08:28 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC18SaU082093; Fri, 12 Dec 2008 01:08:28 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812120108.mBC18SaU082093@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 12 Dec 2008 01:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185961 - 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: Fri, 12 Dec 2008 01:08:29 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 12 01:08:28 2008 New Revision: 185961 URL: http://svn.freebsd.org/changeset/base/185961 Log: Add a man page for VOP_VPTOCNP. Reviewed by: arch Approved by: kib Added: head/share/man/man9/VOP_VPTOCNP.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Dec 12 01:01:03 2008 (r185960) +++ head/share/man/man9/Makefile Fri Dec 12 01:08:28 2008 (r185961) @@ -348,6 +348,7 @@ MAN= accept_filter.9 \ VOP_SETACL.9 \ VOP_SETEXTATTR.9 \ VOP_STRATEGY.9 \ + VOP_VPTOCNP.9 \ VOP_VPTOFH.9 \ vput.9 \ vref.9 \ Added: head/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/VOP_VPTOCNP.9 Fri Dec 12 01:08:28 2008 (r185961) @@ -0,0 +1,110 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2008 Joe Marcus Clarke +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 7, 2008 +.Os +.Dt VOP_VPTOCNP 9 +.Sh NAME +.Nm VOP_VPTOCNP +.Nd translate a vnode to its component name +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "char *buf" "int *buflen" +.Sh DESCRIPTION +This translates a vnode into its component name, and writes that name to +the head of the buffer specified by +.Fa buf +.Bl -tag -width buflen +.It Fa vp +The vnode to translate. +.It Fa dvp +The vnode of the parent directory of +.Fa vp . +.It Fa buf +The buffer into which to preprend the component name. +.It Fa buflen +The remaining size of the buffer. +.El +.Pp +The default implementation of +.Nm +simply returns ENOENT. +.Sh LOCKS +The vnode should be locked on entry and will still be locked on exit. The +parent directory vnode will be unlocked on a successful exit. However, it +will have its hold count incremented. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh PSEUDOCODE +.Bd -literal +int +vop_vptocnp(struct vnode *vp, struct vnode **dvp, char *buf, int *buflen) +{ + int error = 0; + + /* + * Translate the vnode to its component name. + * + * Decrement the component name's length from buflen. + * + * Obtain the vnode's parent directory vnode. + */ + ...; + + /* + * Increment the parent directory's hold count. + */ + vhold(*dvp); + + return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ENOMEM +The buffer was not large enough to hold the vnode's component name. +.It Bq Er ENOENT +The vnode was not found on the file system. +.El +.Sh SEE ALSO +.Xr VOP_LOOKUP 9 , +.Xr vnode 9 +.Sh NOTES +This interface is a work in progress. +.Sh HISTORY +The function +.Nm +appeared in +.Fx 8.0 . +.Sh AUTHORS +This manual page was written by +.An Joe Marcus Clarke . From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 01:26:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 612DB106567B; Fri, 12 Dec 2008 01:26:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 510F78FC1D; Fri, 12 Dec 2008 01:26:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC1QCUu082456; Fri, 12 Dec 2008 01:26:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC1QCrF082455; Fri, 12 Dec 2008 01:26:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812120126.mBC1QCrF082455@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 12 Dec 2008 01:26: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: r185962 - head/sys/dev/vr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 01:26:12 -0000 Author: yongari Date: Fri Dec 12 01:26:11 2008 New Revision: 185962 URL: http://svn.freebsd.org/changeset/base/185962 Log: It seems there are still issues on multicast perfect filtering. Disable it until I find spare time to analyze the issue. Reported by: Goran Lowkrantz hidden-powers DOT com> MFC after: 3 days Modified: head/sys/dev/vr/if_vr.c Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Fri Dec 12 01:08:28 2008 (r185961) +++ head/sys/dev/vr/if_vr.c Fri Dec 12 01:26:11 2008 (r185962) @@ -133,7 +133,7 @@ static struct vr_type { 0, "VIA VT6105 Rhine III 10/100BaseTX" }, { VIA_VENDORID, VIA_DEVICEID_RHINE_III_M, - VR_Q_CSUM | VR_Q_CAM, + VR_Q_CSUM, "VIA VT6105M Rhine III 10/100BaseTX" }, { DELTA_VENDORID, DELTA_DEVICEID_RHINE_II, VR_Q_NEEDALIGN, From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 01:36:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B52811065670; Fri, 12 Dec 2008 01:36:50 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4DF38FC08; Fri, 12 Dec 2008 01:36:50 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC1aopV082692; Fri, 12 Dec 2008 01:36:50 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC1aope082691; Fri, 12 Dec 2008 01:36:50 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200812120136.mBC1aope082691@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 12 Dec 2008 01:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185963 - 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, 12 Dec 2008 01:36:50 -0000 Author: csjp Date: Fri Dec 12 01:36:50 2008 New Revision: 185963 URL: http://svn.freebsd.org/changeset/base/185963 Log: Consider processes attaching/detaching from tun(4) devices as being link state changes. This change modifies tunopen and tunclose to call the if_link_state_change() function. Among other things, this will result in devd(8) receiving events from devctl(4) for linkup/link down. This allows us to do several useful things, including initializing tunnel parameters and adding routes. Discussed on: freebsd-net@ MFC after: 2 weeks Modified: head/sys/net/if_tun.c Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Fri Dec 12 01:26:11 2008 (r185962) +++ head/sys/net/if_tun.c Fri Dec 12 01:36:50 2008 (r185963) @@ -426,6 +426,7 @@ tunopen(struct cdev *dev, int flag, int tp->tun_flags |= TUN_OPEN; mtx_unlock(&tp->tun_mtx); ifp = TUN2IFP(tp); + if_link_state_change(ifp, LINK_STATE_UP); TUNDEBUG(ifp, "open\n"); return (0); @@ -482,6 +483,7 @@ tunclose(struct cdev *dev, int foo, int ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); } + if_link_state_change(ifp, LINK_STATE_DOWN); CURVNET_RESTORE(); funsetown(&tp->tun_sigio); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 01:47:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49146106564A; Fri, 12 Dec 2008 01:47:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38FA68FC16; Fri, 12 Dec 2008 01:47:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC1l0bR082926; Fri, 12 Dec 2008 01:47:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC1l0vg082925; Fri, 12 Dec 2008 01:47:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812120147.mBC1l0vg082925@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Dec 2008 01:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185964 - 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: Fri, 12 Dec 2008 01:47:00 -0000 Author: thompsa Date: Fri Dec 12 01:46:59 2008 New Revision: 185964 URL: http://svn.freebsd.org/changeset/base/185964 Log: Pass RTF_RNH_LOCKED to rtalloc1 sunce the node head is locked, this avoids a recursive lock panic on inet6 detach. Reviewed by: kmacy Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Fri Dec 12 01:36:50 2008 (r185963) +++ head/sys/netinet6/in6_ifattach.c Fri Dec 12 01:46:59 2008 (r185964) @@ -834,7 +834,7 @@ in6_ifdetach(struct ifnet *ifp) /* XXX grab lock first to avoid LOR */ if (V_rt_tables[0][AF_INET6] != NULL) { RADIX_NODE_HEAD_LOCK(V_rt_tables[0][AF_INET6]); - rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL); + rt = rtalloc1((struct sockaddr *)&sin6, RTF_RNH_LOCKED, 0UL); if (rt) { if (rt->rt_ifp == ifp) rtexpunge(rt); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 02:07:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D5F21065675; Fri, 12 Dec 2008 02:07:46 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D4838FC18; Fri, 12 Dec 2008 02:07:46 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC27ksf083327; Fri, 12 Dec 2008 02:07:46 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC27jKg083326; Fri, 12 Dec 2008 02:07:46 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812120207.mBC27jKg083326@svn.freebsd.org> From: Kip Macy Date: Fri, 12 Dec 2008 02:07: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: r185965 - 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: Fri, 12 Dec 2008 02:07:46 -0000 Author: kmacy Date: Fri Dec 12 02:07:45 2008 New Revision: 185965 URL: http://svn.freebsd.org/changeset/base/185965 Log: RTF_RNH_LOCKED needs to be passed in the flags arg not report, apologies to thompsa Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Fri Dec 12 01:46:59 2008 (r185964) +++ head/sys/netinet6/in6_ifattach.c Fri Dec 12 02:07:45 2008 (r185965) @@ -834,7 +834,7 @@ in6_ifdetach(struct ifnet *ifp) /* XXX grab lock first to avoid LOR */ if (V_rt_tables[0][AF_INET6] != NULL) { RADIX_NODE_HEAD_LOCK(V_rt_tables[0][AF_INET6]); - rt = rtalloc1((struct sockaddr *)&sin6, RTF_RNH_LOCKED, 0UL); + rt = rtalloc1((struct sockaddr *)&sin6, 0, RTF_RNH_LOCKED); if (rt) { if (rt->rt_ifp == ifp) rtexpunge(rt); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 04:29:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1928A106564A; Fri, 12 Dec 2008 04:29:48 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 087AF8FC0C; Fri, 12 Dec 2008 04:29:48 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC4TlOl086384; Fri, 12 Dec 2008 04:29:47 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC4Tlvc086383; Fri, 12 Dec 2008 04:29:47 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812120429.mBC4Tlvc086383@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 12 Dec 2008 04:29: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: r185968 - 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: Fri, 12 Dec 2008 04:29:48 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 12 04:29:47 2008 New Revision: 185968 URL: http://svn.freebsd.org/changeset/base/185968 Log: Bump __FreeBSD_version for the new VOP_VPTOCNP addition. Approved by: kib (implicit) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Dec 12 03:23:50 2008 (r185967) +++ head/sys/sys/param.h Fri Dec 12 04:29:47 2008 (r185968) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800057 /* Master, propagated to newvers */ +#define __FreeBSD_version 800058 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 05:42:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C558C1065672; Fri, 12 Dec 2008 05:42: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 B46518FC08; Fri, 12 Dec 2008 05:42:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC5gvIP087790; Fri, 12 Dec 2008 05:42:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC5gvg9087789; Fri, 12 Dec 2008 05:42:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812120542.mBC5gvg9087789@svn.freebsd.org> From: John Baldwin Date: Fri, 12 Dec 2008 05:42: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: r185969 - 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: Fri, 12 Dec 2008 05:42:57 -0000 Author: jhb Date: Fri Dec 12 05:42:57 2008 New Revision: 185969 URL: http://svn.freebsd.org/changeset/base/185969 Log: - Drop a reference to an older 'kdb' debugger that FreeBSD never had. - Tweak a word choice. - Drop a reference to Alpha. Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Dec 12 04:29:47 2008 (r185968) +++ head/share/man/man4/ddb.4 Fri Dec 12 05:42:57 2008 (r185969) @@ -102,10 +102,7 @@ is possible, include: .Sh DESCRIPTION The .Nm -kernel debugger has most of the features of the old -.Nm kdb , -but with a more rational syntax -inspired by +kernel debugger is an interactive debugger with a syntax inspired by .Xr gdb 1 . If linked into the running kernel, it can be invoked locally with the @@ -202,7 +199,7 @@ the .Nm emacs control keys, the usual .Tn ANSI -arrow keys might be used to +arrow keys may be used to browse through the history buffer, and move the cursor within the current line. .Sh COMMANDS @@ -254,8 +251,6 @@ display as an instruction display as an instruction with possible alternate formats depending on the machine: .Bl -tag -width ".Tn powerpc" -compact -.It Tn alpha -Show the registers of the instruction. .It Tn amd64 No alternate format. .It Tn i386 From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 05:45:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CBC11065742; Fri, 12 Dec 2008 05:45:40 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9048FC19; Fri, 12 Dec 2008 05:45:40 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC5jejY087900; Fri, 12 Dec 2008 05:45:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC5jeqx087899; Fri, 12 Dec 2008 05:45:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812120545.mBC5jeqx087899@svn.freebsd.org> From: Kip Macy Date: Fri, 12 Dec 2008 05:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185970 - 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: Fri, 12 Dec 2008 05:45:40 -0000 Author: kmacy Date: Fri Dec 12 05:45:39 2008 New Revision: 185970 URL: http://svn.freebsd.org/changeset/base/185970 Log: fix support and capabilities MFC after: 3 days Modified: head/share/man/man4/cxgb.4 Modified: head/share/man/man4/cxgb.4 ============================================================================== --- head/share/man/man4/cxgb.4 Fri Dec 12 05:42:57 2008 (r185969) +++ head/share/man/man4/cxgb.4 Fri Dec 12 05:45:39 2008 (r185970) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007, Chelsio Inc +.\" Copyright (c) 2007-2008, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -56,7 +56,8 @@ if_cxgb_load="YES" The .Nm driver supports Transmit/Receive checksum offload, -Jumbo Frames as well as TCP segmentation offload (TSO). +Jumbo Frames, TCP segmentation offload (TSO), Large Receive Offload (LRO), +VLAN hardware insertion / extraction, and VLAN checksum offload. For further hardware information, see .Pa http://www.chelsio.com/ . .Pp @@ -76,7 +77,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports 10 Gigabit Ethernet adapters based on the T3 and T3B chipset: +driver supports 10 Gigabit and 1 Gigabit Ethernet adapters based on the T3 and T3B chipset: .Pp .Bl -bullet -compact .It @@ -111,7 +112,7 @@ go to the Chelsio support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq help@chelsio.com . +.Aq support@chelsio.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 11:10:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D22F1065670; Fri, 12 Dec 2008 11:10:10 +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 8C1F38FC08; Fri, 12 Dec 2008 11:10:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCBAAPS095833; Fri, 12 Dec 2008 11:10:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCBAAWI095832; Fri, 12 Dec 2008 11:10:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812121110.mBCBAAWI095832@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 12 Dec 2008 11:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185980 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 11:10:10 -0000 Author: kib Date: Fri Dec 12 11:10:10 2008 New Revision: 185980 URL: http://svn.freebsd.org/changeset/base/185980 Log: Do not leak defs_de_interlock on error. Another pointy hat for my collection. Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Fri Dec 12 07:34:42 2008 (r185979) +++ head/sys/fs/devfs/devfs_vnops.c Fri Dec 12 11:10:10 2008 (r185980) @@ -241,8 +241,10 @@ devfs_vptocnp(struct vop_vptocnp_args *a mtx_unlock(&devfs_de_interlock); vholdl(*dvp); VI_UNLOCK(*dvp); - } else + } else { + mtx_unlock(&devfs_de_interlock); error = ENOENT; + } finished: sx_xunlock(&dmp->dm_lock); return (error); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 11:43:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C1A106567B; Fri, 12 Dec 2008 11:43:48 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6829A8FC1E; Fri, 12 Dec 2008 11:43:48 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCBhmIV096455; Fri, 12 Dec 2008 11:43:48 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCBhmNg096451; Fri, 12 Dec 2008 11:43:48 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200812121143.mBCBhmNg096451@svn.freebsd.org> From: Ken Smith Date: Fri, 12 Dec 2008 11:43: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: r185981 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 11:43:48 -0000 Author: kensmith Date: Fri Dec 12 11:43:48 2008 New Revision: 185981 URL: http://svn.freebsd.org/changeset/base/185981 Log: Begin the sysinstall cleanup. Remove the support for configuring OSF binary compatibility. Modified: head/usr.sbin/sysinstall/config.c head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/config.c ============================================================================== --- head/usr.sbin/sysinstall/config.c Fri Dec 12 11:10:10 2008 (r185980) +++ head/usr.sbin/sysinstall/config.c Fri Dec 12 11:43:48 2008 (r185981) @@ -548,17 +548,6 @@ configLinux(dialogMenuItem *self) } #endif -#ifdef __alpha__ -int -configOSF1(dialogMenuItem *self) -{ - - variable_set2(VAR_OSF1_ENABLE, "YES", 1); - Mkdir("/compat/osf1"); - return DITEM_SUCCESS; -} -#endif - int configSecurelevel(dialogMenuItem *self) { Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Fri Dec 12 11:10:10 2008 (r185980) +++ head/usr.sbin/sysinstall/install.c Fri Dec 12 11:43:48 2008 (r185981) @@ -692,12 +692,6 @@ nodisks: (void)configLinux(self); #endif -#ifdef __alpha__ - dialog_clear_norefresh(); - if (!msgYesNo("Would you like to enable OSF/1 binary compatibility?")) - (void)configOSF1(self); -#endif - #ifdef WITH_MICE dialog_clear_norefresh(); if (!msgNoYes("Does this system have a PS/2, serial, or bus mouse?")) Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Fri Dec 12 11:10:10 2008 (r185980) +++ head/usr.sbin/sysinstall/menus.c Fri Dec 12 11:43:48 2008 (r185981) @@ -1257,10 +1257,6 @@ DMenu MenuStartup = { { " SVR4", "This host wants to be able to run SVR4 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, #endif -#ifdef __alpha__ - { " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.", - dmenuVarCheck, configOSF1, NULL, VAR_OSF1_ENABLE "=YES" }, -#endif { " quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { NULL } }, Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Fri Dec 12 11:10:10 2008 (r185980) +++ head/usr.sbin/sysinstall/sysinstall.h Fri Dec 12 11:43:48 2008 (r185981) @@ -169,7 +169,6 @@ #define VAR_NO_HOME "noHome" #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" -#define VAR_OSF1_ENABLE "osf1_enable" #define VAR_RPCBIND_ENABLE "rpcbind_enable" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" @@ -533,9 +532,6 @@ extern int configSaverTimeout(dialogMenu extern int configLinux(dialogMenuItem *self); #endif extern int configNTP(dialogMenuItem *self); -#ifdef __alpha__ -extern int configOSF1(dialogMenuItem *self); -#endif extern int configCountry(dialogMenuItem *self); extern int configUsers(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 11:58:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A15B1065672; Fri, 12 Dec 2008 11:58:27 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 887598FC19; Fri, 12 Dec 2008 11:58:27 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCBwRm9096824; Fri, 12 Dec 2008 11:58:27 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCBwRPT096820; Fri, 12 Dec 2008 11:58:27 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200812121158.mBCBwRPT096820@svn.freebsd.org> From: Ken Smith Date: Fri, 12 Dec 2008 11:58: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: r185982 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 11:58:27 -0000 Author: kensmith Date: Fri Dec 12 11:58:27 2008 New Revision: 185982 URL: http://svn.freebsd.org/changeset/base/185982 Log: Remove the offer to install Linux compatibility on i386 in the mainline portion of sysinstall. Leave it to be treated as a regular package along with all the other packages... Modified: head/usr.sbin/sysinstall/config.c head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/config.c ============================================================================== --- head/usr.sbin/sysinstall/config.c Fri Dec 12 11:43:48 2008 (r185981) +++ head/usr.sbin/sysinstall/config.c Fri Dec 12 11:58:27 2008 (r185982) @@ -531,23 +531,6 @@ configUsers(dialogMenuItem *self) return DITEM_SUCCESS; } -#ifdef WITH_LINUX -int -configLinux(dialogMenuItem *self) -{ - WINDOW *w = savescr(); - int i; - - dialog_clear_norefresh(); - variable_set2(VAR_LINUX_ENABLE, "YES", 1); - Mkdir("/compat/linux"); - msgNotify("Installing Linux compatibility library..."); - i = package_add("linux_base-fc"); - restorescr(w); - return i; -} -#endif - int configSecurelevel(dialogMenuItem *self) { Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Fri Dec 12 11:43:48 2008 (r185981) +++ head/usr.sbin/sysinstall/install.c Fri Dec 12 11:58:27 2008 (r185982) @@ -686,12 +686,6 @@ nodisks: if (!msgYesNo("Would you like to set this machine's time zone now?")) systemExecute("tzsetup"); -#ifdef WITH_LINUX - dialog_clear_norefresh(); - if (!msgYesNo("Would you like to enable Linux binary compatibility?")) - (void)configLinux(self); -#endif - #ifdef WITH_MICE dialog_clear_norefresh(); if (!msgNoYes("Does this system have a PS/2, serial, or bus mouse?")) Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Fri Dec 12 11:43:48 2008 (r185981) +++ head/usr.sbin/sysinstall/menus.c Fri Dec 12 11:58:27 2008 (r185982) @@ -1247,10 +1247,6 @@ DMenu MenuStartup = { dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, { " lpd", "This host has a printer and wants to run lpd.", dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" }, -#ifdef WITH_LINUX - { " Linux", "This host wants to be able to run Linux binaries.", - dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" }, -#endif #ifdef __i386__ { " SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Fri Dec 12 11:43:48 2008 (r185981) +++ head/usr.sbin/sysinstall/sysinstall.h Fri Dec 12 11:58:27 2008 (r185982) @@ -61,10 +61,6 @@ #define WITH_SLICES #endif -#if defined(__i386__) -#define WITH_LINUX -#endif - /* device limits */ #define DEV_NAME_MAX 128 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 12:06:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 159EF106564A; Fri, 12 Dec 2008 12:06:29 +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 04AAC8FC16; Fri, 12 Dec 2008 12:06:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCC6SEB097020; Fri, 12 Dec 2008 12:06:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCC6SES097018; Fri, 12 Dec 2008 12:06:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812121206.mBCC6SES097018@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 12 Dec 2008 12:06: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: r185983 - 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, 12 Dec 2008 12:06:29 -0000 Author: kib Date: Fri Dec 12 12:06:28 2008 New Revision: 185983 URL: http://svn.freebsd.org/changeset/base/185983 Log: The userland_sysctl() function retries sysctl_root() until returned error is not EAGAIN. Several sysctls that inspect another process use p_candebug() for checking access right for the curproc. p_candebug() returns EAGAIN for some reasons, in particular, for the process doing exec() now. If execing process tries to lock Giant, we get a livelock, because sysctl handlers are covered by Giant, and often do not sleep. Break the livelock by dropping Giant and allowing other threads to execute in the EAGAIN loop. Also, do not return EAGAIN from p_candebug() when process is executing, use more appropriate EBUSY error [1]. Reported and tested by: pho Suggested by: rwatson [1] Reviewed by: rwatson, des MFC after: 1 week Modified: head/sys/kern/kern_prot.c head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Dec 12 11:58:27 2008 (r185982) +++ head/sys/kern/kern_prot.c Fri Dec 12 12:06:28 2008 (r185983) @@ -1679,7 +1679,7 @@ p_candebug(struct thread *td, struct pro * should be moved to the caller's of p_candebug(). */ if ((p->p_flag & P_INEXEC) != 0) - return (EAGAIN); + return (EBUSY); return (0); } Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Dec 12 11:58:27 2008 (r185982) +++ head/sys/kern/kern_sysctl.c Fri Dec 12 12:06:28 2008 (r185983) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1416,11 +1417,16 @@ userland_sysctl(struct thread *td, int * SYSCTL_LOCK(); CURVNET_SET(TD_TO_VNET(curthread)); - do { + for (;;) { req.oldidx = 0; req.newidx = 0; error = sysctl_root(0, name, namelen, &req); - } while (error == EAGAIN); + if (error != EAGAIN) + break; + DROP_GIANT(); + uio_yield(); + PICKUP_GIANT(); + } if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 12:12:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAE0C106564A; Fri, 12 Dec 2008 12:12:36 +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 D98C88FC12; Fri, 12 Dec 2008 12:12:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCCCaIh097169; Fri, 12 Dec 2008 12:12:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCCCaEn097166; Fri, 12 Dec 2008 12:12:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812121212.mBCCCaEn097166@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 12 Dec 2008 12:12: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: r185984 - in head/sys: compat/linprocfs fs/procfs 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, 12 Dec 2008 12:12:37 -0000 Author: kib Date: Fri Dec 12 12:12:36 2008 New Revision: 185984 URL: http://svn.freebsd.org/changeset/base/185984 Log: Reference the vmspace of the process being inspected by procfs, linprocfs and sysctl kern_proc_vmmap handlers. Reported and tested by: pho Reviewed by: rwatson, des MFC after: 1 week Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_map.c head/sys/kern/kern_proc.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Dec 12 12:06:28 2008 (r185983) +++ head/sys/compat/linprocfs/linprocfs.c Fri Dec 12 12:12:36 2008 (r185984) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -874,7 +875,8 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) static int linprocfs_doprocmaps(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t e_start, e_end; @@ -899,6 +901,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) return (EOPNOTSUPP); error = 0; + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -985,6 +991,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Fri Dec 12 12:06:28 2008 (r185983) +++ head/sys/fs/procfs/procfs_map.c Fri Dec 12 12:12:36 2008 (r185984) @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -82,7 +83,8 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; @@ -109,6 +111,10 @@ procfs_doprocmap(PFS_FILL_ARGS) } #endif + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -235,5 +241,6 @@ procfs_doprocmap(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Dec 12 12:06:28 2008 (r185983) +++ head/sys/kern/kern_proc.c Fri Dec 12 12:12:36 2008 (r185984) @@ -1357,6 +1357,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A struct vnode *vp; struct proc *p; vm_map_t map; + struct vmspace *vm; name = (int *)arg1; if ((p = pfind((pid_t)name[0])) == NULL) @@ -1371,7 +1372,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } _PHOLD(p); PROC_UNLOCK(p); - + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + PRELE(p); + return (ESRCH); + } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ @@ -1501,6 +1506,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } } vm_map_unlock_read(map); + vmspace_free(vm); PRELE(p); free(kve, M_TEMP); return (error); @@ -1523,6 +1529,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR int error, *name; struct vnode *vp; struct proc *p; + struct vmspace *vm; vm_map_t map; name = (int *)arg1; @@ -1538,10 +1545,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } _PHOLD(p); PROC_UNLOCK(p); - + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + PRELE(p); + return (ESRCH); + } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); - map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ + map = &vm->vm_map; /* XXXRW: More locking required? */ vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -1672,6 +1683,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } } vm_map_unlock_read(map); + vmspace_free(vm); PRELE(p); free(kve, M_TEMP); return (error); From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 14:03:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDDC81065673; Fri, 12 Dec 2008 14:03:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD7588FC23; Fri, 12 Dec 2008 14:03:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCE34gD099395; Fri, 12 Dec 2008 14:03:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCE34qv099394; Fri, 12 Dec 2008 14:03:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812121403.mBCE34qv099394@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 12 Dec 2008 14:03: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: r185987 - 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, 12 Dec 2008 14:03:05 -0000 Author: kib Date: Fri Dec 12 14:03:04 2008 New Revision: 185987 URL: http://svn.freebsd.org/changeset/base/185987 Log: Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this around the call. Noted by: bde Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Dec 12 13:21:31 2008 (r185986) +++ head/sys/kern/kern_sysctl.c Fri Dec 12 14:03:04 2008 (r185987) @@ -1423,9 +1423,7 @@ userland_sysctl(struct thread *td, int * error = sysctl_root(0, name, namelen, &req); if (error != EAGAIN) break; - DROP_GIANT(); uio_yield(); - PICKUP_GIANT(); } if (req.lock == REQ_WIRED && req.validlen > 0) From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 14:57:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD09B1065675; Fri, 12 Dec 2008 14:57:25 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9818FC13; Fri, 12 Dec 2008 14:57:25 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCEvPGr000689; Fri, 12 Dec 2008 14:57:25 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCEvPZL000688; Fri, 12 Dec 2008 14:57:25 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200812121457.mBCEvPZL000688@svn.freebsd.org> From: Joseph Koshy Date: Fri, 12 Dec 2008 14:57: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: r185989 - 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: Fri, 12 Dec 2008 14:57:25 -0000 Author: jkoshy Date: Fri Dec 12 14:57:25 2008 New Revision: 185989 URL: http://svn.freebsd.org/changeset/base/185989 Log: Add a field to disambiguate between multiple threads awaiting callchain capture. Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Fri Dec 12 14:06:21 2008 (r185988) +++ head/sys/sys/pmc.h Fri Dec 12 14:57:25 2008 (r185989) @@ -814,6 +814,7 @@ struct pmc_sample { uint8_t ps_cpu; /* cpu number */ uint8_t ps_flags; /* other flags */ pid_t ps_pid; /* process PID or -1 */ + struct thread *ps_td; /* which thread */ struct pmc *ps_pmc; /* interrupting PMC */ uintptr_t *ps_pc; /* (const) callchain start */ }; From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 15:56:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 791FB1065680; Fri, 12 Dec 2008 15:56:38 +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 6922F8FC1C; Fri, 12 Dec 2008 15:56:38 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCFucD9001838; Fri, 12 Dec 2008 15:56:38 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCFucKf001837; Fri, 12 Dec 2008 15:56:38 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200812121556.mBCFucKf001837@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 12 Dec 2008 15:56: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: r185990 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 15:56:38 -0000 Author: luigi Date: Fri Dec 12 15:56:38 2008 New Revision: 185990 URL: http://svn.freebsd.org/changeset/base/185990 Log: Move the check for the ending char in the partition name where it was before -- the check is only made when getdisklabel() returns valid info. On passing, use MAXPARTITIONS to identify the max partition number, instead of the hardwired 'h' MFC after: 4 weeks Modified: head/sbin/newfs/newfs.c Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Fri Dec 12 14:57:25 2008 (r185989) +++ head/sbin/newfs/newfs.c Fri Dec 12 15:56:38 2008 (r185990) @@ -354,11 +354,6 @@ main(int argc, char *argv[]) mediasize = st.st_size; /* set fssize from the partition */ } else { - part_name = special[strlen(special) - 1]; - if ((part_name < 'a' || part_name > 'h') && !isdigit(part_name)) - errx(1, "%s: can't figure out file system partition", - special); - if (sectorsize == 0) if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) sectorsize = 0; /* back out on error for safety */ @@ -368,6 +363,12 @@ main(int argc, char *argv[]) pp = NULL; lp = getdisklabel(special); if (lp != NULL) { + if (!is_file) /* already set for files */ + part_name = special[strlen(special) - 1]; + if ((part_name < 'a' || part_name - 'a' >= MAXPARTITIONS) && + !isdigit(part_name)) + errx(1, "%s: can't figure out file system partition", + special); cp = &part_name; if (isdigit(*cp)) pp = &lp->d_partitions[RAW_PART]; From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 16:09:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 925501065672; Fri, 12 Dec 2008 16:09:34 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 816DF8FC08; Fri, 12 Dec 2008 16:09:34 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCG9YZQ002216; Fri, 12 Dec 2008 16:09:34 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCG9Ye4002214; Fri, 12 Dec 2008 16:09:34 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200812121609.mBCG9Ye4002214@svn.freebsd.org> From: Joseph Koshy Date: Fri, 12 Dec 2008 16:09: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: r185991 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 16:09:34 -0000 Author: jkoshy Date: Fri Dec 12 16:09:34 2008 New Revision: 185991 URL: http://svn.freebsd.org/changeset/base/185991 Log: Expose symbol `PMC_FN_USER_CALLCHAIN' to assembler code. Modified: head/sys/amd64/amd64/genassym.c head/sys/i386/i386/genassym.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Fri Dec 12 15:56:38 2008 (r185990) +++ head/sys/amd64/amd64/genassym.c Fri Dec 12 16:09:34 2008 (r185991) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_hwpmc_hooks.h" #include "opt_kstack_pages.h" #include @@ -44,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include #include #include @@ -216,3 +220,7 @@ ASSYM(KUC32SEL, GSEL(GUCODE32_SEL, SEL_U ASSYM(SEL_RPL_MASK, SEL_RPL_MASK); ASSYM(MSR_GSBASE, MSR_GSBASE); + +#ifdef HWPMC_HOOKS +ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN); +#endif Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Fri Dec 12 15:56:38 2008 (r185990) +++ head/sys/i386/i386/genassym.c Fri Dec 12 16:09:34 2008 (r185991) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #include "opt_compat.h" +#include "opt_hwpmc_hooks.h" #include "opt_kstack_pages.h" #include @@ -44,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include #include #include @@ -234,3 +238,7 @@ ASSYM(BUS_SPACE_HANDLE_IAT, offsetof(str ASSYM(PC_CR3, offsetof(struct pcpu, pc_cr3)); ASSYM(HYPERVISOR_VIRT_START, __HYPERVISOR_VIRT_START); #endif + +#ifdef HWPMC_HOOKS +ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN); +#endif From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 16:14:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E6231065673; Fri, 12 Dec 2008 16:14:53 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by mx1.freebsd.org (Postfix) with ESMTP id 09D808FC13; Fri, 12 Dec 2008 16:14:52 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so1460959wfg.7 for ; Fri, 12 Dec 2008 08:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=a3d5G6RTH1pVsuY4nDLc3TW/vQBzgvblAsg2U9AmT98=; b=tAWcX2C3DBigKmsTzL+Mog3Og/KyfgDZGXMVHTCgaV/dzk4a9RAEmQk6iyqiR4gc9z KDlKZV5zqGFv2FAwOWNs063Wq3wbVmAQ9XY2VJ54WMTy9RVGeUFnhojgd/hJfsoA3bvy pp1a0VbAxl1gubeRUlPtYSjFtJx9v9QfEPLD4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=LMiIgTcuOrlJRIAHIMACJvgkrLO6wxWRHk2hzTpBgRq3MSAnBJcc2c4fW6lZQ1VltF MfRzjqlD6ASo96zjoBSUPwjUgXmCmfZr0p335iwIKMZ23wmKzUayqDW/hyqmOwItOMgr iOGESapiKSsyY/fAbdhV135OBeUZCkhXIEO8o= Received: by 10.142.135.13 with SMTP id i13mr1412692wfd.217.1229098492783; Fri, 12 Dec 2008 08:14:52 -0800 (PST) Received: by 10.142.125.20 with HTTP; Fri, 12 Dec 2008 08:14:52 -0800 (PST) Message-ID: <5c0ff6a70812120814t2c184ec1jc05953a3db9ed319@mail.gmail.com> Date: Fri, 12 Dec 2008 08:14:52 -0800 From: "Paul Saab" Sender: paul.m.saab@gmail.com To: "Luigi Rizzo" In-Reply-To: <200812121556.mBCFucKf001837@svn.freebsd.org> MIME-Version: 1.0 References: <200812121556.mBCFucKf001837@svn.freebsd.org> X-Google-Sender-Auth: c4170f85f645aa02 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185990 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 16:14:53 -0000 This still will not work. zfs can have arbitrary names. On Fri, Dec 12, 2008 at 7:56 AM, Luigi Rizzo wrote: > Author: luigi > Date: Fri Dec 12 15:56:38 2008 > New Revision: 185990 > URL: http://svn.freebsd.org/changeset/base/185990 > > Log: > Move the check for the ending char in the partition name where > it was before -- the check is only made when getdisklabel() > returns valid info. > On passing, use MAXPARTITIONS to identify the max partition number, > instead of the hardwired 'h' > > MFC after: 4 weeks > > Modified: > head/sbin/newfs/newfs.c > > Modified: head/sbin/newfs/newfs.c > > ============================================================================== > --- head/sbin/newfs/newfs.c Fri Dec 12 14:57:25 2008 (r185989) > +++ head/sbin/newfs/newfs.c Fri Dec 12 15:56:38 2008 (r185990) > @@ -354,11 +354,6 @@ main(int argc, char *argv[]) > mediasize = st.st_size; > /* set fssize from the partition */ > } else { > - part_name = special[strlen(special) - 1]; > - if ((part_name < 'a' || part_name > 'h') && > !isdigit(part_name)) > - errx(1, "%s: can't figure out file system partition", > - special); > - > if (sectorsize == 0) > if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) > sectorsize = 0; /* back out on error for safety */ > @@ -368,6 +363,12 @@ main(int argc, char *argv[]) > pp = NULL; > lp = getdisklabel(special); > if (lp != NULL) { > + if (!is_file) /* already set for files */ > + part_name = special[strlen(special) - 1]; > + if ((part_name < 'a' || part_name - 'a' >= MAXPARTITIONS) > && > + !isdigit(part_name)) > + errx(1, "%s: can't figure out file system > partition", > + special); > cp = &part_name; > if (isdigit(*cp)) > pp = &lp->d_partitions[RAW_PART]; > From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 16:32:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CD41065670; Fri, 12 Dec 2008 16:32:06 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id E870F8FC0C; Fri, 12 Dec 2008 16:32:05 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 22AC673098; Fri, 12 Dec 2008 17:37:11 +0100 (CET) Date: Fri, 12 Dec 2008 17:37:11 +0100 From: Luigi Rizzo To: Paul Saab Message-ID: <20081212163711.GB18908@onelab2.iet.unipi.it> References: <200812121556.mBCFucKf001837@svn.freebsd.org> <5c0ff6a70812120814t2c184ec1jc05953a3db9ed319@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c0ff6a70812120814t2c184ec1jc05953a3db9ed319@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r185990 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 16:32:06 -0000 On Fri, Dec 12, 2008 at 08:14:52AM -0800, Paul Saab wrote: > This still will not work. zfs can have arbitrary names. So let me understand: this part of the code now is exactly as it was two weeks ago, before i touched it. So, are you (and Peter) addressing a pre-existing bug, or could you explain me what is broken now ? Also, are you actually seeing the bug when you run the program, or you just think there might be one ? cheers luigi > On Fri, Dec 12, 2008 at 7:56 AM, Luigi Rizzo wrote: > > > Author: luigi > > Date: Fri Dec 12 15:56:38 2008 > > New Revision: 185990 > > URL: http://svn.freebsd.org/changeset/base/185990 > > > > Log: > > Move the check for the ending char in the partition name where > > it was before -- the check is only made when getdisklabel() > > returns valid info. > > On passing, use MAXPARTITIONS to identify the max partition number, > > instead of the hardwired 'h' > > > > MFC after: 4 weeks > > > > Modified: > > head/sbin/newfs/newfs.c > > > > Modified: head/sbin/newfs/newfs.c > > > > ============================================================================== > > --- head/sbin/newfs/newfs.c Fri Dec 12 14:57:25 2008 (r185989) > > +++ head/sbin/newfs/newfs.c Fri Dec 12 15:56:38 2008 (r185990) > > @@ -354,11 +354,6 @@ main(int argc, char *argv[]) > > mediasize = st.st_size; > > /* set fssize from the partition */ > > } else { > > - part_name = special[strlen(special) - 1]; > > - if ((part_name < 'a' || part_name > 'h') && > > !isdigit(part_name)) > > - errx(1, "%s: can't figure out file system partition", > > - special); > > - > > if (sectorsize == 0) > > if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) > > sectorsize = 0; /* back out on error for safety */ > > @@ -368,6 +363,12 @@ main(int argc, char *argv[]) > > pp = NULL; > > lp = getdisklabel(special); > > if (lp != NULL) { > > + if (!is_file) /* already set for files */ > > + part_name = special[strlen(special) - 1]; > > + if ((part_name < 'a' || part_name - 'a' >= MAXPARTITIONS) > > && > > + !isdigit(part_name)) > > + errx(1, "%s: can't figure out file system > > partition", > > + special); > > cp = &part_name; > > if (isdigit(*cp)) > > pp = &lp->d_partitions[RAW_PART]; > > From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 16:41:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06471065670; Fri, 12 Dec 2008 16:41:12 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0A58FC12; Fri, 12 Dec 2008 16:41:12 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCGfCKe003074; Fri, 12 Dec 2008 16:41:12 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCGfC82003073; Fri, 12 Dec 2008 16:41:12 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200812121641.mBCGfC82003073@svn.freebsd.org> From: Doug Ambrisko Date: Fri, 12 Dec 2008 16:41: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: r185994 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 16:41:12 -0000 Author: ambrisko Date: Fri Dec 12 16:41:12 2008 New Revision: 185994 URL: http://svn.freebsd.org/changeset/base/185994 Log: Add in some more device ID's and a generic catch-all. Submitted by: LSI Modified: head/sys/dev/mfi/mfi_pci.c Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Fri Dec 12 16:37:15 2008 (r185993) +++ head/sys/dev/mfi/mfi_pci.c Fri Dec 12 16:41:12 2008 (r185994) @@ -123,6 +123,9 @@ struct mfi_ident { {0x1000, 0x0079, 0x1028, 0x1f16, MFI_FLAGS_GEN2, "Dell PERC H700 Adapter"}, {0x1000, 0x0079, 0x1028, 0x1f17, MFI_FLAGS_GEN2, "Dell PERC H700 Integrated"}, {0x1000, 0x0079, 0x1028, 0x1f18, MFI_FLAGS_GEN2, "Dell PERC H700 Modular"}, + {0x1000, 0x0079, 0x1028, 0x1f19, MFI_FLAGS_GEN2, "Dell PERC H700"}, + {0x1000, 0x0079, 0x1028, 0x1f1b, MFI_FLAGS_GEN2, "Dell PERC H800"}, + {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "Dell PERC H700/800"}, {0x1000, 0x0078, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, {0x1000, 0x007c, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 17:34:38 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id DCD7E106575A; Fri, 12 Dec 2008 17:34:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Fri, 12 Dec 2008 12:34:24 -0500 User-Agent: KMail/1.6.2 References: <200812121641.mBCGfC82003073@svn.freebsd.org> In-Reply-To: <200812121641.mBCGfC82003073@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200812121234.26683.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, Doug Ambrisko , svn-src-all@FreeBSD.org Subject: Re: svn commit: r185994 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 17:34:38 -0000 On Friday 12 December 2008 11:41 am, Doug Ambrisko wrote: > Author: ambrisko > Date: Fri Dec 12 16:41:12 2008 > New Revision: 185994 > URL: http://svn.freebsd.org/changeset/base/185994 > > Log: > Add in some more device ID's and a generic catch-all. > > Submitted by: LSI > > Modified: > head/sys/dev/mfi/mfi_pci.c > > Modified: head/sys/dev/mfi/mfi_pci.c The catch-all entry is redundant: {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 17:37:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675C3106564A; Fri, 12 Dec 2008 17:37:56 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43]) by mx1.freebsd.org (Postfix) with ESMTP id 336368FC08; Fri, 12 Dec 2008 17:37:56 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 12 Dec 2008 09:38:14 -0800 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.14.1/8.14.1) with ESMTP id mBCHbt9Z041711; Fri, 12 Dec 2008 09:37:55 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.1/8.14.1/Submit) id mBCHbtAU041710; Fri, 12 Dec 2008 09:37:55 -0800 (PST) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200812121737.mBCHbtAU041710@ambrisko.com> In-Reply-To: <200812121234.26683.jkim@FreeBSD.org> To: Jung-uk Kim Date: Fri, 12 Dec 2008 09:37:55 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Cc: svn-src-head@FreeBSD.org, Doug Ambrisko , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r185994 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 17:37:56 -0000 Jung-uk Kim writes: | On Friday 12 December 2008 11:41 am, Doug Ambrisko wrote: | > Author: ambrisko | > Date: Fri Dec 12 16:41:12 2008 | > New Revision: 185994 | > URL: http://svn.freebsd.org/changeset/base/185994 | > | > Log: | > Add in some more device ID's and a generic catch-all. | > | > Submitted by: LSI | > | > Modified: | > head/sys/dev/mfi/mfi_pci.c | > | > Modified: head/sys/dev/mfi/mfi_pci.c | | The catch-all entry is redundant: | | {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, Missed that. I'll fix that and re-sort. I missed it since it was out of order. Thanks, Doug A. From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 18:17:23 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84D9F1065675; Fri, 12 Dec 2008 18:17:23 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7242B8FC19; Fri, 12 Dec 2008 18:17:23 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCIHNUb005232; Fri, 12 Dec 2008 18:17:23 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCIHNHd005230; Fri, 12 Dec 2008 18:17:23 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200812121817.mBCIHNHd005230@svn.freebsd.org> From: Sean Bruno Date: Fri, 12 Dec 2008 18:17: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: r185996 - head/usr.sbin/fwcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 18:17:23 -0000 Author: sbruno Date: Fri Dec 12 18:17:23 2008 New Revision: 185996 URL: http://svn.freebsd.org/changeset/base/185996 Log: Reviewed by: (Dieter)freebsd@sopwith.solgatos.com Approved by: slong scottl@samsco.org MFC after: 2 weeks Final cleanup of fwcontrol. NetBSD compatibility Cleanup errors in usage() display Finish up error handling via errx/warnx Generate error on unparsed command line syntax Change device(devbase) to open into the form /dev/fwX.X Modified: head/usr.sbin/fwcontrol/fwcontrol.c head/usr.sbin/fwcontrol/fwmpegts.c Modified: head/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- head/usr.sbin/fwcontrol/fwcontrol.c Fri Dec 12 16:52:33 2008 (r185995) +++ head/usr.sbin/fwcontrol/fwcontrol.c Fri Dec 12 18:17:23 2008 (r185996) @@ -32,8 +32,10 @@ * SUCH DAMAGE. */ +#if defined(__FreeBSD__) #include __FBSDID("$FreeBSD$"); +#endif #include #include @@ -42,11 +44,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(__FreeBSD__) #include #include #include #include #include +#elif defined(__NetBSD__) +#include "eui64.h" +#include +#include +#include +#include +#else +#warning "You need to add support for your OS" +#endif + #include #include @@ -66,7 +79,7 @@ static void usage(void) { fprintf(stderr, - "fwcontrol [-u bus_num] [-prt] [-c node] [-d node] [-o node] [-s node]\n" + "%s [-u bus_num] [-prt] [-c node] [-d node] [-o node] [-s node]\n" "\t [-l file] [-g gap_count] [-f force_root ] [-b pri_req]\n" "\t [-M mode] [-R filename] [-S filename] [-m EUI64 | hostname]\n" "\t-u: specify bus number\n" @@ -78,14 +91,15 @@ usage(void) "\t-o: send link-on packet to the node\n" "\t-s: write RESET_START register on the node\n" "\t-l: load and parse hex dump file of configuration ROM\n" - "\t-g: broadcast gap_count by phy_config packet\n" - "\t-f: broadcast force_root by phy_config packet\n" + "\t-g: set gap count\n" + "\t-f: force root node\n" "\t-b: set PRIORITY_BUDGET register on all supported nodes\n" "\t-M: specify dv or mpeg\n" "\t-R: Receive DV or MPEG TS stream\n" "\t-S: Send DV stream\n" - "\t-m: set fwmem target\n"); - exit(EX_USAGE); + "\t-m: set fwmem target\n" + , getprogname() ); + fprintf(stderr, "\n"); } static void @@ -488,7 +502,7 @@ load_crom(char *filename, u_int32_t *p) int len=1024, i; if ((file = fopen(filename, "r")) == NULL) - err(1, "load_crom"); + err(1, "load_crom %s", filename); for (i = 0; i < len/(4*8); i ++) { fscanf(file, DUMP_FORMAT, p, p+1, p+2, p+3, p+4, p+5, p+6, p+7); @@ -691,7 +705,7 @@ detect_recv_fn(int fd, char ich) */ len = read(fd, buf, RECV_NUM_PACKET * RECV_PACKET_SZ); if (len < 0) - err(EX_IOERR, "%s: error reading from device\n", __func__); + err(EX_IOERR, "%s: error reading from device", __func__); ptr = (u_int32_t *) buf; ciph = (struct ciphdr *)(ptr + 1); @@ -757,10 +771,12 @@ main(int argc, char **argv) if (argc < 2) { for (current_board = 0; current_board < MAX_BOARDS; current_board++) { - snprintf(devbase, sizeof(devbase), "%s%d", device_string, current_board); + snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); if (open_dev(&fd, devbase) < 0) { if (current_board == 0) { usage(); + err(EX_IOERR, "%s: Error opening firewire controller #%d %s", + __func__, current_board, devbase); } return(EIO); } @@ -777,7 +793,7 @@ main(int argc, char **argv) case 'b': priority_budget = strtol(optarg, NULL, 0); if (priority_budget < 0 || priority_budget > INT32_MAX) - errx(EX_USAGE, "%s: invalid number: %s", __func__, optarg); + errx(EX_USAGE, "%s: priority_budget out of range: %s", __func__, optarg); command_set = true; open_needed = true; display_board_only = false; @@ -787,7 +803,7 @@ main(int argc, char **argv) if (crom_string == NULL) err(EX_SOFTWARE, "%s:crom_string malloc", __func__); if ( (strtol(crom_string, NULL, 0) < 0) || strtol(crom_string, NULL, 0) > MAX_BOARDS) - err(EX_USAGE, "%s:Invalid value for node", __func__); + errx(EX_USAGE, "%s:Invalid value for node", __func__); strcpy(crom_string, optarg); display_crom = 1; open_needed = true; @@ -808,7 +824,7 @@ main(int argc, char **argv) #define MAX_PHY_CONFIG 0x3f set_root_node = strtol(optarg, NULL, 0); if ( (set_root_node < 0) || (set_root_node > MAX_PHY_CONFIG) ) - err(EX_USAGE, "%s:set_root_node out of range", __func__); + errx(EX_USAGE, "%s:set_root_node out of range", __func__); open_needed = true; command_set = true; display_board_only = false; @@ -816,7 +832,7 @@ main(int argc, char **argv) case 'g': set_gap_count = strtol(optarg, NULL, 0); if ( (set_gap_count < 0) || (set_gap_count > MAX_PHY_CONFIG) ) - err(EX_USAGE, "%s:set_gap_count out of range", __func__); + errx(EX_USAGE, "%s:set_gap_count out of range", __func__); open_needed = true; command_set = true; display_board_only = false; @@ -834,12 +850,12 @@ main(int argc, char **argv) display_board_only = false; if (eui64_hostton(optarg, &target) != 0 && eui64_aton(optarg, &target) != 0) - err(EX_USAGE, "%s: invalid target: %s", __func__, optarg); + errx(EX_USAGE, "%s: invalid target: %s", __func__, optarg); break; case 'o': send_link_on = str2node(fd, optarg); - if ( (send_link_on < 0) || (send_link_on > INT32_MAX) ) - err(EX_USAGE, "%s: node out of range: %s\n",__func__, optarg); + if ( (send_link_on < 0) || (send_link_on > MAX_PHY_CONFIG) ) + errx(EX_USAGE, "%s: node out of range: %s\n",__func__, optarg); open_needed = true; command_set = true; display_board_only = false; @@ -858,8 +874,8 @@ main(int argc, char **argv) break; case 's': send_reset_start = str2node(fd, optarg); - if ( (send_reset_start < 0) || (send_reset_start > INT32_MAX) ) - err(EX_USAGE, "%s: node out of range: %s\n", __func__, optarg); + if ( (send_reset_start < 0) || (send_reset_start > MAX_PHY_CONFIG) ) + errx(EX_USAGE, "%s: node out of range: %s\n", __func__, optarg); open_needed = true; command_set = true; display_board_only = false; @@ -909,13 +925,27 @@ main(int argc, char **argv) command_set = true; display_board_only = false; break; + case '?': default: usage(); + warnc(EINVAL, "%s: Unknown command line arguments", __func__); return 0; } } /* end while */ /* + * Catch the error case when the user + * executes the command with non ''-'' + * delimited arguments. + * Generate the usage() display and exit. + */ + if (!command_set && !display_board_only) { + usage(); + warnc(EINVAL, "%s: Unknown command line arguments", __func__); + return 0; + } + + /* * If -u is passed, execute * command for that card only. * @@ -924,9 +954,9 @@ main(int argc, char **argv) * */ if(open_needed){ - snprintf(devbase, sizeof(devbase), "%s%d", device_string, current_board); + snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); if (open_dev(&fd, devbase) < 0) { - errx(EX_IOERR, "%s: Error opening board #%d\n", __func__, current_board); + err(EX_IOERR, "%s: Error opening firewire controller #%d %s", __func__, current_board, devbase); } } /* @@ -947,7 +977,7 @@ main(int argc, char **argv) */ if (send_bus_reset) { if(ioctl(fd, FW_IBUSRST, &tmp) < 0) - err(EX_IOERR, "%s: ioctl", __func__); + err(EX_IOERR, "%s: Ioctl of bus reset failed for %s", __func__, devbase); } /* * Print out the CROM for this node "-c" @@ -996,8 +1026,16 @@ main(int argc, char **argv) if (set_fwmem_target) { eui.hi = ntohl(*(u_int32_t*)&(target.octet[0])); eui.lo = ntohl(*(u_int32_t*)&(target.octet[4])); +#if defined(__FreeBSD__) sysctl_set_int("hw.firewire.fwmem.eui64_hi", eui.hi); sysctl_set_int("hw.firewire.fwmem.eui64_lo", eui.lo); +#elif defined(__NetBSD__) + sysctl_set_int("hw.fwmem.eui64_hi", eui.hi); + sysctl_set_int("hw.fwmem.eui64_lo", eui.lo); +#else +#warning "You need to add support for your OS" +#endif + } /* @@ -1028,9 +1066,9 @@ main(int argc, char **argv) recvfn = detect_recv_fn(fd, TAG | CHANNEL); close(fd); } - snprintf(devbase, sizeof(devbase), "%s%d", device_string, current_board); + snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); if (open_dev(&fd, devbase) < 0) - errx(EX_IOERR, "%s: Error opening board #%d in recv_data\n", __func__, current_board); + err(EX_IOERR, "%s: Error opening firewire controller #%d %s in recv_data\n", __func__, current_board, devbase); (*recvfn)(fd, recv_data, TAG | CHANNEL, -1); free(recv_data); } Modified: head/usr.sbin/fwcontrol/fwmpegts.c ============================================================================== --- head/usr.sbin/fwcontrol/fwmpegts.c Fri Dec 12 16:52:33 2008 (r185995) +++ head/usr.sbin/fwcontrol/fwmpegts.c Fri Dec 12 18:17:23 2008 (r185996) @@ -52,8 +52,16 @@ #include #include +#if defined(__FreeBSD__) #include #include +#elif defined(__NetBSD__) +#include +#include +#else +#warning "You need to add support for your OS" +#endif + #include "fwmethods.h" From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 18:26:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C39561065676; Fri, 12 Dec 2008 18:26:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2DE18FC08; Fri, 12 Dec 2008 18:26:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCIQ8iN005474; Fri, 12 Dec 2008 18:26:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCIQ811005473; Fri, 12 Dec 2008 18:26:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812121826.mBCIQ811005473@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Dec 2008 18:26: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: r185997 - head/sys/dev/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: Fri, 12 Dec 2008 18:26:08 -0000 Author: thompsa Date: Fri Dec 12 18:26:08 2008 New Revision: 185997 URL: http://svn.freebsd.org/changeset/base/185997 Log: Use correct AIPTEK2 name for vendor 0x04fc, now that the PENCAM_MEGA_1_3 product is paired with it. Obtained from: NetBSD Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Dec 12 18:17:23 2008 (r185996) +++ head/sys/dev/usb/usbdevs Fri Dec 12 18:26:08 2008 (r185997) @@ -205,7 +205,7 @@ vendor ELAN 0x04f3 Elan vendor NEWNEX 0x04f7 Newnex vendor BROTHER 0x04f9 Brother Industries vendor DALLAS 0x04fa Dallas Semiconductor -vendor SUNPLUS 0x04fc Sunplus +vendor AIPTEK2 0x04fc AIPTEK International vendor PFU 0x04fe PFU vendor FUJIKURA 0x0501 Fujikura/DDK vendor ACER 0x0502 Acer From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 18:34:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED5AA1065746; Fri, 12 Dec 2008 18:34:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC8368FC1E; Fri, 12 Dec 2008 18:34:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCIYRrK005684; Fri, 12 Dec 2008 18:34:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCIYR0j005683; Fri, 12 Dec 2008 18:34:27 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812121834.mBCIYR0j005683@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Dec 2008 18: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: r185998 - head/sys/dev/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: Fri, 12 Dec 2008 18:34:28 -0000 Author: thompsa Date: Fri Dec 12 18:34:27 2008 New Revision: 185998 URL: http://svn.freebsd.org/changeset/base/185998 Log: The TWINKLECAM entry is under CHICONY2, remove MICRODIA. Obtained from: NetBSD Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Dec 12 18:26:08 2008 (r185997) +++ head/sys/dev/usb/usbdevs Fri Dec 12 18:34:27 2008 (r185998) @@ -503,7 +503,7 @@ vendor ADDONICS2 0x0bf6 Addonics Technol vendor FSC 0x0bf8 Fujitsu Siemens Computers vendor AGATE 0x0c08 Agate Technologies vendor DMI 0x0c0b DMI -vendor MICRODIA 0x0c45 Chicony +vendor CHICONY2 0x0c45 Chicony vendor SEALEVEL 0x0c52 Sealevel System vendor LUWEN 0x0c76 Luwen vendor KYOCERA2 0x0c88 Kyocera Wireless Corp. @@ -1688,9 +1688,6 @@ product MSI RT2573_2 0x6877 RT2573 product MSI RT2573_3 0xa861 RT2573 product MSI RT2573_4 0xa874 RT2573 -/* Microdia products */ -product MICRODIA TWINKLECAM 0x600d TwinkleCam USB camera - /* Microsoft products */ product MICROSOFT SIDEPREC 0x0008 SideWinder Precision Pro product MICROSOFT INTELLIMOUSE 0x0009 IntelliMouse From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 20:29:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE72D10656F4; Fri, 12 Dec 2008 20:29:34 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF9F8FC1A; Fri, 12 Dec 2008 20:29:34 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCKTYYs007882; Fri, 12 Dec 2008 20:29:34 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCKTYUm007881; Fri, 12 Dec 2008 20:29:34 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200812122029.mBCKTYUm007881@svn.freebsd.org> From: Doug Ambrisko Date: Fri, 12 Dec 2008 20:29: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: r185999 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 12 Dec 2008 20:29:34 -0000 Author: ambrisko Date: Fri Dec 12 20:29:34 2008 New Revision: 185999 URL: http://svn.freebsd.org/changeset/base/185999 Log: Sort the PCI device's and make the catch-all for new Dell cards only apply to Dell. This gets rid of the duplicate catch-all that I introduced that jkim caught. Prompted by: jkim Reviewed by: jkim Modified: head/sys/dev/mfi/mfi_pci.c Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Fri Dec 12 18:34:27 2008 (r185998) +++ head/sys/dev/mfi/mfi_pci.c Fri Dec 12 20:29:34 2008 (r185999) @@ -114,21 +114,21 @@ struct mfi_ident { int flags; const char *desc; } mfi_identifiers[] = { - {0x1000, 0x0411, 0xffff, 0xffff, MFI_FLAGS_1064R, "LSI MegaSAS 1064R"}, /* Brocton IOP */ - {0x1000, 0x0413, 0xffff, 0xffff, MFI_FLAGS_1064R, "LSI MegaSAS 1064R"}, /* Verde ZCR */ - {0x1028, 0x0015, 0xffff, 0xffff, MFI_FLAGS_1064R, "Dell PERC 5/i"}, {0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"}, - {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, + {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, + {0x1000, 0x0078, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, {0x1000, 0x0079, 0x1028, 0x1f15, MFI_FLAGS_GEN2, "Dell PERC H800 Adapter"}, {0x1000, 0x0079, 0x1028, 0x1f16, MFI_FLAGS_GEN2, "Dell PERC H700 Adapter"}, {0x1000, 0x0079, 0x1028, 0x1f17, MFI_FLAGS_GEN2, "Dell PERC H700 Integrated"}, {0x1000, 0x0079, 0x1028, 0x1f18, MFI_FLAGS_GEN2, "Dell PERC H700 Modular"}, {0x1000, 0x0079, 0x1028, 0x1f19, MFI_FLAGS_GEN2, "Dell PERC H700"}, {0x1000, 0x0079, 0x1028, 0x1f1b, MFI_FLAGS_GEN2, "Dell PERC H800"}, - {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "Dell PERC H700/800"}, - {0x1000, 0x0078, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, + {0x1000, 0x0079, 0x1028, 0xffff, MFI_FLAGS_GEN2, "Dell PERC H700/H800"}, {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, {0x1000, 0x007c, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, + {0x1000, 0x0411, 0xffff, 0xffff, MFI_FLAGS_1064R, "LSI MegaSAS 1064R"}, /* Brocton IOP */ + {0x1000, 0x0413, 0xffff, 0xffff, MFI_FLAGS_1064R, "LSI MegaSAS 1064R"}, /* Verde ZCR */ + {0x1028, 0x0015, 0xffff, 0xffff, MFI_FLAGS_1064R, "Dell PERC 5/i"}, {0, 0, 0, 0, 0, NULL} }; From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 21:57:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05681106564A; Fri, 12 Dec 2008 21:57:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E94BA8FC1A; Fri, 12 Dec 2008 21:57:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCLvGC3009572; Fri, 12 Dec 2008 21:57:16 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCLvGRP009570; Fri, 12 Dec 2008 21:57:16 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812122157.mBCLvGRP009570@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Dec 2008 21:57: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: r186001 - head/sys/dev/usb2/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, 12 Dec 2008 21:57:17 -0000 Author: thompsa Date: Fri Dec 12 21:57:16 2008 New Revision: 186001 URL: http://svn.freebsd.org/changeset/base/186001 Log: It seems usb2 needs the devtable regenerated after editing usbdevs. Modified: head/sys/dev/usb2/include/usb2_devid.h head/sys/dev/usb2/include/usb2_devtable.h Modified: head/sys/dev/usb2/include/usb2_devid.h ============================================================================== --- head/sys/dev/usb2/include/usb2_devid.h Fri Dec 12 21:45:10 2008 (r186000) +++ head/sys/dev/usb2/include/usb2_devid.h Fri Dec 12 21:57:16 2008 (r186001) @@ -4,7 +4,7 @@ * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/usb/usbdevs,v 1.383 2008/11/12 13:58:59 keramida Exp + * FreeBSD: head/sys/dev/usb/usbdevs 185998 2008-12-12 18:34:27Z thompsa */ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ @@ -212,7 +212,7 @@ #define USB_VENDOR_NEWNEX 0x04f7 /* Newnex */ #define USB_VENDOR_BROTHER 0x04f9 /* Brother Industries */ #define USB_VENDOR_DALLAS 0x04fa /* Dallas Semiconductor */ -#define USB_VENDOR_SUNPLUS 0x04fc /* Sunplus */ +#define USB_VENDOR_AIPTEK2 0x04fc /* AIPTEK International */ #define USB_VENDOR_PFU 0x04fe /* PFU */ #define USB_VENDOR_FUJIKURA 0x0501 /* Fujikura/DDK */ #define USB_VENDOR_ACER 0x0502 /* Acer */ @@ -510,7 +510,7 @@ #define USB_VENDOR_FSC 0x0bf8 /* Fujitsu Siemens Computers */ #define USB_VENDOR_AGATE 0x0c08 /* Agate Technologies */ #define USB_VENDOR_DMI 0x0c0b /* DMI */ -#define USB_VENDOR_MICRODIA 0x0c45 /* Chicony */ +#define USB_VENDOR_CHICONY2 0x0c45 /* Chicony */ #define USB_VENDOR_SEALEVEL 0x0c52 /* Sealevel System */ #define USB_VENDOR_LUWEN 0x0c76 /* Luwen */ #define USB_VENDOR_KYOCERA2 0x0c88 /* Kyocera Wireless Corp. */ @@ -627,6 +627,7 @@ #define USB_VENDOR_QCOM 0x18e8 /* Qcom */ #define USB_VENDOR_LINKSYS3 0x1915 /* Linksys */ #define USB_VENDOR_QUALCOMMINC 0x19d2 /* Qualcomm, Incorporated */ +#define USB_VENDOR_STELERA 0x1a8d /* Stelera Wireless */ #define USB_VENDOR_DLINK 0x2001 /* D-Link */ #define USB_VENDOR_PLANEX2 0x2019 /* Planex Communications */ #define USB_VENDOR_ERICSSON 0x2282 /* Ericsson */ @@ -802,7 +803,7 @@ /* AIPTEK products */ #define USB_PRODUCT_AIPTEK_POCKETCAM3M 0x2011 /* PocketCAM 3Mega */ -#define USB_PRODUCT_SUNPLUS_PENCAM_MEGA_1_3 0x504a /* PenCam Mega 1.3 */ +#define USB_PRODUCT_AIPTEK2_PENCAM_MEGA_1_3 0x504a /* PenCam Mega 1.3 */ /* AirPrime products */ #define USB_PRODUCT_AIRPRIME_PC5220 0x0112 /* CDMA Wireless PC Card */ @@ -1014,7 +1015,7 @@ /* Chicony products */ #define USB_PRODUCT_CHICONY_KB8933 0x0001 /* KB-8933 keyboard */ -#define USB_PRODUCT_MICRODIA_TWINKLECAM 0x600d /* TwinkleCam USB camera */ +#define USB_PRODUCT_CHICONY2_TWINKLECAM 0x600d /* TwinkleCam USB camera */ /* CH Products */ #define USB_PRODUCT_CHPRODUCTS_PROTHROTTLE 0x00f1 /* Pro Throttle */ @@ -1436,6 +1437,7 @@ #define USB_PRODUCT_HP_OJ4215 0x3d11 /* OfficeJet 4215 */ #define USB_PRODUCT_HP_HN210E 0x811c /* Ethernet HN210E */ #define USB_PRODUCT_HP2_C500 0x6002 /* PhotoSmart C500 */ +#define USB_PRODUCT_HP_HS2300 0x1e1d /* hs2300 HSDPA (aka MC8775) */ /* HTC products */ #define USB_PRODUCT_HTC_WINMOBILE 0x00ce /* HTC USB Sync */ @@ -1693,9 +1695,6 @@ #define USB_PRODUCT_MSI_RT2573_3 0xa861 /* RT2573 */ #define USB_PRODUCT_MSI_RT2573_4 0xa874 /* RT2573 */ -/* Microdia products */ -#define USB_PRODUCT_MICRODIA_TWINKLECAM 0x600d /* TwinkleCam USB camera */ - /* Microsoft products */ #define USB_PRODUCT_MICROSOFT_SIDEPREC 0x0008 /* SideWinder Precision Pro */ #define USB_PRODUCT_MICROSOFT_INTELLIMOUSE 0x0009 /* IntelliMouse */ @@ -1882,6 +1881,7 @@ #define USB_PRODUCT_OPTION_GT3G 0x6000 /* GlobeTrotter 3G datacard */ #define USB_PRODUCT_OPTION_GT3GQUAD 0x6300 /* GlobeTrotter 3G QUAD datacard */ #define USB_PRODUCT_OPTION_GT3GPLUS 0x6600 /* GlobeTrotter 3G+ datacard */ +#define USB_PRODUCT_OPTION_GTICON322 0xd033 /* GlobeTrotter Icon322 storage */ #define USB_PRODUCT_OPTION_GTMAX36 0x6701 /* GlobeTrotter Max 3.6 Modem */ #define USB_PRODUCT_OPTION_GTMAXHSUPA 0x7001 /* GlobeTrotter HSUPA */ @@ -2131,12 +2131,14 @@ #define USB_PRODUCT_SIERRA_AC595U 0x0120 /* Sierra Wireless AirCard 595U */ #define USB_PRODUCT_SIERRA_AC597E 0x0021 /* Sierra Wireless AirCard 597E */ #define USB_PRODUCT_SIERRA_C597 0x0023 /* Sierra Wireless Compass 597 */ +#define USB_PRODUCT_SIERRA_AC875 0x6820 /* Sierra Wireless AirCard 875 */ #define USB_PRODUCT_SIERRA_AC880 0x6850 /* Sierra Wireless AirCard 880 */ #define USB_PRODUCT_SIERRA_AC881 0x6851 /* Sierra Wireless AirCard 881 */ #define USB_PRODUCT_SIERRA_AC880E 0x6852 /* Sierra Wireless AirCard 880E */ #define USB_PRODUCT_SIERRA_AC881E 0x6853 /* Sierra Wireless AirCard 881E */ #define USB_PRODUCT_SIERRA_AC880U 0x6855 /* Sierra Wireless AirCard 880U */ #define USB_PRODUCT_SIERRA_AC881U 0x6856 /* Sierra Wireless AirCard 881U */ +#define USB_PRODUCT_SIERRA_AC885U 0x6880 /* Sierra Wireless AirCard 885U */ #define USB_PRODUCT_SIERRA_EM5625 0x0017 /* EM5625 */ #define USB_PRODUCT_SIERRA_MC5720 0x0218 /* MC5720 Wireless Modem */ #define USB_PRODUCT_SIERRA_MC5720_2 0x0018 /* MC5720 */ @@ -2259,6 +2261,10 @@ /* Sphairon Access Systems GmbH products */ #define USB_PRODUCT_SPHAIRON_UB801R 0x0110 /* UB801R */ +/* Stelera Wireless products */ +#define USB_PRODUCT_STELERA_ZEROCD 0x1000 /* Zerocd Installer */ +#define USB_PRODUCT_STELERA_C105 0x1002 /* Stelera/Bandrish C105 USB */ + /* STMicroelectronics products */ #define USB_PRODUCT_STMICRO_BIOCPU 0x2016 /* Biometric Coprocessor */ #define USB_PRODUCT_STMICRO_COMMUNICATOR 0x7554 /* USB Communicator */ Modified: head/sys/dev/usb2/include/usb2_devtable.h ============================================================================== --- head/sys/dev/usb2/include/usb2_devtable.h Fri Dec 12 21:45:10 2008 (r186000) +++ head/sys/dev/usb2/include/usb2_devtable.h Fri Dec 12 21:57:16 2008 (r186001) @@ -4,7 +4,7 @@ * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/usb/usbdevs,v 1.383 2008/11/12 13:58:59 keramida Exp + * FreeBSD: head/sys/dev/usb/usbdevs 185998 2008-12-12 18:34:27Z thompsa */ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ @@ -599,9 +599,9 @@ const struct usb_knowndev usb_knowndevs[ "PocketCAM 3Mega", }, { - USB_VENDOR_SUNPLUS, USB_PRODUCT_SUNPLUS_PENCAM_MEGA_1_3, + USB_VENDOR_AIPTEK2, USB_PRODUCT_AIPTEK2_PENCAM_MEGA_1_3, 0, - "Sunplus", + "AIPTEK International", "PenCam Mega 1.3", }, { @@ -1397,7 +1397,7 @@ const struct usb_knowndev usb_knowndevs[ "KB-8933 keyboard", }, { - USB_VENDOR_MICRODIA, USB_PRODUCT_MICRODIA_TWINKLECAM, + USB_VENDOR_CHICONY2, USB_PRODUCT_CHICONY2_TWINKLECAM, 0, "Chicony", "TwinkleCam USB camera", @@ -3125,6 +3125,12 @@ const struct usb_knowndev usb_knowndevs[ "PhotoSmart C500", }, { + USB_VENDOR_HP, USB_PRODUCT_HP_HS2300, + 0, + "Hewlett Packard", + "hs2300 HSDPA (aka MC8775)", + }, + { USB_VENDOR_HTC, USB_PRODUCT_HTC_WINMOBILE, 0, "HTC", @@ -4145,12 +4151,6 @@ const struct usb_knowndev usb_knowndevs[ "RT2573", }, { - USB_VENDOR_MICRODIA, USB_PRODUCT_MICRODIA_TWINKLECAM, - 0, - "Chicony", - "TwinkleCam USB camera", - }, - { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_SIDEPREC, 0, "Microsoft", @@ -4925,6 +4925,12 @@ const struct usb_knowndev usb_knowndevs[ "GlobeTrotter 3G+ datacard", }, { + USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTICON322, + 0, + "Option N.V:", + "GlobeTrotter Icon322 storage", + }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36, 0, "Option N.V:", @@ -5921,6 +5927,12 @@ const struct usb_knowndev usb_knowndevs[ "Sierra Wireless Compass 597", }, { + USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875, + 0, + "Sierra Wireless", + "Sierra Wireless AirCard 875", + }, + { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880, 0, "Sierra Wireless", @@ -5957,6 +5969,12 @@ const struct usb_knowndev usb_knowndevs[ "Sierra Wireless AirCard 881U", }, { + USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC885U, + 0, + "Sierra Wireless", + "Sierra Wireless AirCard 885U", + }, + { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_EM5625, 0, "Sierra Wireless", @@ -6461,6 +6479,18 @@ const struct usb_knowndev usb_knowndevs[ "UB801R", }, { + USB_VENDOR_STELERA, USB_PRODUCT_STELERA_ZEROCD, + 0, + "Stelera Wireless", + "Zerocd Installer", + }, + { + USB_VENDOR_STELERA, USB_PRODUCT_STELERA_C105, + 0, + "Stelera Wireless", + "Stelera/Bandrish C105 USB", + }, + { USB_VENDOR_STMICRO, USB_PRODUCT_STMICRO_BIOCPU, 0, "STMicroelectronics", @@ -8099,9 +8129,9 @@ const struct usb_knowndev usb_knowndevs[ NULL, }, { - USB_VENDOR_SUNPLUS, 0, + USB_VENDOR_AIPTEK2, 0, USB_KNOWNDEV_NOPROD, - "Sunplus", + "AIPTEK International", NULL, }, { @@ -9887,7 +9917,7 @@ const struct usb_knowndev usb_knowndevs[ NULL, }, { - USB_VENDOR_MICRODIA, 0, + USB_VENDOR_CHICONY2, 0, USB_KNOWNDEV_NOPROD, "Chicony", NULL, @@ -10589,6 +10619,12 @@ const struct usb_knowndev usb_knowndevs[ NULL, }, { + USB_VENDOR_STELERA, 0, + USB_KNOWNDEV_NOPROD, + "Stelera Wireless", + NULL, + }, + { USB_VENDOR_DLINK, 0, USB_KNOWNDEV_NOPROD, "D-Link", From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 23:17:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A143D106564A; Fri, 12 Dec 2008 23:17:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9145A8FC26; Fri, 12 Dec 2008 23:17:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCNH0nc011387; Fri, 12 Dec 2008 23:17:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCNH0M7011383; Fri, 12 Dec 2008 23:17:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200812122317.mBCNH0M7011383@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 12 Dec 2008 23:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186009 - in head/sys: amd64/amd64 amd64/include i386/i386 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: Fri, 12 Dec 2008 23:17:00 -0000 Author: jkim Date: Fri Dec 12 23:17:00 2008 New Revision: 186009 URL: http://svn.freebsd.org/changeset/base/186009 Log: Add more CPUID bits from AMD CPUID Specification Rev. 2.28. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/include/specialreg.h head/sys/i386/i386/identcpu.c head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Fri Dec 12 23:13:40 2008 (r186008) +++ head/sys/amd64/amd64/identcpu.c Fri Dec 12 23:17:00 2008 (r186009) @@ -322,15 +322,15 @@ printcpuinfo(void) "\003SVM" /* Secure Virtual Mode */ "\004ExtAPIC" /* Extended APIC register */ "\005CR8" /* CR8 in legacy mode */ - "\006" - "\007" - "\010" + "\006ABM" /* LZCNT instruction */ + "\007SSE4A" /* SSE4A */ + "\010MAS" /* Misaligned SSE mode */ "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ - "\012" - "\013" - "\014" - "\015" - "\016" + "\012OSVW" /* OS visible workaround */ + "\013IBS" /* Instruction based sampling */ + "\014SSE5" /* SSE5 */ + "\015SKINIT" /* SKINIT/STGI */ + "\016WDT" /* Watchdog timer */ "\017" "\020" "\021" Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Fri Dec 12 23:13:40 2008 (r186008) +++ head/sys/amd64/include/specialreg.h Fri Dec 12 23:17:00 2008 (r186009) @@ -150,7 +150,15 @@ #define AMDID2_SVM 0x00000004 #define AMDID2_EXT_APIC 0x00000008 #define AMDID2_CR8 0x00000010 +#define AMDID2_ABM 0x00000020 +#define AMDID2_SSE4A 0x00000040 +#define AMDID2_MAS 0x00000080 #define AMDID2_PREFETCH 0x00000100 +#define AMDID2_OSVW 0x00000200 +#define AMDID2_IBS 0x00000400 +#define AMDID2_SSE5 0x00000800 +#define AMDID2_SKINIT 0x00001000 +#define AMDID2_WDT 0x00002000 /* * CPUID instruction 1 eax info Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Fri Dec 12 23:13:40 2008 (r186008) +++ head/sys/i386/i386/identcpu.c Fri Dec 12 23:17:00 2008 (r186009) @@ -826,15 +826,15 @@ printcpuinfo(void) "\003SVM" /* Secure Virtual Mode */ "\004ExtAPIC" /* Extended APIC register */ "\005CR8" /* CR8 in legacy mode */ - "\006" - "\007" - "\010" + "\006ABM" /* LZCNT instruction */ + "\007SSE4A" /* SSE4A */ + "\010MAS" /* Misaligned SSE mode */ "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ - "\012" - "\013" - "\014" - "\015" - "\016" + "\012OSVW" /* OS visible workaround */ + "\013IBS" /* Instruction based sampling */ + "\014SSE5" /* SSE5 */ + "\015SKINIT" /* SKINIT/STGI */ + "\016WDT" /* Watchdog timer */ "\017" "\020" "\021" Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Fri Dec 12 23:13:40 2008 (r186008) +++ head/sys/i386/include/specialreg.h Fri Dec 12 23:17:00 2008 (r186009) @@ -147,7 +147,15 @@ #define AMDID2_SVM 0x00000004 #define AMDID2_EXT_APIC 0x00000008 #define AMDID2_CR8 0x00000010 +#define AMDID2_ABM 0x00000020 +#define AMDID2_SSE4A 0x00000040 +#define AMDID2_MAS 0x00000080 #define AMDID2_PREFETCH 0x00000100 +#define AMDID2_OSVW 0x00000200 +#define AMDID2_IBS 0x00000400 +#define AMDID2_SSE5 0x00000800 +#define AMDID2_SKINIT 0x00001000 +#define AMDID2_WDT 0x00002000 /* * CPUID instruction 1 eax info From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:44:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E29C71065672; Sat, 13 Dec 2008 03:44:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF6448FC08; Sat, 13 Dec 2008 03:44:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3iiKH016862; Sat, 13 Dec 2008 03:44:44 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3ii3e016861; Sat, 13 Dec 2008 03:44:44 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130344.mBD3ii3e016861@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:44: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: r186014 - head/sys/dev/ath/ath_hal/ar5312 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 03:44:45 -0000 Author: sam Date: Sat Dec 13 03:44:44 2008 New Revision: 186014 URL: http://svn.freebsd.org/changeset/base/186014 Log: remove conflicting decl Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312.h Sat Dec 13 02:56:08 2008 (r186013) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312.h Sat Dec 13 03:44:44 2008 (r186014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312.h,v 1.5 2008/11/22 07:37:40 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AR5312_H_ #define _ATH_AR5312_H_ @@ -38,8 +38,6 @@ AH_PRIVATE(ah)->ah_devid == AR5212_AR2317_REV1 || \ AH_PRIVATE(ah)->ah_devid == AR5212_AR2317_REV2) -extern struct ath_hal * ar5312Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); extern HAL_BOOL ar5312IsInterruptPending(struct ath_hal *ah); /* AR5312 */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:45:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C806D106564A; Sat, 13 Dec 2008 03:45:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B499D8FC12; Sat, 13 Dec 2008 03:45:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3j0hk016904; Sat, 13 Dec 2008 03:45:00 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3j0Aa016902; Sat, 13 Dec 2008 03:45:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130345.mBD3j0Aa016902@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186015 - head/sys/dev/ath/ath_hal/ar5312 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 03:45:00 -0000 Author: sam Date: Sat Dec 13 03:45:00 2008 New Revision: 186015 URL: http://svn.freebsd.org/changeset/base/186015 Log: remove duplicate case Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Sat Dec 13 03:44:44 2008 (r186014) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Sat Dec 13 03:45:00 2008 (r186015) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_attach.c,v 1.8 2008/11/27 22:30:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -318,7 +318,6 @@ ar5312Probe(uint16_t vendorid, uint16_t case AR5212_AR2313_REV8: return "Atheros 2313 WiSoC"; case AR5212_AR2315_REV6: - case AR5212_AR2315_REV6: case AR5212_AR2315_REV7: return "Atheros 2315 WiSoC"; case AR5212_AR2317_REV1: From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:45:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBDEB1065690; Sat, 13 Dec 2008 03:45:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A87768FC20; Sat, 13 Dec 2008 03:45:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3jssw016961; Sat, 13 Dec 2008 03:45:54 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3jstl016960; Sat, 13 Dec 2008 03:45:54 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130345.mBD3jstl016960@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:45: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: r186016 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 03:45:54 -0000 Author: sam Date: Sat Dec 13 03:45:54 2008 New Revision: 186016 URL: http://svn.freebsd.org/changeset/base/186016 Log: fix static const order Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ar5212/ar5111.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5111.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5111.c Sat Dec 13 03:45:00 2008 (r186015) +++ head/sys/dev/ath/ath_hal/ar5212/ar5111.c Sat Dec 13 03:45:54 2008 (r186016) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5111.c,v 1.7 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -90,7 +90,7 @@ ar5111SetChannel(struct ath_hal *ah, HA uint16_t channel5111; /* 11a channel for 5111 */ } CHAN_INFO_2GHZ; - const static CHAN_INFO_2GHZ chan2GHzData[] = { + static const CHAN_INFO_2GHZ chan2GHzData[] = { { 1, 0x46, 96 }, /* 2312 -19 */ { 1, 0x46, 97 }, /* 2317 -18 */ { 1, 0x46, 98 }, /* 2322 -17 */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:47:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A331E1065672; Sat, 13 Dec 2008 03:47:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901B88FC16; Sat, 13 Dec 2008 03:47:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3lg4C017039; Sat, 13 Dec 2008 03:47:42 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3lgF9017038; Sat, 13 Dec 2008 03:47:42 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130347.mBD3lgF9017038@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:47: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: r186017 - 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, 13 Dec 2008 03:47:42 -0000 Author: sam Date: Sat Dec 13 03:47:42 2008 New Revision: 186017 URL: http://svn.freebsd.org/changeset/base/186017 Log: fix static const order Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v3.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v3.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v3.c Sat Dec 13 03:45:54 2008 (r186016) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v3.c Sat Dec 13 03:47:42 2008 (r186017) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v3.c,v 1.4 2008/11/27 22:39:42 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -26,9 +26,9 @@ static void getPcdacInterceptsFromPcdacMinMax(HAL_EEPROM *ee, uint16_t pcdacMin, uint16_t pcdacMax, uint16_t *vp) { - const static uint16_t intercepts3[] = + static const uint16_t intercepts3[] = { 0, 5, 10, 20, 30, 50, 70, 85, 90, 95, 100 }; - const static uint16_t intercepts3_2[] = + static const uint16_t intercepts3_2[] = { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; const uint16_t *ip = ee->ee_version < AR_EEPROM_VER3_2 ? intercepts3 : intercepts3_2; From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:48:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02388106564A; Sat, 13 Dec 2008 03:48:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E39378FC14; Sat, 13 Dec 2008 03:48:33 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3mXkV017111; Sat, 13 Dec 2008 03:48:33 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3mXm3017110; Sat, 13 Dec 2008 03:48:33 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130348.mBD3mXm3017110@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:48: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: r186018 - 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, 13 Dec 2008 03:48:34 -0000 Author: sam Date: Sat Dec 13 03:48:33 2008 New Revision: 186018 URL: http://svn.freebsd.org/changeset/base/186018 Log: add const Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ah.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sat Dec 13 03:47:42 2008 (r186017) +++ head/sys/dev/ath/ath_hal/ah.c Sat Dec 13 03:48:33 2008 (r186018) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah.c,v 1.15 2008/11/15 22:15:44 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -32,7 +32,7 @@ OS_SET_DECLARE(ah_chips, struct ath_hal_ const char* ath_hal_probe(uint16_t vendorid, uint16_t devid) { - struct ath_hal_chip **pchip; + struct ath_hal_chip * const *pchip; OS_SET_FOREACH(pchip, ah_chips) { const char *name = (*pchip)->probe(vendorid, devid); @@ -53,7 +53,7 @@ struct ath_hal* ath_hal_attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *error) { - struct ath_hal_chip **pchip; + struct ath_hal_chip * const *pchip; OS_SET_FOREACH(pchip, ah_chips) { struct ath_hal_chip *chip = *pchip; @@ -88,7 +88,7 @@ OS_SET_DECLARE(ah_rfs, struct ath_hal_rf struct ath_hal_rf * ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode) { - struct ath_hal_rf **prf; + struct ath_hal_rf * const *prf; OS_SET_FOREACH(prf, ah_rfs) { struct ath_hal_rf *rf = *prf; From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:49:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324C91065672; Sat, 13 Dec 2008 03:49:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FDF58FC1C; Sat, 13 Dec 2008 03:49:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3n2rx017156; Sat, 13 Dec 2008 03:49:02 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3n2ol017155; Sat, 13 Dec 2008 03:49:02 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130349.mBD3n2ol017155@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:49: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: r186019 - 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, 13 Dec 2008 03:49:02 -0000 Author: sam Date: Sat Dec 13 03:49:01 2008 New Revision: 186019 URL: http://svn.freebsd.org/changeset/base/186019 Log: remove dead code Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat Dec 13 03:48:33 2008 (r186018) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat Dec 13 03:49:01 2008 (r186019) @@ -160,18 +160,6 @@ v14EepromDiag(struct ath_hal *ah, int re return AH_FALSE; } -/* XXX conditionalize by target byte order */ -#ifndef bswap16 -static __inline__ uint16_t -__bswap16(uint16_t _x) -{ - return ((uint16_t)( - (((const uint8_t *)(&_x))[0] ) | - (((const uint8_t *)(&_x))[1]<< 8)) - ); -} -#endif - /* Do structure specific swaps if Eeprom format is non native to host */ static void eepromSwap(struct ar5416eeprom *ee) From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 03:50:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D44E71065672; Sat, 13 Dec 2008 03:50:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C185D8FC12; Sat, 13 Dec 2008 03:50:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD3oVdc017240; Sat, 13 Dec 2008 03:50:31 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD3oViw017239; Sat, 13 Dec 2008 03:50:31 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812130350.mBD3oViw017239@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Dec 2008 03:50: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: r186020 - 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, 13 Dec 2008 03:50:31 -0000 Author: sam Date: Sat Dec 13 03:50:31 2008 New Revision: 186020 URL: http://svn.freebsd.org/changeset/base/186020 Log: o remove dead code o fix AH_RF macro expansion to be as intended (worked before unintentionally) Obtained from: netbsd Modified: head/sys/dev/ath/ath_hal/ah_internal.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sat Dec 13 03:49:01 2008 (r186019) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sat Dec 13 03:50:31 2008 (r186020) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_internal.h,v 1.21 2008/11/27 22:29:27 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_INTERAL_H_ #define _ATH_AH_INTERAL_H_ @@ -42,23 +42,6 @@ #define offsetof(type, field) ((size_t)(&((type *)0)->field)) #endif -/* - * Remove const in a way that keeps the compiler happy. - * This works for gcc but may require other magic for - * other compilers (not sure where this should reside). - * Note that uintptr_t is C99. - */ -#ifndef __DECONST -#ifndef _UINTPTR_T -#if AH_WORDSIZE == 64 -typedef unsigned long int uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#endif -#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - typedef struct { uint16_t start; /* first register */ uint16_t end; /* ending register or zero */ @@ -114,12 +97,12 @@ struct ath_hal_rf { }; #ifndef AH_RF #define AH_RF(_name, _probe, _attach) \ -static struct ath_hal_rf name##_rf = { \ - .name = #_name, \ +static struct ath_hal_rf _name##_rf = { \ + .name = __STRING(_name), \ .probe = _probe, \ .attach = _attach \ }; \ -OS_DATA_SET(ah_rfs, name##_rf) +OS_DATA_SET(ah_rfs, _name##_rf) #endif struct ath_hal_rf *ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode); From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 06:04:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E1ED1065670; Sat, 13 Dec 2008 06:04:35 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1C828FC13; Sat, 13 Dec 2008 06:04:34 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD64YYT020557; Sat, 13 Dec 2008 06:04:34 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD64Y5x020556; Sat, 13 Dec 2008 06:04:34 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200812130604.mBD64Y5x020556@svn.freebsd.org> From: Mike Silbersack Date: Sat, 13 Dec 2008 06:04: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: r186026 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2008 06:04:35 -0000 Author: silby Date: Sat Dec 13 06:04:34 2008 New Revision: 186026 URL: http://svn.freebsd.org/changeset/base/186026 Log: Add the sysctl debug.acpi.batt.batt_sleep_ms. On some laptops with smart batteries, enabling battery monitoring software causes keystrokes from atkbd to be lost. This has also been reported on Linux, and is apparently due to the keyboard and I2C line for the battery being routed through the same chip. Whether that's accurate or not, adding extra sleeps to the status checking code causes the problem to go away. I've been running this for nearly six months now on my laptop, it works like a charm. Reviewed by: Nate Lawson (in a previous revision) MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_smbat.c Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Sat Dec 13 06:01:54 2008 (r186025) +++ head/sys/dev/acpica/acpi_smbat.c Sat Dec 13 06:04:34 2008 (r186026) @@ -61,6 +61,23 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); +SYSCTL_DECL(_debug_acpi); +SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); + +/* On some laptops with smart batteries, enabling battery monitoring + * software causes keystrokes from atkbd to be lost. This has also been + * reported on Linux, and is apparently due to the keyboard and I2C line + * for the battery being routed through the same chip. Whether that's + * accurate or not, adding extra sleeps to the status checking code + * causes the problem to go away. + * + * If you experience that problem, try a value of 10ms and move up + * from there. + */ +static int batt_sleep_ms; +SYSCTL_INT(_debug_acpi_batt, OID_AUTO, batt_sleep_ms, CTLFLAG_RW, &batt_sleep_ms, 0, + "Sleep during battery status updates to prevent keystroke loss."); + static device_method_t acpi_smbat_methods[] = { /* device interface */ DEVMETHOD(device_probe, acpi_smbat_probe), @@ -176,6 +193,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -194,6 +214,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -239,6 +262,9 @@ acpi_smbus_read_multi_1(struct acpi_smba ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -257,6 +283,9 @@ acpi_smbus_read_multi_1(struct acpi_smba if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -292,6 +321,9 @@ acpi_smbus_read_multi_1(struct acpi_smba if (len > val) len = val; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + while (len--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_DATA + len, &val, 1); @@ -299,6 +331,8 @@ acpi_smbus_read_multi_1(struct acpi_smba goto out; ptr[len] = val; + if (batt_sleep_ms) + AcpiOsSleep(1); } out: From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 07:21:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 302561065673; Sat, 13 Dec 2008 07:21:21 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 06A748FC17; Sat, 13 Dec 2008 07:21:20 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.123.2.23] (p53.kientzle.com [66.166.149.53]) by kientzle.com (8.12.9/8.12.9) with ESMTP id mBD7LKtv081686; Fri, 12 Dec 2008 23:21:20 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <4943626C.5000005@freebsd.org> Date: Fri, 12 Dec 2008 23:21:16 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <200812060657.mB66vjXM086176@svn.freebsd.org> <200812081148.00728.jhb@freebsd.org> In-Reply-To: <200812081148.00728.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; 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: r185682 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 07:21:21 -0000 John Baldwin wrote: > On Saturday 06 December 2008 01:57:45 am Tim Kientzle wrote: > >>Author: kientzle >>Date: Sat Dec 6 06:57:45 2008 >>New Revision: 185682 >>URL: http://svn.freebsd.org/changeset/base/185682 >> >>Log: >> Strip ";1" and trailing "." from ISO9660 entries. >> This seems a better match for people's expectations. > > Err, maybe strip whatever version is present? The '1' is a version number and > in theory you can have newer versions. I think the intention was to allow > replacing files by growing an ISO fs with version '2' files "replacing" > version '1', etc. My thinking here was that if you have different versions, then you probably care about the versions. In that case, it seems the right thing is to keep enough version numbers so the files can still be disambiguated. Of course, it's probably a moot point; I'd be surprised to ever see a disc that actually has multiple version numbers. Tim From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 07:23:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE931065673; Sat, 13 Dec 2008 07:23:55 +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 7F85D8FC1A; Sat, 13 Dec 2008 07:23:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD7NtuW022202; Sat, 13 Dec 2008 07:23:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD7NtjM022201; Sat, 13 Dec 2008 07:23:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812130723.mBD7NtjM022201@svn.freebsd.org> From: Ed Schouten Date: Sat, 13 Dec 2008 07:23: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: r186030 - 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: Sat, 13 Dec 2008 07:23:55 -0000 Author: ed Date: Sat Dec 13 07:23:55 2008 New Revision: 186030 URL: http://svn.freebsd.org/changeset/base/186030 Log: Add FIONREAD to pseudo-terminal master devices. All ioctl()'s that aren't implemented by pts(4) are forwarded to the TTY itself. Unfortunately this is not correct for FIONREAD, because it will give the wrong amount of bytes that are available to read. Tested by: keramida Reminded by: keramida Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Sat Dec 13 07:03:16 2008 (r186029) +++ head/sys/kern/tty_pts.c Sat Dec 13 07:23:55 2008 (r186030) @@ -273,6 +273,16 @@ ptsdev_ioctl(struct file *fp, u_long cmd case FIONBIO: /* This device supports non-blocking operation. */ return (0); + case FIONREAD: + tty_lock(tp); + if (psc->pts_flags & PTS_FINISHED) { + /* Force read() to be called. */ + *(int *)data = 1; + } else { + *(int *)data = ttydisc_getc_poll(tp); + } + tty_unlock(tp); + return (0); case FIODGNAME: { struct fiodgname_arg *fgn; const char *p; From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 07:45:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 518771065673; Sat, 13 Dec 2008 07:45:49 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 417398FC14; Sat, 13 Dec 2008 07:45:49 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD7jmJL022620; Sat, 13 Dec 2008 07:45:48 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD7jmXs022619; Sat, 13 Dec 2008 07:45:48 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200812130745.mBD7jmXs022619@svn.freebsd.org> From: Mike Silbersack Date: Sat, 13 Dec 2008 07:45: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: r186031 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2008 07:45:49 -0000 Author: silby Date: Sat Dec 13 07:45:48 2008 New Revision: 186031 URL: http://svn.freebsd.org/changeset/base/186031 Log: Quick change to r186026. One of the conditionals was: if (batt_sleep_ms) AcpiOsSleep(1); where the rest are all: if (batt_sleep_ms) AcpiOsSleep(batt_sleep_ms); I can't recall why that one was different, so change it to match the rest. Pointed out by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_smbat.c Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Sat Dec 13 07:23:55 2008 (r186030) +++ head/sys/dev/acpica/acpi_smbat.c Sat Dec 13 07:45:48 2008 (r186031) @@ -332,7 +332,7 @@ acpi_smbus_read_multi_1(struct acpi_smba ptr[len] = val; if (batt_sleep_ms) - AcpiOsSleep(1); + AcpiOsSleep(batt_sleep_ms); } out: From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 09:33:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC6ED1065676; Sat, 13 Dec 2008 09:33:03 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3998FC14; Sat, 13 Dec 2008 09:33:03 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBD9X3AC024734; Sat, 13 Dec 2008 09:33:03 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBD9X3Cx024733; Sat, 13 Dec 2008 09:33:03 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <200812130933.mBD9X3Cx024733@svn.freebsd.org> From: Jens Schweikhardt Date: Sat, 13 Dec 2008 09:33: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: r186034 - 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: Sat, 13 Dec 2008 09:33:03 -0000 Author: schweikh Date: Sat Dec 13 09:33:03 2008 New Revision: 186034 URL: http://svn.freebsd.org/changeset/base/186034 Log: Typo/rewording. Modified: head/share/man/man4/acpi_aiboost.4 Modified: head/share/man/man4/acpi_aiboost.4 ============================================================================== --- head/share/man/man4/acpi_aiboost.4 Sat Dec 13 08:32:13 2008 (r186033) +++ head/share/man/man4/acpi_aiboost.4 Sat Dec 13 09:33:03 2008 (r186034) @@ -56,8 +56,8 @@ The driver uses ACPI as the backend to f descriptions and provides its data via the .Xr sysctl 8 interface, under dev.acpi_aiboost.0 namespace. -Descriptions for these values are set to sysctl description, -which can be see with sysctl -d. +Descriptions for these values are available +with sysctl -d. .Pp The .Nm From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 12:03:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11281065688; Sat, 13 Dec 2008 12:03:21 +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 CE9108FC0C; Sat, 13 Dec 2008 12:03:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDC3Lxp028927; Sat, 13 Dec 2008 12:03:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDC3LU9028926; Sat, 13 Dec 2008 12:03:21 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812131203.mBDC3LU9028926@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Dec 2008 12: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: r186036 - 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: Sat, 13 Dec 2008 12:03:22 -0000 Author: rwatson Date: Sat Dec 13 12:03:21 2008 New Revision: 186036 URL: http://svn.freebsd.org/changeset/base/186036 Log: Line wrap very long line in struct packet_filter_hook definition. MFC after: pretty soon Modified: head/sys/net/pfil.h Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sat Dec 13 10:19:28 2008 (r186035) +++ head/sys/net/pfil.h Sat Dec 13 12:03:21 2008 (r186036) @@ -49,7 +49,8 @@ struct inpcb; */ struct packet_filter_hook { TAILQ_ENTRY(packet_filter_hook) pfil_link; - int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *); + int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, + struct inpcb *); void *pfil_arg; int pfil_flags; }; From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 13:07:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA136106567C; Sat, 13 Dec 2008 13:07:12 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A68328FC1F; Sat, 13 Dec 2008 13:07:12 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDD7CPX030120; Sat, 13 Dec 2008 13:07:12 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDD7C68030116; Sat, 13 Dec 2008 13:07:12 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200812131307.mBDD7C68030116@svn.freebsd.org> From: Joseph Koshy Date: Sat, 13 Dec 2008 13:07: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: r186037 - in head/sys: amd64/amd64 dev/hwpmc i386/i386 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: Sat, 13 Dec 2008 13:07:12 -0000 Author: jkoshy Date: Sat Dec 13 13:07:12 2008 New Revision: 186037 URL: http://svn.freebsd.org/changeset/base/186037 Log: - Bug fix: prevent a thread from migrating between CPUs between the time it is marked for user space callchain capture in the NMI handler and the time the callchain capture callback runs. - Improve code and control flow clarity by invoking hwpmc(4)'s user space callchain capture callback directly from low-level code. Reviewed by: jhb (kern/subr_trap.c) Testing (various patch revisions): gnn, Fabien Thomas , Artem Belevich Modified: head/sys/amd64/amd64/exception.S head/sys/dev/hwpmc/hwpmc_mod.c head/sys/i386/i386/exception.s head/sys/kern/subr_trap.c Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sat Dec 13 12:03:21 2008 (r186036) +++ head/sys/amd64/amd64/exception.S Sat Dec 13 13:07:12 2008 (r186037) @@ -480,16 +480,20 @@ outofnmi: /* * At this point the processor has exited NMI mode and is running * with interrupts turned off on the normal kernel stack. - * We turn interrupts back on, and take the usual 'doreti' exit - * path. * * If a pending NMI gets recognized at or after this point, it - * will cause a kernel callchain to be traced. Since this path - * is only taken for NMI interrupts from user space, our `swapgs' - * state is correct for taking the doreti path. + * will cause a kernel callchain to be traced. + * + * We turn interrupts back on, and call the user callchain capture hook. */ + movq pmc_hook,%rax + orq %rax,%rax + jz nocallchain + movq PCPU(CURTHREAD),%rdi /* thread */ + movq $PMC_FN_USER_CALLCHAIN,%rsi /* command */ + movq %rsp,%rdx /* frame */ sti - jmp doreti + call *%rax nocallchain: #endif testl %ebx,%ebx Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Dec 13 12:03:21 2008 (r186036) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Dec 13 13:07:12 2008 (r186037) @@ -1863,8 +1863,11 @@ pmc_hook_handler(struct thread *td, int /* * Record a call chain. */ + KASSERT(td == curthread, ("[pmc,%d] td != curthread", + __LINE__)); pmc_capture_user_callchain(PCPU_GET(cpuid), (struct trapframe *) arg); + td->td_pflags &= ~TDP_CALLCHAIN; break; default: @@ -3794,30 +3797,28 @@ pmc_syscall_handler(struct thread *td, v */ static void -pmc_post_callchain_ast(void) +pmc_post_callchain_callback(void) { struct thread *td; td = curthread; + KASSERT((td->td_pflags & TDP_CALLCHAIN) == 0, + ("[pmc,%d] thread %p already marked for callchain capture", + __LINE__, (void *) td)); + /* - * Mark this thread as needing processing in ast(). - * td->td_pflags will be safe to touch as the process was in - * user space when it was interrupted. + * Mark this thread as needing callchain capture. + * `td->td_pflags' will be safe to touch because this thread + * was in user space when it was interrupted. */ td->td_pflags |= TDP_CALLCHAIN; /* - * Again, since we've entered this function directly from - * userland, `td' is guaranteed to be not locked by this CPU, - * so its safe to try acquire the thread lock even though we - * are executing in an NMI context. We need to acquire this - * lock before touching `td_flags' because other CPUs may be - * in the process of touching this field. - */ - thread_lock(td); - td->td_flags |= TDF_ASTPENDING; - thread_unlock(td); + * Don't let this thread migrate between CPUs until callchain + * capture completes. + */ + sched_pin(); return; } @@ -3869,6 +3870,10 @@ pmc_process_interrupt(int cpu, struct pm (int) (psb->ps_write - psb->ps_samples), (int) (psb->ps_read - psb->ps_samples)); + KASSERT(pm->pm_runcount >= 0, + ("[pmc,%d] pm=%p runcount %d", __LINE__, (void *) pm, + pm->pm_runcount)); + atomic_add_rel_32(&pm->pm_runcount, 1); /* hold onto PMC */ ps->ps_pmc = pm; if ((td = curthread) && td->td_proc) @@ -3876,6 +3881,7 @@ pmc_process_interrupt(int cpu, struct pm else ps->ps_pid = -1; ps->ps_cpu = cpu; + ps->ps_td = td; ps->ps_flags = inuserspace ? PMC_CC_F_USERSPACE : 0; callchaindepth = (pm->pm_flags & PMC_F_CALLCHAIN) ? @@ -3893,7 +3899,7 @@ pmc_process_interrupt(int cpu, struct pm pmc_save_kernel_callchain(ps->ps_pc, callchaindepth, tf); else { - pmc_post_callchain_ast(); + pmc_post_callchain_callback(); callchaindepth = PMC_SAMPLE_INUSE; } } @@ -3925,20 +3931,41 @@ pmc_capture_user_callchain(int cpu, stru { int i; struct pmc *pm; + struct thread *td; struct pmc_sample *ps; struct pmc_samplebuffer *psb; +#ifdef INVARIANTS + int ncallchains; +#endif + + sched_unpin(); /* Can migrate safely now. */ psb = pmc_pcpu[cpu]->pc_sb; + td = curthread; + + KASSERT(td->td_pflags & TDP_CALLCHAIN, + ("[pmc,%d] Retrieving callchain for thread that doesn't want it", + __LINE__)); + +#ifdef INVARIANTS + ncallchains = 0; +#endif /* * Iterate through all deferred callchain requests. */ - for (i = 0; i < pmc_nsamples; i++) { + ps = psb->ps_samples; + for (i = 0; i < pmc_nsamples; i++, ps++) { - ps = &psb->ps_samples[i]; if (ps->ps_nsamples != PMC_SAMPLE_INUSE) continue; + if (ps->ps_td != td) + continue; + + KASSERT(ps->ps_cpu == cpu, + ("[pmc,%d] cpu mismatch ps_cpu=%d pcpu=%d", __LINE__, + ps->ps_cpu, PCPU_GET(cpuid))); pm = ps->ps_pmc; @@ -3946,14 +3973,26 @@ pmc_capture_user_callchain(int cpu, stru ("[pmc,%d] Retrieving callchain for PMC that doesn't " "want it", __LINE__)); + KASSERT(pm->pm_runcount > 0, + ("[pmc,%d] runcount %d", __LINE__, pm->pm_runcount)); + /* * Retrieve the callchain and mark the sample buffer * as 'processable' by the timer tick sweep code. */ ps->ps_nsamples = pmc_save_user_callchain(ps->ps_pc, pmc_callchaindepth, tf); + +#ifdef INVARIANTS + ncallchains++; +#endif + } + KASSERT(ncallchains > 0, + ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, + cpu)); + return; } @@ -3991,6 +4030,11 @@ pmc_process_samples(int cpu) } pm = ps->ps_pmc; + + KASSERT(pm->pm_runcount > 0, + ("[pmc,%d] pm=%p runcount %d", __LINE__, (void *) pm, + pm->pm_runcount)); + po = pm->pm_owner; KASSERT(PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)), Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Sat Dec 13 12:03:21 2008 (r186036) +++ head/sys/i386/i386/exception.s Sat Dec 13 13:07:12 2008 (r186037) @@ -438,9 +438,18 @@ doreti_nmi: iret outofnmi: /* - * Clear interrupts and jump to AST handling code. + * Call the callchain capture hook after turning interrupts back on. */ + movl pmc_hook,%ecx + orl %ecx,%ecx + jz doreti_exit + pushl %esp /* frame pointer */ + pushl $PMC_FN_USER_CALLCHAIN /* command */ + movl PCPU(CURTHREAD),%eax + pushl %eax /* curthread */ sti + call *%ecx + addl $12,%esp jmp doreti_ast ENTRY(end_exceptions) #endif Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Dec 13 12:03:21 2008 (r186036) +++ head/sys/kern/subr_trap.c Sat Dec 13 13:07:12 2008 (r186037) @@ -44,7 +44,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_hwpmc_hooks.h" #include "opt_ktrace.h" #include "opt_mac.h" #ifdef __i386__ @@ -179,13 +178,6 @@ ast(struct trapframe *framep) td->td_profil_ticks = 0; td->td_pflags &= ~TDP_OWEUPC; } -#if defined(HWPMC_HOOKS) - if (td->td_pflags & TDP_CALLCHAIN) { - PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_USER_CALLCHAIN, - (void *) framep); - td->td_pflags &= ~TDP_CALLCHAIN; - } -#endif if (flags & TDF_ALRMPEND) { PROC_LOCK(p); psignal(p, SIGVTALRM); From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 14:14:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC9EC1065670; Sat, 13 Dec 2008 14:14:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD128FC0C; Sat, 13 Dec 2008 14:14:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDEEuvX031377; Sat, 13 Dec 2008 14:14:56 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDEEu0A031376; Sat, 13 Dec 2008 14:14:56 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200812131414.mBDEEu0A031376@svn.freebsd.org> From: Ulf Lilleengen Date: Sat, 13 Dec 2008 14:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186038 - head/sbin/geom/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 14:14:56 -0000 Author: lulf Date: Sat Dec 13 14:14:56 2008 New Revision: 186038 URL: http://svn.freebsd.org/changeset/base/186038 Log: - When writing metadata to a geom provider, open the it as read-write since it might do subsequent reads from other providers. This stopped geli (and probably other classes using g_metadata_store as well) from being put on top of gvinum raid5 volumes. Note: The reason it fails in the gvinum raid5 case is that gvinum will read back the old parity stripe before calculating the new parity stripe to be written out again. The write will then fail because the underlying disk to be read is opened write only. MFC after: 1 week Modified: head/sbin/geom/misc/subr.c Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Sat Dec 13 13:07:12 2008 (r186037) +++ head/sbin/geom/misc/subr.c Sat Dec 13 14:14:56 2008 (r186038) @@ -211,7 +211,7 @@ g_metadata_store(const char *name, u_cha sector = NULL; error = 0; - fd = open(path, O_WRONLY); + fd = open(path, O_RDWR); if (fd == -1) return (errno); mediasize = g_get_mediasize(name); From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 15:44:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34501065675; Sat, 13 Dec 2008 15:44:29 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1B2B8FC1A; Sat, 13 Dec 2008 15:44:29 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDFiT81033058; Sat, 13 Dec 2008 15:44:29 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDFiTVG033057; Sat, 13 Dec 2008 15:44:29 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200812131544.mBDFiTVG033057@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 13 Dec 2008 15:44: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: r186039 - head/usr.bin/cpuset X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 15:44:30 -0000 Author: ru Date: Sat Dec 13 15:44:29 2008 New Revision: 186039 URL: http://svn.freebsd.org/changeset/base/186039 Log: Sync manpage's synopsis with program's usage(). Trim whitespace at EOL. Modified: head/usr.bin/cpuset/cpuset.1 Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Sat Dec 13 14:14:56 2008 (r186038) +++ head/usr.bin/cpuset/cpuset.1 Sat Dec 13 15:44:29 2008 (r186039) @@ -35,7 +35,7 @@ .Nm .Op Fl l Ar cpu-list .Op Fl s Ar setid -.Ar cmd +.Ar cmd ... .Nm .Op Fl l Ar cpu-list .Op Fl s Ar setid @@ -43,10 +43,10 @@ .Nm .Op Fl cr .Op Fl l Ar cpu-list -.Op Fl j Ar jailid | Fl p Ar pid | Fl r Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Nm .Op Fl cgir -.Op Fl j Ar jailid | Fl p Ar pid | Fl r Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Sh DESCRIPTION The .Nm @@ -104,7 +104,7 @@ target specifier. .It Fl g Causes .Nm -to print either a list of valid CPUs or, using +to print either a list of valid CPUs or, using .Fl i , the id of the target. .It Fl i @@ -119,14 +119,14 @@ Specification may include numbers separated by '-' for ranges and commas separating individual numbers. .It Fl p Ar pid Specifies a pid as the target of the operation. -.It Fl s Ar setid +.It Fl s Ar setid Specifies a set id as the target of the operation. .It Fl r The requested operation should reference the root set available via the target specifier. .It Fl t Ar tid Specifies a thread id as the target of the operation. -.It Fl x Ar irq +.It Fl x Ar irq Specifies an irq as the target of the operation. .El .Sh EXIT STATUS From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 15:47:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46736106564A; Sat, 13 Dec 2008 15:47:47 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34C7A8FC0C; Sat, 13 Dec 2008 15:47:47 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDFll6v033153; Sat, 13 Dec 2008 15:47:47 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDFll7H033152; Sat, 13 Dec 2008 15:47:47 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200812131547.mBDFll7H033152@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 13 Dec 2008 15:47: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: r186040 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 15:47:47 -0000 Author: ru Date: Sat Dec 13 15:47:46 2008 New Revision: 186040 URL: http://svn.freebsd.org/changeset/base/186040 Log: Added FreeBSD 7.1. Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Sat Dec 13 15:44:29 2008 (r186039) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Sat Dec 13 15:47:46 2008 (r186040) @@ -69,6 +69,7 @@ . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-6.3 6.3 +.ds doc-operating-system-FreeBSD-7.1 7.1 .ds doc-operating-system-FreeBSD-8.0 8.0 . .ec From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 16:13:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBDE1065672; Sat, 13 Dec 2008 16:13:37 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3678FC12; Sat, 13 Dec 2008 16:13:37 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDGDbPI033649; Sat, 13 Dec 2008 16:13:37 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDGDb8v033648; Sat, 13 Dec 2008 16:13:37 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200812131613.mBDGDb8v033648@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 13 Dec 2008 16:13: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: r186041 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 16:13:37 -0000 Author: ru Date: Sat Dec 13 16:13:37 2008 New Revision: 186041 URL: http://svn.freebsd.org/changeset/base/186041 Log: Added FreeBSD 6.4. Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Sat Dec 13 15:47:46 2008 (r186040) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Sat Dec 13 16:13:37 2008 (r186041) @@ -69,6 +69,7 @@ . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-6.3 6.3 +.ds doc-operating-system-FreeBSD-6.4 6.4 .ds doc-operating-system-FreeBSD-7.1 7.1 .ds doc-operating-system-FreeBSD-8.0 8.0 . From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 17:48:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66A01065673; Sat, 13 Dec 2008 17:48:06 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A506C8FC08; Sat, 13 Dec 2008 17:48:06 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDHm694035567; Sat, 13 Dec 2008 17:48:06 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDHm6Ie035565; Sat, 13 Dec 2008 17:48:06 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200812131748.mBDHm6Ie035565@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 13 Dec 2008 17:48: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: r186043 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 17:48:06 -0000 Author: ru Date: Sat Dec 13 17:48:06 2008 New Revision: 186043 URL: http://svn.freebsd.org/changeset/base/186043 Log: Improve usage and sync SYNOPSIS with usage. Modified: head/usr.bin/fetch/fetch.1 head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Sat Dec 13 16:53:35 2008 (r186042) +++ head/usr.bin/fetch/fetch.1 Sat Dec 13 17:48:06 2008 (r186043) @@ -37,17 +37,23 @@ .Nd retrieve a file by Uniform Resource Locator .Sh SYNOPSIS .Nm -.Op Fl 146AFMPRUadlmnpqrsv +.Op Fl 146AadFlMmnPpqRrsUv .Op Fl B Ar bytes +.Op Fl N Ar file +.Op Fl o Ar file .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl w Ar seconds +.Ar URL ... +.Nm +.Op Fl 146AadFlMmnPpqRrsUv +.Op Fl B Ar bytes .Op Fl N Ar file .Op Fl o Ar file +.Op Fl S Ar bytes +.Op Fl T Ar seconds .Op Fl w Ar seconds -.Op Fl h Ar host -.Op Fl c Ar dir -.Op Fl f Ar file -.Op Ar URL ... +.Fl h Ar host Fl f Ar file Oo Fl c Ar dir Oc .Sh DESCRIPTION The .Nm @@ -59,7 +65,7 @@ command line. .Pp The following options are available: .Bl -tag -width Fl -.It Fl \&1 +.It Fl 1 Stop and return exit code 0 at the first successfully retrieved file. .It Fl 4 Forces Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Sat Dec 13 16:53:35 2008 (r186042) +++ head/usr.bin/fetch/fetch.c Sat Dec 13 17:48:06 2008 (r186043) @@ -711,10 +711,11 @@ fetch(char *URL, const char *path) static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n", - "usage: fetch [-146AFMPRUadlmnpqrsv] [-N netrc] [-o outputfile]", - " [-S bytes] [-B bytes] [-T seconds] [-w seconds]", - " [-h host -f file [-c dir] | URL ...]"); + fprintf(stderr, "%s\n%s\n%s\n%s\n", +"usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]", +" [-T seconds] [-w seconds] URL ...", +" fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]", +" [-T seconds] [-w seconds] -h host -f file [-c dir]"); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 18:49:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC651065672; Sat, 13 Dec 2008 18:49:01 +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 CB4C88FC13; Sat, 13 Dec 2008 18:49:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDIn1ta036836; Sat, 13 Dec 2008 18:49:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDIn1NV036834; Sat, 13 Dec 2008 18:49:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812131849.mBDIn1NV036834@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 13 Dec 2008 18: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: r186046 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 18:49:02 -0000 Author: nwhitehorn Date: Sat Dec 13 18:49:01 2008 New Revision: 186046 URL: http://svn.freebsd.org/changeset/base/186046 Log: Use a static free packet queue instead of using malloc() to allocate new ADB packets. This fixes some locking problems. Modified: head/sys/powerpc/powermac/cuda.c head/sys/powerpc/powermac/cudavar.h Modified: head/sys/powerpc/powermac/cuda.c ============================================================================== --- head/sys/powerpc/powermac/cuda.c Sat Dec 13 18:33:22 2008 (r186045) +++ head/sys/powerpc/powermac/cuda.c Sat Dec 13 18:49:01 2008 (r186046) @@ -104,8 +104,6 @@ static devclass_t cuda_devclass; DRIVER_MODULE(cuda, macio, cuda_driver, cuda_devclass, 0, 0); DRIVER_MODULE(adb, cuda, adb_driver, adb_devclass, 0, 0); -MALLOC_DEFINE(M_CUDA, "cuda", "CUDA packet queue"); - static void cuda_intr(void *arg); static uint8_t cuda_read_reg(struct cuda_softc *sc, u_int offset); static void cuda_write_reg(struct cuda_softc *sc, u_int offset, uint8_t value); @@ -178,6 +176,10 @@ cuda_attach(device_t dev) STAILQ_INIT(&sc->sc_inq); STAILQ_INIT(&sc->sc_outq); + STAILQ_INIT(&sc->sc_freeq); + + for (i = 0; i < CUDA_MAXPACKETS; i++) + STAILQ_INSERT_TAIL(&sc->sc_freeq, &sc->sc_pkts[i], pkt_q); /* Init CUDA */ @@ -348,11 +350,17 @@ cuda_send(void *cookie, int poll, int le mtx_lock(&sc->sc_mutex); - pkt = malloc(sizeof(struct cuda_packet), M_CUDA, M_WAITOK); + pkt = STAILQ_FIRST(&sc->sc_freeq); + if (pkt == NULL) { + mtx_unlock(&sc->sc_mutex); + return (-1); + } + pkt->len = length - 1; pkt->type = msg[0]; memcpy(pkt->data, &msg[1], pkt->len); + STAILQ_REMOVE_HEAD(&sc->sc_freeq, pkt_q); STAILQ_INSERT_TAIL(&sc->sc_outq, pkt, pkt_q); /* @@ -389,8 +397,8 @@ cuda_send_outbound(struct cuda_softc *sc memcpy(sc->sc_out, &pkt->type, pkt->len + 1); sc->sc_sent = 0; - free(pkt, M_CUDA); STAILQ_REMOVE_HEAD(&sc->sc_outq, pkt_q); + STAILQ_INSERT_TAIL(&sc->sc_freeq, pkt, pkt_q); sc->sc_waiting = 1; @@ -455,9 +463,9 @@ cuda_send_inbound(struct cuda_softc *sc) break; } - free(pkt,M_CUDA); - mtx_lock(&sc->sc_mutex); + + STAILQ_INSERT_TAIL(&sc->sc_freeq, pkt, pkt_q); } mtx_unlock(&sc->sc_mutex); @@ -559,18 +567,22 @@ switch_start: cuda_idle(sc); /* Queue up the packet */ - pkt = malloc(sizeof(struct cuda_packet), M_CUDA, - M_WAITOK); + pkt = STAILQ_FIRST(&sc->sc_freeq); + if (pkt != NULL) { + /* If we have a free packet, process it */ + + pkt->len = sc->sc_received - 2; + pkt->type = sc->sc_in[1]; + memcpy(pkt->data, &sc->sc_in[2], pkt->len); - pkt->len = sc->sc_received - 2; - pkt->type = sc->sc_in[1]; - memcpy(pkt->data, &sc->sc_in[2], pkt->len); + STAILQ_REMOVE_HEAD(&sc->sc_freeq, pkt_q); + STAILQ_INSERT_TAIL(&sc->sc_inq, pkt, pkt_q); - STAILQ_INSERT_TAIL(&sc->sc_inq, pkt, pkt_q); + process_inbound = 1; + } sc->sc_state = CUDA_IDLE; sc->sc_received = 0; - process_inbound = 1; /* * If there is something waiting to be sent out, Modified: head/sys/powerpc/powermac/cudavar.h ============================================================================== --- head/sys/powerpc/powermac/cudavar.h Sat Dec 13 18:33:22 2008 (r186045) +++ head/sys/powerpc/powermac/cudavar.h Sat Dec 13 18:49:01 2008 (r186046) @@ -35,6 +35,7 @@ #define _POWERPC_CUDAVAR_H_ #define CUDA_DEVSTR "Apple CUDA I/O Controller" +#define CUDA_MAXPACKETS 10 /* Cuda addresses */ #define CUDA_ADB 0 @@ -99,8 +100,10 @@ struct cuda_softc { int sc_out_length; int sc_received; + struct cuda_packet sc_pkts[CUDA_MAXPACKETS]; struct cuda_pktq sc_inq; struct cuda_pktq sc_outq; + struct cuda_pktq sc_freeq; }; #endif /* _POWERPC_CUDAVAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 19:13:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02A17106564A; Sat, 13 Dec 2008 19:13:04 +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 E35D98FC19; Sat, 13 Dec 2008 19:13:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDJD3uv037366; Sat, 13 Dec 2008 19:13:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDJD38C037353; Sat, 13 Dec 2008 19:13:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812131913.mBDJD38C037353@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 13 Dec 2008 19:13: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: r186048 - in head/sys: contrib/pf/net net netinet netinet6 netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 19:13:04 -0000 Author: bz Date: Sat Dec 13 19:13:03 2008 New Revision: 186048 URL: http://svn.freebsd.org/changeset/base/186048 Log: Second round of putting global variables, which were virtualized but formerly missed under VIMAGE_GLOBAL. Put the extern declarations of the virtualized globals under VIMAGE_GLOBAL as the globals themsevles are already. This will help by the time when we are going to remove the globals entirely. Sponsored by: The FreeBSD Foundation Modified: head/sys/contrib/pf/net/pf_if.c head/sys/net/if_var.h head/sys/netinet/icmp6.h head/sys/netinet/icmp_var.h head/sys/netinet/in_var.h head/sys/netinet/ip_fw.h head/sys/netinet/ip_fw2.c head/sys/netinet/tcp_var.h head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h head/sys/netinet6/raw_ip6.h head/sys/netipsec/ipip_var.h Modified: head/sys/contrib/pf/net/pf_if.c ============================================================================== --- head/sys/contrib/pf/net/pf_if.c Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/contrib/pf/net/pf_if.c Sat Dec 13 19:13:03 2008 (r186048) @@ -115,8 +115,10 @@ void pfi_change_group_event(void * __u void pfi_detach_group_event(void * __unused, struct ifg_group *); void pfi_ifaddr_event(void * __unused, struct ifnet *); +#ifdef VIMAGE_GLOBALS extern struct ifgrouphead ifg_head; #endif +#endif RB_PROTOTYPE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare); RB_GENERATE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/net/if_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -659,10 +659,12 @@ struct ifnet *ifnet_byindex(u_short idx) struct ifaddr *ifaddr_byindex(u_short idx); struct cdev *ifdev_byindex(u_short idx); +#ifdef VIMAGE_GLOBALS extern struct ifnethead ifnet; -extern int ifqmaxlen; extern struct ifnet *loif; /* first loopback interface */ extern int if_index; +#endif +extern int ifqmaxlen; int if_addgroup(struct ifnet *, const char *); int if_delgroup(struct ifnet *, const char *); Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet/icmp6.h Sat Dec 13 19:13:03 2008 (r186048) @@ -707,8 +707,10 @@ do { \ } \ } while (/*CONSTCOND*/ 0) +#ifdef VIMAGE_GLOBALS extern int icmp6_rediraccept; /* accept/process redirects */ extern int icmp6_redirtimeout; /* cache time for redirect routes */ +#endif #define ICMP6_NODEINFO_FQDNOK 0x1 #define ICMP6_NODEINFO_NODEADDROK 0x2 Modified: head/sys/netinet/icmp_var.h ============================================================================== --- head/sys/netinet/icmp_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet/icmp_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -74,7 +74,9 @@ struct icmpstat { #ifdef _KERNEL SYSCTL_DECL(_net_inet_icmp); +#ifdef VIMAGE_GLOBALS extern struct icmpstat icmpstat; /* icmp statistics */ +#endif extern int badport_bandlim(int); #define BANDLIM_UNLIMITED -1 #define BANDLIM_ICMP_UNREACH 0 Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet/in_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -84,9 +84,13 @@ extern u_char inetctlerrmap[]; /* * Hash table for IP addresses. */ -extern LIST_HEAD(in_ifaddrhashhead, in_ifaddr) *in_ifaddrhashtbl; -extern TAILQ_HEAD(in_ifaddrhead, in_ifaddr) in_ifaddrhead; +TAILQ_HEAD(in_ifaddrhead, in_ifaddr); +LIST_HEAD(in_ifaddrhashhead, in_ifaddr); +#ifdef VIMAGE_GLOBALS +extern struct in_ifaddrhashhead *in_ifaddrhashtbl; +extern struct in_ifaddrhead in_ifaddrhead; extern u_long in_ifaddrhmask; /* mask for hash table */ +#endif #define INADDR_NHASH_LOG2 9 #define INADDR_NHASH (1 << INADDR_NHASH_LOG2) @@ -227,7 +231,10 @@ SYSCTL_DECL(_net_inet_ip); SYSCTL_DECL(_net_inet_raw); #endif -extern LIST_HEAD(in_multihead, in_multi) in_multihead; +LIST_HEAD(in_multihead, in_multi); +#ifdef VIMAGE_GLOBALS +extern struct in_multihead in_multihead; +#endif /* * Lock macros for IPv4 layer multicast address lists. IPv4 lock goes Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet/ip_fw.h Sat Dec 13 19:13:03 2008 (r186048) @@ -637,7 +637,7 @@ void ipfw_nat_destroy(void); typedef int ip_fw_ctl_t(struct sockopt *); extern ip_fw_ctl_t *ip_fw_ctl_ptr; -#ifndef VIMAGE +#ifdef VIMAGE_GLOBALS extern int fw_one_pass; extern int fw_enable; #ifdef INET6 Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet/ip_fw2.c Sat Dec 13 19:13:03 2008 (r186048) @@ -128,8 +128,8 @@ struct vnet_ipfw vnet_ipfw_0; static u_int32_t set_disable; static int fw_verbose; static struct callout ipfw_timeout; -#endif static int verbose_limit; +#endif static uma_zone_t ipfw_dyn_rule_zone; @@ -190,8 +190,9 @@ SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW | CTLFLAG_SECURE3, fw_verbose, 0, "Log matches to ipfw rules"); -SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, - &verbose_limit, 0, "Set upper limit of matches of ipfw rules logged"); +SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, verbose_limit, + CTLFLAG_RW, verbose_limit, 0, + "Set upper limit of matches of ipfw rules logged"); SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, default_rule, CTLFLAG_RD, NULL, IPFW_DEFAULT_RULE, "The default/max possible rule number."); SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, tables_max, CTLFLAG_RD, Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet/tcp_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -38,7 +38,9 @@ /* * Kernel variables for tcp. */ +#ifdef VIMAGE_GLOBALS extern int tcp_do_rfc1323; +#endif /* TCP segment queue entry */ struct tseg_qent { @@ -48,7 +50,9 @@ struct tseg_qent { struct mbuf *tqe_m; /* mbuf contains packet */ }; LIST_HEAD(tsegqe_head, tseg_qent); +#ifdef VIMAGE_GLOBALS extern int tcp_reass_qsize; +#endif extern struct uma_zone *tcp_reass_zone; struct sackblk { Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet6/in6_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -474,6 +474,8 @@ struct in6_rrenumreq { extern struct in6_ifaddr *in6_ifaddr; extern struct icmp6stat icmp6stat; + +extern unsigned long in6_maxmtu; #endif /* VIMAGE_GLOBALS */ #define in6_ifstat_inc(ifp, tag) \ do { \ @@ -483,7 +485,6 @@ do { \ extern struct in6_addr zeroin6_addr; extern u_char inet6ctlerrmap[]; -extern unsigned long in6_maxmtu; #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_IP6MADDR); #endif /* MALLOC_DECLARE */ Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet6/ip6_input.c Sat Dec 13 19:13:03 2008 (r186048) @@ -130,7 +130,6 @@ struct vnet_inet6 vnet_inet6_0; static int ip6qmaxlen; struct in6_ifaddr *in6_ifaddr; struct ip6stat ip6stat; -#endif extern struct callout in6_tmpaddrtimer_ch; @@ -144,7 +143,8 @@ extern int icmp6_nodeinfo; extern int udp6_sendspace; extern int udp6_recvspace; -#ifdef VIMAGE_GLOBALS +extern struct route_in6 ip6_forward_rt; + int ip6_forward_srcrt; /* XXX */ int ip6_sourcecheck; /* XXX */ int ip6_sourcecheck_interval; /* XXX */ @@ -301,8 +301,6 @@ ip6_init2(void *dummy) /* This must be after route_init(), which is now SI_ORDER_THIRD */ SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); -extern struct route_in6 ip6_forward_rt; - void ip6_input(struct mbuf *m) { Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet6/ip6_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -313,15 +313,16 @@ extern int ip6_auto_linklocal; extern int ip6_use_tempaddr; /* whether to use temporary addresses. */ extern int ip6_prefer_tempaddr; /* whether to prefer temporary addresses in the source address selection */ -#endif /* VIMAGE_GLOBALS */ + +#ifdef IPSTEALTH +extern int ip6stealth; +#endif extern int ip6_use_defzone; /* whether to use the default scope zone when unspecified */ +#endif /* VIMAGE_GLOBALS */ extern struct pfil_head inet6_pfil_hook; /* packet filter hooks */ -#ifdef IPSTEALTH -extern int ip6stealth; -#endif extern struct pr_usrreqs rip6_usrreqs; struct sockopt; Modified: head/sys/netinet6/raw_ip6.h ============================================================================== --- head/sys/netinet6/raw_ip6.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netinet6/raw_ip6.h Sat Dec 13 19:13:03 2008 (r186048) @@ -48,7 +48,9 @@ struct rip6stat { }; #ifdef _KERNEL +#ifdef VIMAGE_GLOBALS extern struct rip6stat rip6stat; #endif +#endif #endif Modified: head/sys/netipsec/ipip_var.h ============================================================================== --- head/sys/netipsec/ipip_var.h Sat Dec 13 19:11:46 2008 (r186047) +++ head/sys/netipsec/ipip_var.h Sat Dec 13 19:13:03 2008 (r186048) @@ -60,6 +60,8 @@ struct ipipstat #ifdef _KERNEL extern int ipip_allow; +#ifdef VIMAGE_GLOBALS extern struct ipipstat ipipstat; +#endif #endif /* _KERNEL */ #endif /* _NETINET_IPIP_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 19:35:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19A17106564A; Sat, 13 Dec 2008 19:35:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 95BC58FC1F; Sat, 13 Dec 2008 19:35:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id CBAC441C64A; Sat, 13 Dec 2008 20:35:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id LuSxzKuBSDNS; Sat, 13 Dec 2008 20:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 6AADA41C615; Sat, 13 Dec 2008 20:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 555864448D5; Sat, 13 Dec 2008 19:33:54 +0000 (UTC) Date: Sat, 13 Dec 2008 19:33:53 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD virtualization mailing list In-Reply-To: <200812131913.mBDJD38C037353@svn.freebsd.org> Message-ID: <20081213191345.M97918@maildrop.int.zabbadoz.net> References: <200812131913.mBDJD38C037353@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, FreeBSD current mailing list Subject: HEADS UP: vimage - virtualized global variables in the network stack X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: FreeBSD virtualization mailing list List-Id: 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, 13 Dec 2008 19:35:08 -0000 On Sat, 13 Dec 2008, Bjoern A. Zeeb wrote: Hi, > Author: bz > Date: Sat Dec 13 19:13:03 2008 > New Revision: 186048 > URL: http://svn.freebsd.org/changeset/base/186048 > > Log: > Second round of putting global variables, which were virtualized > but formerly missed under VIMAGE_GLOBAL. > > Put the extern declarations of the virtualized globals > under VIMAGE_GLOBAL as the globals themsevles are already. > This will help by the time when we are going to remove the globals > entirely. As some of you might have noticed that Marko's last commit for the first time in the series of vimage commits was an actual functional change. By default HEAD is no longer using the globals. With my commit the current set of virtualized variables is assumed to be "clean". This basically means three things: 1) The former globals and their externs are all under #ifdef VIMAGE_GLOBALS 2) The same variables are present in a 'container struct' 3) The initialization of those is done from 'constructor ("init") functions' This state of having the variables in parallel, global and in the container struct, will be maintained for another (short) time until the entire virtualization framework is in. This is needed, so that all three possible states can be benchmarked from exactly the same code changeset. For developers comitting new code or changing code it is important to properly add virtualized variables in the way that: 1) the globals and externs (if needed) are added/kept in sync as both a) globals under #ifdef VIMAGE_GLOBALS and b) to the appropriate container struct + the V_ macro. When used somewhere in code one has to use the V_foobarbaz version. 2) Any new virtualized globals must not be directly initialized. They have to be initialized from a contructor function (which is usually there already). If you are confused about some of the terms etc. follow the links in the "Some documentation" section on the wiki: http://wiki.freebsd.org/Image The "Vimage Coding - beginners guide / FAQ" tries to answer the 101 questions. For the beaf you'll find the link to a document in perforce with the last question (that you may already know). We'll try to enhance this as we get questions or the integration goes on. In case of questions or suggestions ideally follow-up on freebsd-virtualization@ . /bz -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 19:45:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F18D1065670 for ; Sat, 13 Dec 2008 19:45:19 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id C1F3B8FC17 for ; Sat, 13 Dec 2008 19:45:18 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-024-089.pools.arcor-ip.net [88.66.24.89]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis) id 0ML29c-1LBaQP2p09-0007jB; Sat, 13 Dec 2008 20:45:17 +0100 Received: (qmail 31355 invoked from network); 13 Dec 2008 19:45:17 -0000 Received: from fbsd8.laiers.local (192.168.4.151) by ns1.laiers.local with SMTP; 13 Dec 2008 19:45:17 -0000 From: Max Laier Organization: FreeBSD To: FreeBSD virtualization mailing list Date: Sat, 13 Dec 2008 20:45:16 +0100 User-Agent: KMail/1.10.1 (FreeBSD/8.0-CURRENT; KDE/4.1.1; i386; ; ) References: <200812131913.mBDJD38C037353@svn.freebsd.org> <20081213191345.M97918@maildrop.int.zabbadoz.net> In-Reply-To: <20081213191345.M97918@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812132045.17207.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1+kLdMfSyhBOnUXBPqldAwMg8vig1x4RghVlPC 6PSCgY+0wjtPKU6uoNnIYoystwf2v+ZccoadKTfQmgaqfKQgKp Bqg8zqPD6Yrzl+/HO2H0w== Cc: svn-src-head@freebsd.org, freebsd-net@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, FreeBSD current mailing list Subject: Re: HEADS UP: vimage - virtualized global variables in the network stack X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 19:45:19 -0000 On Saturday 13 December 2008 20:33:53 Bjoern A. Zeeb wrote: ... > This state of having the variables in parallel, global and in the > container struct, will be maintained for another (short) time until > the entire virtualization framework is in. This is needed, so that > all three possible states can be benchmarked from exactly the same > code changeset. > > > For developers comitting new code or changing code it is important to > properly add virtualized variables in the way that: > 1) the globals and externs (if needed) are added/kept in sync as both > a) globals under #ifdef VIMAGE_GLOBALS and b) to the appropriate > container struct + the V_ macro. > When used somewhere in code one has to use the V_foobarbaz version. Is there (an easy) way to have the tinderbox build every other run without VIMAGE_GLOBALS so that the most obvious error (global available, but not in the container struct - or the other way around) can be warned about? -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:10:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7744410656A3; Sat, 13 Dec 2008 20:10:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id F28588FC17; Sat, 13 Dec 2008 20:10:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 2048F41C6A3; Sat, 13 Dec 2008 21:10:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id AL8qj7J-9cEK; Sat, 13 Dec 2008 21:10:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id BC8A041C6A1; Sat, 13 Dec 2008 21:10:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 1A8434448D5; Sat, 13 Dec 2008 20:07:38 +0000 (UTC) Date: Sat, 13 Dec 2008 20:07:38 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Max Laier In-Reply-To: <200812132045.17207.max@love2party.net> Message-ID: <20081213195343.V97918@maildrop.int.zabbadoz.net> References: <200812131913.mBDJD38C037353@svn.freebsd.org> <20081213191345.M97918@maildrop.int.zabbadoz.net> <200812132045.17207.max@love2party.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, FreeBSD current mailing list , FreeBSD virtualization mailing list , freebsd-net@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: HEADS UP: vimage - virtualized global variables in the network stack X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 20:10:07 -0000 On Sat, 13 Dec 2008, Max Laier wrote: > On Saturday 13 December 2008 20:33:53 Bjoern A. Zeeb wrote: > ... >> This state of having the variables in parallel, global and in the >> container struct, will be maintained for another (short) time until >> the entire virtualization framework is in. This is needed, so that >> all three possible states can be benchmarked from exactly the same >> code changeset. >> >> >> For developers comitting new code or changing code it is important to >> properly add virtualized variables in the way that: >> 1) the globals and externs (if needed) are added/kept in sync as both >> a) globals under #ifdef VIMAGE_GLOBALS and b) to the appropriate >> container struct + the V_ macro. >> When used somewhere in code one has to use the V_foobarbaz version. > > Is there (an easy) way to have the tinderbox build every other run without > VIMAGE_GLOBALS so that the most obvious error (global available, but not in > the container struct - or the other way around) can be warned about? Without VIMAGE_GLOBALS is the default; we have been building this for a few days already. The flip had been so smoothly that almost noone had really noticed. Marko has done a really great job! Thus my HEADS UP now after I am confident enough that (almost) all places were caught and clean. In case you want to check yourself you can simply put a file into one or multiple archs conf dir that looks like: ------------------------------------------------------------------------ > cat sys/amd64/conf/LINT-VIMAGE_GLOBALS include LINT ident LINT-VIMAGE_GLOBALS options VIMAGE_GLOBALS ------------------------------------------------------------------------ I am doing that build every other day from now to catch the possible error of a virtualized variable in the container struct w/o the global. But as this is the least problematic case I do not want to commit the kernel configuration as it'll make builds longer for everyone, etc. The more problematic cases that builds cannot catch are: - static initialization of a virtualized 'global'. - a newly added virtualized 'global' that is not under #ifdef VIMAGE_GLOBALS I have scripts to identify the latter already. The former will only be caught be either code inspection or "unexpected results" when running. /bz -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:13:23 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 585501065673; Sat, 13 Dec 2008 20:13:23 +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 460478FC12; Sat, 13 Dec 2008 20:13:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKDNhI038550; Sat, 13 Dec 2008 20:13:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDKDNop038548; Sat, 13 Dec 2008 20:13:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812132013.mBDKDNop038548@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 13 Dec 2008 20:13: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: r186050 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 20:13:23 -0000 Author: nwhitehorn Date: Sat Dec 13 20:13:22 2008 New Revision: 186050 URL: http://svn.freebsd.org/changeset/base/186050 Log: Add support for a console mouse pointer on Open Firmware syscons. MFC after: 7.1-RELEASE Modified: head/sys/powerpc/ofw/ofw_syscons.c head/sys/powerpc/ofw/ofw_syscons.h Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Sat Dec 13 19:14:26 2008 (r186049) +++ head/sys/powerpc/ofw/ofw_syscons.c Sat Dec 13 20:13:22 2008 (r186050) @@ -137,10 +137,12 @@ static video_switch_t ofwfbvidsw = { */ static vi_blank_display_t ofwfb_blank_display8; static vi_putc_t ofwfb_putc8; +static vi_putm_t ofwfb_putm8; static vi_set_border_t ofwfb_set_border8; static vi_blank_display_t ofwfb_blank_display32; static vi_putc_t ofwfb_putc32; +static vi_putm_t ofwfb_putm32; static vi_set_border_t ofwfb_set_border32; VIDEO_DRIVER(ofwfb, ofwfbvidsw, ofwfb_configure); @@ -250,10 +252,12 @@ ofwfb_configure(int flags) if (depth == 8) { sc->sc_blank = ofwfb_blank_display8; sc->sc_putc = ofwfb_putc8; + sc->sc_putm = ofwfb_putm8; sc->sc_set_border = ofwfb_set_border8; } else if (depth == 32) { sc->sc_blank = ofwfb_blank_display32; sc->sc_putc = ofwfb_putc32; + sc->sc_putm = ofwfb_putm32; sc->sc_set_border = ofwfb_set_border32; } else return (0); @@ -823,7 +827,86 @@ ofwfb_putm(video_adapter_t *adp, int x, sc = (struct ofwfb_softc *)adp; - /* put mouse */ + return ((*sc->sc_putm)(adp, x, y, pixel_image, pixel_mask, size, + width)); +} + +static int +ofwfb_putm8(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, + uint32_t pixel_mask, int size, int width) +{ + struct ofwfb_softc *sc; + int i, j, k; + uint32_t *addr; + u_char fg, bg; + union { + uint32_t l[2]; + uint8_t c[8]; + } ch; + + + sc = (struct ofwfb_softc *)adp; + addr = (u_int32_t *)((int)sc->sc_addr + + (y + sc->sc_ymargin)*sc->sc_stride + + x + sc->sc_xmargin); + + fg = ofwfb_foreground(SC_NORM_ATTR); + bg = ofwfb_background(SC_NORM_ATTR); + + for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { + /* + * Use the current values for the line + */ + ch.l[0] = addr[0]; + ch.l[1] = addr[1]; + + /* + * Calculate 2 x 4-chars at a time, and then + * write these out. + */ + for (j = 0, k = width; j < 8; j++, k--) { + if (x + j >= sc->sc_width - 2*sc->sc_xmargin) + continue; + + if (pixel_image[i] & (1 << k)) + ch.c[j] = (ch.c[j] == fg) ? bg : fg; + } + + addr[0] = ch.l[0]; + addr[1] = ch.l[1]; + addr += (sc->sc_stride / sizeof(u_int32_t)); + } + + return (0); +} + +static int +ofwfb_putm32(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, + uint32_t pixel_mask, int size, int width) +{ + struct ofwfb_softc *sc; + int i, j, k; + uint32_t fg, bg; + uint32_t *addr; + + sc = (struct ofwfb_softc *)adp; + addr = (uint32_t *)sc->sc_addr + + (y + sc->sc_ymargin)*(sc->sc_stride/4) + + x + sc->sc_xmargin; + + fg = ofwfb_pix32(ofwfb_foreground(SC_NORM_ATTR)); + bg = ofwfb_pix32(ofwfb_background(SC_NORM_ATTR)); + + for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { + for (j = 0, k = width; j < 8; j++, k--) { + if (x + j >= sc->sc_width - 2*sc->sc_xmargin) + continue; + + if (pixel_image[i] & (1 << k)) + *(addr + j) = (*(addr + j) == fg) ? bg : fg; + } + addr += (sc->sc_stride/4); + } return (0); } Modified: head/sys/powerpc/ofw/ofw_syscons.h ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.h Sat Dec 13 19:14:26 2008 (r186049) +++ head/sys/powerpc/ofw/ofw_syscons.h Sat Dec 13 20:13:22 2008 (r186050) @@ -51,6 +51,7 @@ struct ofwfb_softc { vi_blank_display_t *sc_blank; vi_putc_t *sc_putc; + vi_putm_t *sc_putm; vi_set_border_t *sc_set_border; #define OFWSC_MAXADDR 8 From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:15:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53F70106567B; Sat, 13 Dec 2008 20:15:43 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42B1D8FC31; Sat, 13 Dec 2008 20:15:43 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKFhh7038629; Sat, 13 Dec 2008 20:15:43 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDKFhQo038628; Sat, 13 Dec 2008 20:15:43 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812132015.mBDKFhQo038628@svn.freebsd.org> From: Kip Macy Date: Sat, 13 Dec 2008 20:15: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: r186051 - 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: Sat, 13 Dec 2008 20:15:43 -0000 Author: kmacy Date: Sat Dec 13 20:15:42 2008 New Revision: 186051 URL: http://svn.freebsd.org/changeset/base/186051 Log: in6_addroute is called through rnh_addadr which is always called with the radix node head lock held exclusively. Pass RTF_RNH_LOCKED to rtalloc so that rtalloc1_fib will not try to re-acquire the lock. Modified: head/sys/netinet6/in6_rmx.c Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sat Dec 13 20:13:22 2008 (r186050) +++ head/sys/netinet6/in6_rmx.c Sat Dec 13 20:15:42 2008 (r186051) @@ -160,7 +160,7 @@ in6_addroute(void *v_arg, void *n_arg, s * Find out if it is because of an * ARP entry and delete it if so. */ - rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_CLONING); + rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_RNH_LOCKED|RTF_CLONING); if (rt2) { if (rt2->rt_flags & RTF_LLINFO && rt2->rt_flags & RTF_HOST && @@ -187,7 +187,7 @@ in6_addroute(void *v_arg, void *n_arg, s * net route entry, 3ffe:0501:: -> if0. * This case should not raise an error. */ - rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_CLONING); + rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_RNH_LOCKED|RTF_CLONING); if (rt2) { if ((rt2->rt_flags & (RTF_CLONING|RTF_HOST|RTF_GATEWAY)) == RTF_CLONING From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:16:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F38F10656B1; Sat, 13 Dec 2008 20:16:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3488FC0C; Sat, 13 Dec 2008 20:16:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKG33S038672; Sat, 13 Dec 2008 20:16:03 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDKG3G7038671; Sat, 13 Dec 2008 20:16:03 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812132016.mBDKG3G7038671@svn.freebsd.org> From: Kip Macy Date: Sat, 13 Dec 2008 20:16: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: r186052 - 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, 13 Dec 2008 20:16:03 -0000 Author: kmacy Date: Sat Dec 13 20:16:03 2008 New Revision: 186052 URL: http://svn.freebsd.org/changeset/base/186052 Log: don't acquire lock recursively Modified: head/sys/netinet/in_rmx.c Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sat Dec 13 20:15:42 2008 (r186051) +++ head/sys/netinet/in_rmx.c Sat Dec 13 20:16:03 2008 (r186052) @@ -115,7 +115,7 @@ in_addroute(void *v_arg, void *n_arg, st * ARP entry and delete it if so. */ rt2 = in_rtalloc1((struct sockaddr *)sin, 0, - RTF_CLONING, rt->rt_fibnum); + RTF_CLONING|RTF_RNH_LOCKED, rt->rt_fibnum); if (rt2) { if (rt2->rt_flags & RTF_LLINFO && rt2->rt_flags & RTF_HOST && From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:18:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D04BD1065688; Sat, 13 Dec 2008 20:18:05 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF2F58FC28; Sat, 13 Dec 2008 20:18:05 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKI5lT038758; Sat, 13 Dec 2008 20:18:05 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDKI5pJ038757; Sat, 13 Dec 2008 20:18:05 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812132018.mBDKI5pJ038757@svn.freebsd.org> From: Kip Macy Date: Sat, 13 Dec 2008 20:18: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: r186053 - 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, 13 Dec 2008 20:18:05 -0000 Author: kmacy Date: Sat Dec 13 20:18:05 2008 New Revision: 186053 URL: http://svn.freebsd.org/changeset/base/186053 Log: radix node head lock needs to be held when calling rnh_addaddr Modified: head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Sat Dec 13 20:16:03 2008 (r186052) +++ head/sys/netinet/ip_fw2.c Sat Dec 13 20:18:05 2008 (r186053) @@ -1826,7 +1826,9 @@ add_table_entry(struct ip_fw_chain *ch, ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; IPFW_WLOCK(ch); + RADIX_NODE_HEAD_LOCK(rnh); if (rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent) == + RADIX_NODE_HEAD_UNLOCK(rnh); NULL) { IPFW_WUNLOCK(ch); free(ent, M_IPFW_TBL); From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:27:17 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C195106570C; Sat, 13 Dec 2008 20:27:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 259428FC13; Sat, 13 Dec 2008 20:27:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mBDKOPGs092903; Sat, 13 Dec 2008 13:24:25 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 13 Dec 2008 13:24:25 -0700 (MST) Message-Id: <20081213.132425.41724046.imp@bsdimp.com> To: max@love2party.net From: Warner Losh In-Reply-To: <200812132045.17207.max@love2party.net> References: <200812131913.mBDJD38C037353@svn.freebsd.org> <20081213191345.M97918@maildrop.int.zabbadoz.net> <200812132045.17207.max@love2party.net> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, current@FreeBSD.org, freebsd-virtualization@FreeBSD.org, freebsd-net@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: HEADS UP: vimage - virtualized global variables in the network stack X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 20:27:17 -0000 From: Max Laier Subject: Re: HEADS UP: vimage - virtualized global variables in the network stack Date: Sat, 13 Dec 2008 20:45:16 +0100 > On Saturday 13 December 2008 20:33:53 Bjoern A. Zeeb wrote: > ... > > This state of having the variables in parallel, global and in the > > container struct, will be maintained for another (short) time until > > the entire virtualization framework is in. This is needed, so that > > all three possible states can be benchmarked from exactly the same > > code changeset. > > > > > > For developers comitting new code or changing code it is important to > > properly add virtualized variables in the way that: > > 1) the globals and externs (if needed) are added/kept in sync as both > > a) globals under #ifdef VIMAGE_GLOBALS and b) to the appropriate > > container struct + the V_ macro. > > When used somewhere in code one has to use the V_foobarbaz version. > > Is there (an easy) way to have the tinderbox build every other run without > VIMAGE_GLOBALS so that the most obvious error (global available, but not in > the container struct - or the other way around) can be warned about? This actually points out why the 'tinderbox' name is bogus for the universe plus failure: universe builds all the kernels. Tinderbox builds LINT only. Warner From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:34:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37A36106564A; Sat, 13 Dec 2008 20:34:42 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 262888FC19; Sat, 13 Dec 2008 20:34:42 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKYfxW039093; Sat, 13 Dec 2008 20:34:41 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDKYfmb039092; Sat, 13 Dec 2008 20:34:41 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812132034.mBDKYfmb039092@svn.freebsd.org> From: Kip Macy Date: Sat, 13 Dec 2008 20:34: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: r186054 - 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, 13 Dec 2008 20:34:42 -0000 Author: kmacy Date: Sat Dec 13 20:34:41 2008 New Revision: 186054 URL: http://svn.freebsd.org/changeset/base/186054 Log: version that will compile Modified: head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Sat Dec 13 20:18:05 2008 (r186053) +++ head/sys/netinet/ip_fw2.c Sat Dec 13 20:34:41 2008 (r186054) @@ -1814,6 +1814,7 @@ add_table_entry(struct ip_fw_chain *ch, INIT_VNET_IPFW(curvnet); struct radix_node_head *rnh; struct table_entry *ent; + struct radix_node *rn; if (tbl >= IPFW_TABLES_MAX) return (EINVAL); @@ -1827,9 +1828,9 @@ add_table_entry(struct ip_fw_chain *ch, ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; IPFW_WLOCK(ch); RADIX_NODE_HEAD_LOCK(rnh); - if (rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent) == + rn = rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent); RADIX_NODE_HEAD_UNLOCK(rnh); - NULL) { + if (rn == NULL) { IPFW_WUNLOCK(ch); free(ent, M_IPFW_TBL); return (EEXIST); From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:40:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DAE6106567E; Sat, 13 Dec 2008 20:40:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id C79DC8FC1C; Sat, 13 Dec 2008 20:40:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 9A15C41C64A; Sat, 13 Dec 2008 21:40:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id IOV4j6p0AzfW; Sat, 13 Dec 2008 21:40:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 0E65E41C615; Sat, 13 Dec 2008 21:40:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 52FF44448D5; Sat, 13 Dec 2008 20:36:23 +0000 (UTC) Date: Sat, 13 Dec 2008 20:36:23 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Warner Losh In-Reply-To: <20081213.132425.41724046.imp@bsdimp.com> Message-ID: <20081213203502.C97918@maildrop.int.zabbadoz.net> References: <200812131913.mBDJD38C037353@svn.freebsd.org> <20081213191345.M97918@maildrop.int.zabbadoz.net> <200812132045.17207.max@love2party.net> <20081213.132425.41724046.imp@bsdimp.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: HEADS UP: vimage - virtualized global variables in the network stack X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 20:40:09 -0000 On Sat, 13 Dec 2008, Warner Losh wrote: Hi, >> Is there (an easy) way to have the tinderbox build every other run without >> VIMAGE_GLOBALS so that the most obvious error (global available, but not in >> the container struct - or the other way around) can be warned about? > > This actually points out why the 'tinderbox' name is bogus for the > universe plus failure: universe builds all the kernels. Tinderbox > builds LINT only. And GENERIC and you are right, but that's the wrong thread. Please talk to Alfred about this. I really feel that he should back out what he has done. -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 20:53:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 549041065688; Sat, 13 Dec 2008 20:53:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 425A28FC13; Sat, 13 Dec 2008 20:53:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKrwNn039465; Sat, 13 Dec 2008 20:53:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDKrw70039464; Sat, 13 Dec 2008 20:53:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812132053.mBDKrw70039464@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 13 Dec 2008 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: r186055 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 20:53:58 -0000 Author: nwhitehorn Date: Sat Dec 13 20:53:57 2008 New Revision: 186055 URL: http://svn.freebsd.org/changeset/base/186055 Log: Allow OFW syscons to restore itself when the X server exits or there is a VT switch by redoing the Open Firmware card initialization calls in ofwfb_set_mode(). This uses the same trick (setting V_ADP_MODECHANGE) to arrange this as machfb(4) and creatorfb(4). Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Sat Dec 13 20:34:41 2008 (r186054) +++ head/sys/powerpc/ofw/ofw_syscons.c Sat Dec 13 20:53:57 2008 (r186055) @@ -308,36 +308,14 @@ ofwfb_init(int unit, video_adapter_t *ad { struct ofwfb_softc *sc; video_info_t *vi; - char name[64]; - ihandle_t ih; - int i; int cborder; int font_height; - int retval; sc = (struct ofwfb_softc *)adp; vi = &adp->va_info; vid_init_struct(adp, "ofwfb", -1, unit); - if (sc->sc_depth == 8) { - /* - * Install the ISO6429 colormap - older OFW systems - * don't do this by default - */ - memset(name, 0, sizeof(name)); - OF_package_to_path(sc->sc_node, name, sizeof(name)); - ih = OF_open(name); - for (i = 0; i < 16; i++) { - OF_call_method("color!", ih, 4, 1, - ofwfb_cmap[i].red, - ofwfb_cmap[i].green, - ofwfb_cmap[i].blue, - i, - &retval); - } - } - /* The default font size can be overridden by loader */ font_height = 16; TUNABLE_INT_FETCH("hw.syscons.fsize", &font_height); @@ -379,10 +357,13 @@ ofwfb_init(int unit, video_adapter_t *ad */ adp->va_window = (vm_offset_t) ofwfb_static_window; - /* Enable future font-loading and flag color support */ - adp->va_flags |= V_ADP_FONT | V_ADP_COLOR; - - ofwfb_blank_display(&sc->sc_va, V_DISPLAY_ON); + /* + * Enable future font-loading and flag color support, as well as + * adding V_ADP_MODECHANGE so that we ofwfb_set_mode() gets called + * when the X server shuts down. This enables us to get the console + * back when X disappears. + */ + adp->va_flags |= V_ADP_FONT | V_ADP_COLOR | V_ADP_MODECHANGE; ofwfb_set_mode(&sc->sc_va, 0); @@ -408,6 +389,37 @@ ofwfb_query_mode(video_adapter_t *adp, v static int ofwfb_set_mode(video_adapter_t *adp, int mode) { + struct ofwfb_softc *sc; + char name[64]; + ihandle_t ih; + int i, retval; + + sc = (struct ofwfb_softc *)adp; + + /* + * Open the display device, which will initialize it. + */ + + memset(name, 0, sizeof(name)); + OF_package_to_path(sc->sc_node, name, sizeof(name)); + ih = OF_open(name); + + if (sc->sc_depth == 8) { + /* + * Install the ISO6429 colormap - older OFW systems + * don't do this by default + */ + for (i = 0; i < 16; i++) { + OF_call_method("color!", ih, 4, 1, + ofwfb_cmap[i].red, + ofwfb_cmap[i].green, + ofwfb_cmap[i].blue, + i, + &retval); + } + } + + ofwfb_blank_display(&sc->sc_va, V_DISPLAY_ON); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 21:17:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804C61065673; Sat, 13 Dec 2008 21:17:47 +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 6E41F8FC1A; Sat, 13 Dec 2008 21:17:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDLHlCR040019; Sat, 13 Dec 2008 21:17:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDLHlqw040014; Sat, 13 Dec 2008 21:17:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812132117.mBDLHlqw040014@svn.freebsd.org> From: Alexander Motin Date: Sat, 13 Dec 2008 21:17: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: r186056 - in head/sys: dev/snp kern netgraph 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: Sat, 13 Dec 2008 21:17:47 -0000 Author: mav Date: Sat Dec 13 21:17:46 2008 New Revision: 186056 URL: http://svn.freebsd.org/changeset/base/186056 Log: Change ttyhook_register() second argument from thread to process pointer. Thread was not really needed there, while previous ng_tty implementation that used thread pointer had locking issues (using sx while holding mutex). Modified: head/sys/dev/snp/snp.c head/sys/kern/tty.c head/sys/netgraph/ng_tty.c head/sys/sys/ttyhook.h Modified: head/sys/dev/snp/snp.c ============================================================================== --- head/sys/dev/snp/snp.c Sat Dec 13 20:53:57 2008 (r186055) +++ head/sys/dev/snp/snp.c Sat Dec 13 21:17:46 2008 (r186056) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -246,7 +247,7 @@ snp_ioctl(struct cdev *dev, u_long cmd, sx_xunlock(&snp_register_lock); return (EBUSY); } - error = ttyhook_register(&ss->snp_tty, td, *(int *)data, + error = ttyhook_register(&ss->snp_tty, td->td_proc, *(int *)data, &snp_hook, ss); sx_xunlock(&snp_register_lock); if (error != 0) Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Dec 13 20:53:57 2008 (r186055) +++ head/sys/kern/tty.c Sat Dec 13 21:17:46 2008 (r186056) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_43TTY #include @@ -1673,18 +1674,24 @@ ttyhook_defrint(struct tty *tp, char c, } int -ttyhook_register(struct tty **rtp, struct thread *td, int fd, +ttyhook_register(struct tty **rtp, struct proc *p, int fd, struct ttyhook *th, void *softc) { struct tty *tp; struct file *fp; struct cdev *dev; struct cdevsw *cdp; + struct filedesc *fdp; int error; /* Validate the file descriptor. */ - if (fget(td, fd, &fp) != 0) - return (EINVAL); + if ((fdp = p->p_fd) == NULL) + return (EBADF); + FILEDESC_SLOCK(fdp); + if ((fp = fget_locked(fdp, fd)) == NULL || fp->f_ops == &badfileops) { + FILEDESC_SUNLOCK(fdp); + return (EBADF); + } /* Make sure the vnode is bound to a character device. */ error = EINVAL; @@ -1723,7 +1730,7 @@ ttyhook_register(struct tty **rtp, struc done3: tty_unlock(tp); done2: dev_relthread(dev); -done1: fdrop(fp, td); +done1: FILEDESC_SUNLOCK(fdp); return (error); } Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Sat Dec 13 20:53:57 2008 (r186055) +++ head/sys/netgraph/ng_tty.c Sat Dec 13 21:17:46 2008 (r186056) @@ -252,7 +252,6 @@ static int ngt_rcvmsg(node_p node, item_p item, hook_p lasthook) { struct proc *p; - struct thread *td; const sc_p sc = NG_NODE_PRIVATE(node); struct ng_mesg *msg, *resp = NULL; int error = 0; @@ -266,12 +265,13 @@ ngt_rcvmsg(node_p node, item_p item, hoo return (EBUSY); p = pfind(((int *)msg->data)[0]); - if (p == NULL) + if (p == NULL || (p->p_flag & P_WEXIT)) return (ESRCH); - td = FIRST_THREAD_IN_PROC(p); - error = ttyhook_register(&sc->tp, td, ((int *)msg->data)[1], - &ngt_hook, sc); + _PHOLD(p); PROC_UNLOCK(p); + error = ttyhook_register(&sc->tp, p, ((int *)msg->data)[1], + &ngt_hook, sc); + PRELE(p); if (error != 0) return (error); break; Modified: head/sys/sys/ttyhook.h ============================================================================== --- head/sys/sys/ttyhook.h Sat Dec 13 20:53:57 2008 (r186055) +++ head/sys/sys/ttyhook.h Sat Dec 13 21:17:46 2008 (r186056) @@ -66,7 +66,7 @@ struct ttyhook { th_close_t *th_close; }; -int ttyhook_register(struct tty **, struct thread *, int, +int ttyhook_register(struct tty **, struct proc *, int, struct ttyhook *, void *); void ttyhook_unregister(struct tty *); #define ttyhook_softc(tp) ((tp)->t_hooksoftc) From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 21:59:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B79F210656D4; Sat, 13 Dec 2008 21:59:18 +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 A62A28FC17; Sat, 13 Dec 2008 21:59:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDLxIVm040801; Sat, 13 Dec 2008 21:59:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDLxIQv040799; Sat, 13 Dec 2008 21:59:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812132159.mBDLxIQv040799@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 13 Dec 2008 21:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186057 - 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, 13 Dec 2008 21:59:18 -0000 Author: bz Date: Sat Dec 13 21:59:18 2008 New Revision: 186057 URL: http://svn.freebsd.org/changeset/base/186057 Log: De-virtualize the MD5 context for TCP initial seq number generation and make it a function local variable like we do almost everywhere inside the kernel. Discussed with: rwatson, silby MFC after: 4 weeks Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/vinet.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Dec 13 21:17:46 2008 (r186056) +++ head/sys/netinet/tcp_subr.c Sat Dec 13 21:59:18 2008 (r186057) @@ -1486,13 +1486,13 @@ tcp6_ctlinput(int cmd, struct sockaddr * static u_char isn_secret[32]; static int isn_last_reseed; static u_int32_t isn_offset, isn_offset_old; -static MD5_CTX isn_ctx; #endif tcp_seq tcp_new_isn(struct tcpcb *tp) { INIT_VNET_INET(tp->t_vnet); + MD5_CTX isn_ctx; u_int32_t md5_buffer[4]; tcp_seq new_isn; @@ -1508,25 +1508,25 @@ tcp_new_isn(struct tcpcb *tp) } /* Compute the md5 hash and return the ISN. */ - MD5Init(&V_isn_ctx); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short)); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short)); + MD5Init(&isn_ctx); + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short)); + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short)); #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) { - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr, sizeof(struct in6_addr)); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr, sizeof(struct in6_addr)); } else #endif { - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr, sizeof(struct in_addr)); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr, sizeof(struct in_addr)); } - MD5Update(&V_isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); - MD5Final((u_char *) &md5_buffer, &V_isn_ctx); + MD5Update(&isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); + MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; V_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); Modified: head/sys/netinet/vinet.h ============================================================================== --- head/sys/netinet/vinet.h Sat Dec 13 21:17:46 2008 (r186056) +++ head/sys/netinet/vinet.h Sat Dec 13 21:59:18 2008 (r186057) @@ -142,7 +142,6 @@ struct vnet_inet { int _isn_last_reseed; u_int32_t _isn_offset; u_int32_t _isn_offset_old; - MD5_CTX _isn_ctx; struct inpcbhead _udb; struct inpcbinfo _udbinfo; @@ -265,7 +264,6 @@ extern struct vnet_inet vnet_inet_0; #define V_ipsendredirects VNET_INET(ipsendredirects) #define V_ipstat VNET_INET(ipstat) #define V_ipstealth VNET_INET(ipstealth) -#define V_isn_ctx VNET_INET(isn_ctx) #define V_isn_last_reseed VNET_INET(isn_last_reseed) #define V_isn_offset VNET_INET(isn_offset) #define V_isn_offset_old VNET_INET(isn_offset_old) From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 22:04:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B2151065673; Sat, 13 Dec 2008 22:04:53 +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 EE3E98FC14; Sat, 13 Dec 2008 22:04:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDM4qg5040951; Sat, 13 Dec 2008 22:04:52 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDM4qef040950; Sat, 13 Dec 2008 22:04:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812132204.mBDM4qef040950@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 13 Dec 2008 22:04: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: r186058 - 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, 13 Dec 2008 22:04:53 -0000 Author: bz Date: Sat Dec 13 22:04:52 2008 New Revision: 186058 URL: http://svn.freebsd.org/changeset/base/186058 Log: Like for tcp_subr.c in r186057 make the MD5 context a function local variable in this copy of the code[1]. While here prefix the variables with 'pf_' to avoid file static global variables with colliding names that are or will be virtualized. Discussed with: rwatson, silby [1] Modified: head/sys/contrib/pf/net/pf_subr.c Modified: head/sys/contrib/pf/net/pf_subr.c ============================================================================== --- head/sys/contrib/pf/net/pf_subr.c Sat Dec 13 21:59:18 2008 (r186057) +++ head/sys/contrib/pf/net/pf_subr.c Sat Dec 13 22:04:52 2008 (r186058) @@ -116,22 +116,22 @@ __FBSDID("$FreeBSD$"); #define ISN_STATIC_INCREMENT 4096 #define ISN_RANDOM_INCREMENT (4096 - 1) -static u_char isn_secret[32]; -static int isn_last_reseed; -static u_int32_t isn_offset; -static MD5_CTX isn_ctx; +static u_char pf_isn_secret[32]; +static int pf_isn_last_reseed; +static u_int32_t pf_isn_offset; u_int32_t pf_new_isn(struct pf_state *s) { + MD5_CTX isn_ctx; u_int32_t md5_buffer[4]; u_int32_t new_isn; struct pf_state_host *src, *dst; /* Seed if this is the first use, reseed if requested. */ - if (isn_last_reseed == 0) { - read_random(&isn_secret, sizeof(isn_secret)); - isn_last_reseed = ticks; + if (pf_isn_last_reseed == 0) { + read_random(&pf_isn_secret, sizeof(pf_isn_secret)); + pf_isn_last_reseed = ticks; } if (s->direction == PF_IN) { @@ -160,11 +160,11 @@ pf_new_isn(struct pf_state *s) MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in_addr)); } - MD5Update(&isn_ctx, (u_char *) &isn_secret, sizeof(isn_secret)); + MD5Update(&isn_ctx, (u_char *) &pf_isn_secret, sizeof(pf_isn_secret)); MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; - isn_offset += ISN_STATIC_INCREMENT + + pf_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); - new_isn += isn_offset; + new_isn += pf_isn_offset; return (new_isn); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 22:05:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7931065679; Sat, 13 Dec 2008 22:05:47 +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 EF6868FC23; Sat, 13 Dec 2008 22:05:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDM5ksp041008; Sat, 13 Dec 2008 22:05:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDM5kPZ041007; Sat, 13 Dec 2008 22:05:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812132205.mBDM5kPZ041007@svn.freebsd.org> From: Alexander Motin Date: Sat, 13 Dec 2008 22:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186059 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 22:05:47 -0000 Author: mav Date: Sat Dec 13 22:05:46 2008 New Revision: 186059 URL: http://svn.freebsd.org/changeset/base/186059 Log: Remove node shutdown on tty close. This could be easily done by user-level while it's present implementation with ng_rmnode_flags() is at least incorrect. Modified: head/sys/netgraph/ng_tty.c Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Sat Dec 13 22:04:52 2008 (r186058) +++ head/sys/netgraph/ng_tty.c Sat Dec 13 22:05:46 2008 (r186059) @@ -114,7 +114,6 @@ static th_getc_poll_t ngt_getc_poll; static th_rint_t ngt_rint; static th_rint_bypass_t ngt_rint_bypass; static th_rint_poll_t ngt_rint_poll; -static th_close_t ngt_close; static struct ttyhook ngt_hook = { .th_getc_inject = ngt_getc_inject, @@ -122,7 +121,6 @@ static struct ttyhook ngt_hook = { .th_rint = ngt_rint, .th_rint_bypass = ngt_rint_bypass, .th_rint_poll = ngt_rint_poll, - .th_close = ngt_close, }; /* Netgraph node type descriptor */ @@ -515,12 +513,3 @@ ngt_rint_poll(struct tty *tp) return (1); } -static void -ngt_close(struct tty *tp) -{ - sc_p sc = ttyhook_softc(tp); - - /* Must be queued to drop the tty lock */ - ng_rmnode_flags(sc->node, NG_QUEUE); -} - From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 22:26:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E117F106564A; Sat, 13 Dec 2008 22:26:24 +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 D06A38FC14; Sat, 13 Dec 2008 22:26:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDMQOp9041411; Sat, 13 Dec 2008 22:26:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDMQOGR041409; Sat, 13 Dec 2008 22:26:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812132226.mBDMQOGR041409@svn.freebsd.org> From: Alexander Motin Date: Sat, 13 Dec 2008 22:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186060 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 22:26:25 -0000 Author: mav Date: Sat Dec 13 22:26:24 2008 New Revision: 186060 URL: http://svn.freebsd.org/changeset/base/186060 Log: Revert rev. 183277: Remove ng_rmnode_flags() function. ng_rmnode_self() was made to be called only while having node locked. When node is properly locked, any function call sent to it will always be queued. So turning ng_rmnode_self() into the ng_rmnode_flags() is not just meaningless, but incorrent, as it violates node locking when called outside. No objections: julian, thompsa Modified: head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/netgraph.h ============================================================================== --- head/sys/netgraph/netgraph.h Sat Dec 13 22:05:46 2008 (r186059) +++ head/sys/netgraph/netgraph.h Sat Dec 13 22:26:24 2008 (r186060) @@ -1130,7 +1130,6 @@ item_p ng_package_msg(struct ng_mesg *ms item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); void ng_replace_retaddr(node_p here, item_p item, ng_ID_t retaddr); int ng_rmhook_self(hook_p hook); /* if a node wants to kill a hook */ -int ng_rmnode_flags(node_p here, int flags); int ng_rmnode_self(node_p here); /* if a node wants to suicide */ int ng_rmtype(struct ng_type *tp); int ng_snd_item(item_p item, int queue); Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Sat Dec 13 22:05:46 2008 (r186059) +++ head/sys/netgraph/ng_base.c Sat Dec 13 22:26:24 2008 (r186060) @@ -1521,7 +1521,7 @@ ng_mkpeer(node_p node, const char *name, /* Shut this node down as soon as everyone is clear of it */ /* Should add arg "immediately" to jump the queue */ int -ng_rmnode_flags(node_p node, int flags) +ng_rmnode_self(node_p node) { int error; @@ -1531,16 +1531,10 @@ ng_rmnode_flags(node_p node, int flags) if (node->nd_flags & NGF_CLOSING) return (0); - error = ng_send_fn1(node, NULL, &ng_rmnode, NULL, 0, flags); + error = ng_send_fn(node, NULL, &ng_rmnode, NULL, 0); return (error); } -int -ng_rmnode_self(node_p node) -{ - return (ng_rmnode_flags(node, NG_NOFLAGS)); -} - static void ng_rmhook_part2(node_p node, hook_p hook, void *arg1, int arg2) { From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 22:41:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0432F106567B; Sat, 13 Dec 2008 22:41:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7B218FC1C; Sat, 13 Dec 2008 22:41:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDMfaa8041793; Sat, 13 Dec 2008 22:41:36 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDMfafi041792; Sat, 13 Dec 2008 22:41:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812132241.mBDMfafi041792@svn.freebsd.org> From: Andrew Thompson Date: Sat, 13 Dec 2008 22:41: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: r186061 - 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: Sat, 13 Dec 2008 22:41:37 -0000 Author: thompsa Date: Sat Dec 13 22:41:36 2008 New Revision: 186061 URL: http://svn.freebsd.org/changeset/base/186061 Log: Dont leak the rnh lock on error. Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Dec 13 22:26:24 2008 (r186060) +++ head/sys/net/rtsock.c Sat Dec 13 22:41:36 2008 (r186061) @@ -673,10 +673,10 @@ route_output(struct mbuf *m, struct sock rt->rt_ifa->ifa_addr))) { RT_UNLOCK(rt); RADIX_NODE_HEAD_LOCK(rnh); - if ((error = rt_getifa_fib(&info, - rt->rt_fibnum)) != 0) - senderr(error); + error = rt_getifa_fib(&info, rt->rt_fibnum); RADIX_NODE_HEAD_UNLOCK(rnh); + if (error != 0) + senderr(error); RT_LOCK(rt); } if (info.rti_ifa != NULL && From owner-svn-src-head@FreeBSD.ORG Sat Dec 13 23:28:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF9AC1065670; Sat, 13 Dec 2008 23:28:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 964098FC14; Sat, 13 Dec 2008 23:28:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDNSB1D043015; Sat, 13 Dec 2008 23:28:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDNSBoN043014; Sat, 13 Dec 2008 23:28:11 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200812132328.mBDNSBoN043014@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Dec 2008 23:28: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: r186066 - head/contrib/openpam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Dec 2008 23:28:11 -0000 Author: des Date: Sat Dec 13 23:28:11 2008 New Revision: 186066 URL: http://svn.freebsd.org/changeset/base/186066 Log: Bootstrap mergeinfo Modified: head/contrib/openpam/ (props changed)