From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 00:15:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CC5E106566C; Sun, 20 Sep 2009 00:15:53 +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 69FB88FC13; Sun, 20 Sep 2009 00:15:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8K0FroN038905; Sun, 20 Sep 2009 00:15:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8K0Fr7o038903; Sun, 20 Sep 2009 00:15:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909200015.n8K0Fr7o038903@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 00:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197335 - in stable/7/sys: . contrib/pf sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 00:15:53 -0000 Author: marius Date: Sun Sep 20 00:15:52 2009 New Revision: 197335 URL: http://svn.freebsd.org/changeset/base/197335 Log: MFC: r191980 - Fix style. - Use __FBSDID. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/sparc64/sparc64/vm_machdep.c Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/vm_machdep.c Sat Sep 19 21:46:12 2009 (r197334) +++ stable/7/sys/sparc64/sparc64/vm_machdep.c Sun Sep 20 00:15:52 2009 (r197335) @@ -39,23 +39,26 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * from: FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.167 2001/07/12 - * $FreeBSD$ + * from: FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.167 2001/07/12 */ +#include +__FBSDID("$FreeBSD$"); + #include "opt_pmap.h" #include #include -#include -#include #include #include #include #include +#include #include #include +#include #include +#include #include #include #include @@ -73,12 +76,12 @@ #include #include -#include #include +#include #include #include -#include #include +#include #include #include #include @@ -94,7 +97,7 @@ static void sf_buf_init(void *arg); SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); /* - * Expanded sf_freelist head. Really an SLIST_HEAD() in disguise, with the + * Expanded sf_freelist head. Really an SLIST_HEAD() in disguise, with the * sf_freelist head with the sf_lock mutex. */ static struct { @@ -124,11 +127,13 @@ cpu_exit(struct thread *td) void cpu_thread_exit(struct thread *td) { + } void cpu_thread_clean(struct thread *td) { + } void @@ -146,16 +151,19 @@ cpu_thread_alloc(struct thread *td) void cpu_thread_free(struct thread *td) { + } - + void cpu_thread_swapin(struct thread *td) { + } void cpu_thread_swapout(struct thread *td) { + } void @@ -328,6 +336,7 @@ cpu_reset(void) 0, (cell_t)bspec }; + if ((chosen = OF_finddevice("/chosen")) != 0) { if (OF_getprop(chosen, "bootpath", bspec, sizeof(bspec)) == -1) bspec[0] = '\0'; @@ -392,7 +401,7 @@ sf_buf_init(void *arg) } /* - * Get an sf_buf from the freelist. Will block if none are available. + * Get an sf_buf from the freelist. Will block if none are available. */ struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) @@ -411,7 +420,7 @@ sf_buf_alloc(struct vm_page *m, int flag sf_buf_alloc_want--; /* - * If we got a signal, don't risk going back to sleep. + * If we got a signal, don't risk going back to sleep. */ if (error) break; From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 00:51:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2341D1065670; Sun, 20 Sep 2009 00:51:49 +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 10E868FC15; Sun, 20 Sep 2009 00:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8K0pmvM039594; Sun, 20 Sep 2009 00:51:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8K0pmG6039592; Sun, 20 Sep 2009 00:51:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909200051.n8K0pmG6039592@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 00:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197336 - in stable/7/sys: . contrib/pf sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 00:51:49 -0000 Author: marius Date: Sun Sep 20 00:51:48 2009 New Revision: 197336 URL: http://svn.freebsd.org/changeset/base/197336 Log: MFC: r191981 Just like in cpu_halt(), use cpu_shutdown() rather than ofw_exit() directly in cpu_reset() in order to idle the APs before exiting the kernel and letting the BSP enter the firmware so that processes like init(8) which still might be running on an AP at that point don't cause a panic there when it crashes due to the fact it no longer can be supported by the kernel. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/sparc64/sparc64/vm_machdep.c Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/vm_machdep.c Sun Sep 20 00:15:52 2009 (r197335) +++ stable/7/sys/sparc64/sparc64/vm_machdep.c Sun Sep 20 00:51:48 2009 (r197336) @@ -343,7 +343,7 @@ cpu_reset(void) bspec[sizeof(bspec) - 1] = '\0'; } - openfirmware_exit(&args); + cpu_shutdown(&args); } /* From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 00:54:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6151065672; Sun, 20 Sep 2009 00:54:52 +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 489058FC14; Sun, 20 Sep 2009 00:54:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8K0spno039704; Sun, 20 Sep 2009 00:54:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8K0spCi039701; Sun, 20 Sep 2009 00:54:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909200054.n8K0spCi039701@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 00:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197337 - in stable/7/sys: . contrib/pf dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 00:54:52 -0000 Author: marius Date: Sun Sep 20 00:54:51 2009 New Revision: 197337 URL: http://svn.freebsd.org/changeset/base/197337 Log: MFC: r194134 - Also probe DP83865, which is an is an ultra low power version of the DP83861 and DP83891. - Reset the PHY during attach so it's in a known state. - Add a comment describing why we hardwire 10baseT support in the BMSR. - Always explicitly set IFM_HDX for half-duplex. [1] Obtained from: OpenBSD [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mii/miidevs stable/7/sys/dev/mii/nsgphy.c Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Sun Sep 20 00:51:48 2009 (r197336) +++ stable/7/sys/dev/mii/miidevs Sun Sep 20 00:54:51 2009 (r197337) @@ -197,6 +197,7 @@ model NATSEMI DP83815 0x0002 DP83815 10 model NATSEMI DP83847 0x0003 DP83847 10/100 media interface model NATSEMI DP83891 0x0005 DP83891 10/100/1000 media interface model NATSEMI DP83861 0x0006 DP83861 10/100/1000 media interface +model NATSEMI DP83865 0x0007 DP83865 10/100/1000 media interface /* Quality Semiconductor PHYs */ model QUALSEMI QS6612 0x0000 QS6612 10/100 media interface Modified: stable/7/sys/dev/mii/nsgphy.c ============================================================================== --- stable/7/sys/dev/mii/nsgphy.c Sun Sep 20 00:51:48 2009 (r197336) +++ stable/7/sys/dev/mii/nsgphy.c Sun Sep 20 00:54:51 2009 (r197337) @@ -41,17 +41,19 @@ __FBSDID("$FreeBSD$"); /* - * Driver for the National Semiconductor DP83891 and DP83861 + * Driver for the National Semiconductor DP83861, DP83865 and DP83891 * 10/100/1000 PHYs. * Datasheet available at: http://www.national.com/ds/DP/DP83861.pdf + * and at: http://www.national.com/ds/DP/DP83865.pdf * - * The DP83891 is the older NatSemi gigE PHY which isn't being sold - * anymore. The DP83861 is its replacement, which is an 'enhanced' - * firmware driven component. The major difference between the - * two is that the 83891 can't generate interrupts, while the - * 83861 can. (I think it wasn't originally designed to do this, but - * it can now thanks to firmware updates.) The 83861 also allows - * access to its internal RAM via indirect register access. + * The DP83891 is the older NS GigE PHY which isn't being sold + * anymore. The DP83861 is its replacement, which is an 'enhanced' + * firmware driven component. The major difference between the + * two is that the DP83891 can't generate interrupts, while the + * 83861 can (probably it wasn't originally designed to do this, but + * it can now thanks to firmware updates). The DP83861 also allows + * access to its internal RAM via indirect register access. The + * DP83865 is an ultra low power version of the DP83861 and DP83891. */ #include @@ -99,6 +101,7 @@ static void nsgphy_status(struct mii_sof static const struct mii_phydesc nsgphys[] = { MII_PHY_DESC(NATSEMI, DP83861), + MII_PHY_DESC(NATSEMI, DP83865), MII_PHY_DESC(NATSEMI, DP83891), MII_PHY_END }; @@ -133,8 +136,14 @@ nsgphy_attach(device_t dev) mii->mii_instance++; + mii_phy_reset(sc); + + /* + * NB: the PHY has the 10baseT BMSR bits hard-wired to 0, + * even though it supports 10baseT. + */ sc->mii_capabilities = (PHY_READ(sc, MII_BMSR) | - (BMSR_10TFDX|BMSR_10THDX)) & ma->mii_capmask; + (BMSR_10TFDX | BMSR_10THDX)) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); @@ -238,7 +247,7 @@ nsgphy_status(struct mii_softc *sc) return; } - switch (physup & (PHY_SUP_SPEED1|PHY_SUP_SPEED0)) { + switch (physup & (PHY_SUP_SPEED1 | PHY_SUP_SPEED0)) { case PHY_SUP_SPEED1: mii->mii_media_active |= IFM_1000_T; gtsr = PHY_READ(sc, MII_100T2SR); @@ -257,9 +266,13 @@ nsgphy_status(struct mii_softc *sc) default: mii->mii_media_active |= IFM_NONE; mii->mii_media_status = 0; + return; } + if (physup & PHY_SUP_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 04:59:35 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78ADC1065670; Sun, 20 Sep 2009 04:59:35 +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 354628FC0A; Sun, 20 Sep 2009 04:59:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8K4x8Af057380; Sat, 19 Sep 2009 22:59:08 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 19 Sep 2009 23:00:53 -0600 (MDT) Message-Id: <20090919.230053.58383965.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4AB495DD.1010006@FreeBSD.org> References: <4AB35086.90502@FreeBSD.org> <4AB495DD.1010006@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, rmacklem@FreeBSD.org, svn-src-all@FreeBSD.org, rmacklem@uoguelph.ca, src-committers@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 04:59:35 -0000 In message: <4AB495DD.1010006@FreeBSD.org> John Baldwin writes: : Rick Macklem wrote: : > : > : > On Fri, 18 Sep 2009, John Baldwin wrote: : > : >> Rick Macklem wrote: : >>> Author: rmacklem : >>> Date: Thu Sep 17 19:08:15 2009 : >>> New Revision: 197298 : >>> URL: http://svn.freebsd.org/changeset/base/197298 : >>> : >>> Log: : >>> Change the default transport protocol for use by the Mount protocol : >>> from UDP to TCP, so that it is consistent with TCP for NFS, which : >>> became the default at r176198. Without this change, doing an NFS mount : >>> against a server that only supports UDP would result in an unusable : >>> mount point if a transport protocol option wasn't specified for the : >>> mount. : >>> Approved by: kib (mentor) : >>> MFC after: 3 days : >> : >> Does this still use UDP for the mount protocol for a UDP mount? : >> : > Yep. If "udp" is specified, everything uses "udp". The only case : > affected by the change was when neither "udp" nor "tcp" were specified : > as options. : : Ok. : : > It happens that it still uses UDP for Portmapper by default and when : > "tcp" is specified, but that is down inside the libc functions and there : > are comments in them along the lines of "always use UDP first...", so : > I don't intend to change those. : : Hmm, it might actually be nice to be able to change those at some point : as well. I have looked at this in the past and it is quite deeply : buried in libc. :-/ What's the benefit for forcing a tcp connection for the portmapper RPCs? They just happen once at startup... Warner From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 05:04:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DF9106566B; Sun, 20 Sep 2009 05:04: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 465B88FC12; Sun, 20 Sep 2009 05:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8K54OAq044528; Sun, 20 Sep 2009 05:04:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8K54OlP044525; Sun, 20 Sep 2009 05:04:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200909200504.n8K54OlP044525@svn.freebsd.org> From: Warner Losh Date: Sun, 20 Sep 2009 05:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197338 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 05:04:24 -0000 Author: imp Date: Sun Sep 20 05:04:23 2009 New Revision: 197338 URL: http://svn.freebsd.org/changeset/base/197338 Log: Add Neelkanth Natu. He'll be doing MIPS things. I'm his mentor. Approved by: core@ Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Sep 20 00:54:51 2009 (r197337) +++ svnadmin/conf/access Sun Sep 20 05:04:23 2009 (r197338) @@ -151,6 +151,7 @@ mtm murray mux n_hibma devnull +neel netchild nork np Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Sep 20 00:54:51 2009 (r197337) +++ svnadmin/conf/mentors Sun Sep 20 05:04:23 2009 (r197338) @@ -17,6 +17,7 @@ fabient jkoshy ivoras gnn jinmei gnn lstewart gnn +neel imp nork imp np gnn rdivacky ed From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 05:36:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77A191065672 for ; Sun, 20 Sep 2009 05:36:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 2277F8FC18 for ; Sun, 20 Sep 2009 05:36:16 +0000 (UTC) Received: (qmail 5076 invoked by uid 399); 20 Sep 2009 05:36:12 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 20 Sep 2009 05:36:12 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AB5BF46.9040006@FreeBSD.org> Date: Sat, 19 Sep 2009 22:36:06 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Alan Cox References: <200909191801.n8JI1Wq8031864@svn.freebsd.org> In-Reply-To: <200909191801.n8JI1Wq8031864@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197331 - in head: lib/libc/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 05:36:17 -0000 I'm getting this even after 'make cleandir': cc -O2 -pipe -g -I/usr/local/src/lib/libc/include -I/usr/local/src/lib/libc/../../include -I/usr/local/src/lib/libc/i386 -DNLS -D__DBINTERFACE_PRIVATE -I/usr/local/src/lib/libc/../../contrib/gdtoa -DINET6 -I/usr/local/obj/usr/local/src/lib/libc -I/usr/local/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/local/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/local/src/lib/libc/rpc -DNS_CACHING -DSYMBOL_VERSIONING -g -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/local/src/lib/libc/gen/getpagesizes.c /usr/local/src/lib/libc/gen/getpagesizes.c: In function 'getpagesizes': /usr/local/src/lib/libc/gen/getpagesizes.c:51: error: 'MAXPAGESIZES' undeclared (first use in this function) /usr/local/src/lib/libc/gen/getpagesizes.c:51: error: (Each undeclared identifier is reported only once /usr/local/src/lib/libc/gen/getpagesizes.c:51: error: for each function it appears in.) cc1: warnings being treated as errors /usr/local/src/lib/libc/gen/getpagesizes.c:51: warning: unused variable 'ps' *** Error code 1 Stop in /usr/local/src/lib/libc. Anything I'm missing? Doug Alan Cox wrote: > Author: alc > Date: Sat Sep 19 18:01:32 2009 > New Revision: 197331 > URL: http://svn.freebsd.org/changeset/base/197331 > > Log: > Add getpagesizes(3). This functions either the number of supported page > sizes or some number of the sizes themselves. It is functionally > compatible with a function by the same name under Solaris. > > Reviewed by: jhb > > Added: > head/lib/libc/gen/getpagesizes.3 (contents, props changed) > head/lib/libc/gen/getpagesizes.c (contents, props changed) > Modified: > head/lib/libc/gen/Makefile.inc > head/lib/libc/gen/Symbol.map > head/sys/sys/mman.h > > Modified: head/lib/libc/gen/Makefile.inc > ============================================================================== > --- head/lib/libc/gen/Makefile.inc Sat Sep 19 17:56:26 2009 (r197330) > +++ head/lib/libc/gen/Makefile.inc Sat Sep 19 18:01:32 2009 (r197331) > @@ -15,7 +15,7 @@ SRCS+= __getosreldate.c __xuname.c \ > getbootfile.c getbsize.c \ > getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ > gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \ > - getosreldate.c getpagesize.c \ > + getosreldate.c getpagesize.c getpagesizes.c \ > getpeereid.c getprogname.c getpwent.c getttyent.c \ > getusershell.c getvfsbyname.c glob.c \ > initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ > @@ -51,8 +51,8 @@ MAN+= alarm.3 arc4random.3 \ > getbootfile.3 getbsize.3 getcap.3 getcontext.3 getcwd.3 \ > getdiskbyname.3 getdomainname.3 getfsent.3 \ > getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \ > - getmntinfo.3 getnetgrent.3 getosreldate.3 \ > - getpagesize.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \ > + getmntinfo.3 getnetgrent.3 getosreldate.3 getpagesize.3 \ > + getpagesizes.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \ > getttyent.3 getusershell.3 getvfsbyname.3 \ > glob.3 initgroups.3 isgreater.3 ldexp.3 lockf.3 makecontext.3 \ > modf.3 \ > > Modified: head/lib/libc/gen/Symbol.map > ============================================================================== > --- head/lib/libc/gen/Symbol.map Sat Sep 19 17:56:26 2009 (r197330) > +++ head/lib/libc/gen/Symbol.map Sat Sep 19 18:01:32 2009 (r197331) > @@ -366,6 +366,10 @@ FBSD_1.1 { > tcsetsid; > }; > > +FBSD_1.2 { > + getpagesizes; > +}; > + > FBSDprivate_1.0 { > /* needed by thread libraries */ > __thr_jtable; > > Added: head/lib/libc/gen/getpagesizes.3 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/gen/getpagesizes.3 Sat Sep 19 18:01:32 2009 (r197331) > @@ -0,0 +1,98 @@ > +.\" Copyright (c) 2009 Alan L. Cox > +.\" 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 September 19, 2009 > +.Dt GETPAGESIZES 3 > +.Os > +.Sh NAME > +.Nm getpagesizes > +.Nd "get system page sizes" > +.Sh LIBRARY > +.Lb libc > +.Sh SYNOPSIS > +.In sys/mman.h > +.Ft int > +.Fn getpagesizes "size_t pagesize[]" "int nelem" > +.Sh DESCRIPTION > +The > +.Fn getpagesizes > +function retrieves page size information from the system. > +When it is called with > +.Fa pagesize > +specified as > +.Dv NULL > +and > +.Fa nelem > +specified as 0, it returns the number of distinct page sizes that are > +supported by the system. > +Otherwise, it assigns up to > +.Fa nelem > +of the system-supported page sizes to consecutive elements of the > +array referenced by > +.Fa pagesize . > +These page sizes are expressed in bytes. > +In this case, > +.Fn getpagesizes > +returns the number of such page sizes that it assigned to the array. > +.Sh RETURN VALUES > +If successful, the > +.Fn getpagesizes > +function returns either the number of page sizes that are supported by > +the system or the number of supported page sizes that it assigned to > +the array referenced by > +.Fa pagesize . > +Otherwise, it returns the value\~\-1 and sets > +.Va errno > +to indicate the error. > +.Sh ERRORS > +The > +.Fn getpagesizes > +function will succeed unless: > +.Bl -tag -width Er > +.It Bq Er EINVAL > +The > +.Fa pagesize > +argument is > +.Dv NULL > +and the > +.Fa nelem > +argument is non-zero. > +.It Bq Er EINVAL > +The > +.Fa nelem > +argument is less than zero. > +.El > +.Sh SEE ALSO > +.Xr getpagesize 3 > +.Sh HISTORY > +The > +.Fn getpagesizes > +function first appeared in Solaris 9. > +This manual page was written in conjunction with a new but compatible > +implementation that was first released in > +.Fx 7.3 . > +.Sh AUTHOR > +.An Alan L. Cox Aq alc@cs.rice.edu > > Added: head/lib/libc/gen/getpagesizes.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/gen/getpagesizes.c Sat Sep 19 18:01:32 2009 (r197331) > @@ -0,0 +1,78 @@ > +/*- > + * Copyright (c) 2009 Alan L. Cox > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > + > +#include > + > +/* > + * Retrieves page size information from the system. Specifically, returns the > + * number of distinct page sizes that are supported by the system, if > + * "pagesize" is NULL and "nelem" is 0. Otherwise, assigns up to "nelem" of > + * the system-supported page sizes to consecutive elements of the array > + * referenced by "pagesize", and returns the number of such page sizes that it > + * assigned to the array. These page sizes are expressed in bytes. > + * > + * The implementation of this function does not directly or indirectly call > + * malloc(3) or any other dynamic memory allocator that may itself call this > + * function. > + */ > +int > +getpagesizes(size_t pagesize[], int nelem) > +{ > + static u_long ps[MAXPAGESIZES]; > + static int nops; > + size_t size; > + int i; > + > + if (nelem < 0 || (nelem > 0 && pagesize == NULL)) { > + errno = EINVAL; > + return (-1); > + } > + /* Cache the result of the sysctl(2). */ > + if (nops == 0) { > + size = sizeof(ps); > + if (sysctlbyname("hw.pagesizes", ps, &size, NULL, 0) == -1) > + return (-1); > + /* Count the number of page sizes that are supported. */ > + nops = size / sizeof(ps[0]); > + while (nops > 0 && ps[nops - 1] == 0) > + nops--; > + } > + if (pagesize == NULL) > + return (nops); > + /* Return up to "nelem" page sizes from the cached result. */ > + if (nelem > nops) > + nelem = nops; > + for (i = 0; i < nelem; i++) > + pagesize[i] = ps[i]; > + return (nelem); > +} > > Modified: head/sys/sys/mman.h > ============================================================================== > --- head/sys/sys/mman.h Sat Sep 19 17:56:26 2009 (r197330) > +++ head/sys/sys/mman.h Sat Sep 19 18:01:32 2009 (r197331) > @@ -208,6 +208,7 @@ __BEGIN_DECLS > * posix_typed_mem_open(). > */ > #if __BSD_VISIBLE > +int getpagesizes(size_t *, int); > int madvise(void *, size_t, int); > int mincore(const void *, size_t, char *); > int minherit(void *, size_t, int); > -- This .signature sanitized for your protection From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 05:51:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CB110656A4; Sun, 20 Sep 2009 05:51:09 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id C118A8FC12; Sun, 20 Sep 2009 05:51:09 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 00D012C2D2F; Sun, 20 Sep 2009 00:51:09 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id x+x5gBIblvjL; Sun, 20 Sep 2009 00:51:01 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id ED22E2C2CB6; Sun, 20 Sep 2009 00:51:00 -0500 (CDT) Message-ID: <4AB5C2C4.2010405@cs.rice.edu> Date: Sun, 20 Sep 2009 00:51:00 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Doug Barton References: <200909191801.n8JI1Wq8031864@svn.freebsd.org> <4AB5BF46.9040006@FreeBSD.org> In-Reply-To: <4AB5BF46.9040006@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197331 - in head: lib/libc/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 05:51:10 -0000 Doug Barton wrote: > I'm getting this even after 'make cleandir': > > cc -O2 -pipe -g -I/usr/local/src/lib/libc/include > -I/usr/local/src/lib/libc/../../include -I/usr/local/src/lib/libc/i386 > -DNLS -D__DBINTERFACE_PRIVATE > -I/usr/local/src/lib/libc/../../contrib/gdtoa -DINET6 > -I/usr/local/obj/usr/local/src/lib/libc > -I/usr/local/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE > -I/usr/local/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN > -I/usr/local/src/lib/libc/rpc -DNS_CACHING -DSYMBOL_VERSIONING -g > -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall > -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c > /usr/local/src/lib/libc/gen/getpagesizes.c > /usr/local/src/lib/libc/gen/getpagesizes.c: In function 'getpagesizes': > /usr/local/src/lib/libc/gen/getpagesizes.c:51: error: 'MAXPAGESIZES' > undeclared (first use in this function) > /usr/local/src/lib/libc/gen/getpagesizes.c:51: error: (Each undeclared > identifier is reported only once > /usr/local/src/lib/libc/gen/getpagesizes.c:51: error: for each > function it appears in.) > cc1: warnings being treated as errors > /usr/local/src/lib/libc/gen/getpagesizes.c:51: warning: unused > variable 'ps' > *** Error code 1 > > Stop in /usr/local/src/lib/libc. > > > Anything I'm missing? > > I think that you need to update your includes directory. I added MAXPAGESIZES to the machine-specific param.h yesterday. Regards, Alan From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 06:47:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 714B5106566C for ; Sun, 20 Sep 2009 06:47:03 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 04B558FC0A for ; Sun, 20 Sep 2009 06:47:02 +0000 (UTC) Received: (qmail 32457 invoked by uid 399); 20 Sep 2009 06:47:01 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 20 Sep 2009 06:47:01 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AB5CFDD.4080107@FreeBSD.org> Date: Sat, 19 Sep 2009 23:46:53 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 References: <200909191801.n8JI1Wq8031864@svn.freebsd.org> <4AB5BF46.9040006@FreeBSD.org> <4AB5C2C4.2010405@cs.rice.edu> In-Reply-To: <4AB5C2C4.2010405@cs.rice.edu> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197331 - in head: lib/libc/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 06:47:03 -0000 Alan Cox wrote: > I think that you need to update your includes directory. I added > MAXPAGESIZES to the machine-specific param.h yesterday. Indeed, I hadn't done a full buildworld in a while, sorry for the noise. Doug -- This .signature sanitized for your protection From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 11:32:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF09106566B; Sun, 20 Sep 2009 11:32:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3FC88FC13; Sun, 20 Sep 2009 11:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KBWMoC055081; Sun, 20 Sep 2009 11:32:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KBWMVA055079; Sun, 20 Sep 2009 11:32:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909201132.n8KBWMVA055079@svn.freebsd.org> From: Michael Tuexen Date: Sun, 20 Sep 2009 11:32: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: r197341 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 11:32:22 -0000 Author: tuexen Date: Sun Sep 20 11:32:22 2009 New Revision: 197341 URL: http://svn.freebsd.org/changeset/base/197341 Log: Fix errnos. Approved by: rrs(mentor) MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Sep 20 05:31:42 2009 (r197340) +++ head/sys/netinet/sctp_output.c Sun Sep 20 11:32:22 2009 (r197341) @@ -12384,8 +12384,8 @@ sctp_lower_sosend(struct socket *so, t_inp = inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); - error = EFAULT; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; if (i_pak) { SCTP_RELEASE_PKT(i_pak); } @@ -12432,8 +12432,8 @@ sctp_lower_sosend(struct socket *so, if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_socket->so_qlimit)) { /* The listener can NOT send */ - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); - error = EFAULT; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); + error = ENOTCONN; goto out_unlocked; } if ((use_rcvinfo) && srcv) { @@ -12566,8 +12566,8 @@ sctp_lower_sosend(struct socket *so, if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { /* Should I really unlock ? */ - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); - error = EFAULT; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; goto out_unlocked; } @@ -12596,6 +12596,12 @@ sctp_lower_sosend(struct socket *so, } } if (stcb == NULL) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); + error = ENOTCONN; + goto out_unlocked; + } if (addr == NULL) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOENT); error = ENOENT; From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 11:33:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118A0106566B; Sun, 20 Sep 2009 11:33:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0080C8FC17; Sun, 20 Sep 2009 11:33:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KBXdPG055153; Sun, 20 Sep 2009 11:33:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KBXdsB055151; Sun, 20 Sep 2009 11:33:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909201133.n8KBXdsB055151@svn.freebsd.org> From: Michael Tuexen Date: Sun, 20 Sep 2009 11:33: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: r197342 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 11:33:40 -0000 Author: tuexen Date: Sun Sep 20 11:33:39 2009 New Revision: 197342 URL: http://svn.freebsd.org/changeset/base/197342 Log: Fix handling of sctp_drain(). Approved by: rrs (mentor) MFC after: 2 month Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Sep 20 11:32:22 2009 (r197341) +++ head/sys/netinet/sctp_pcb.c Sun Sep 20 11:33:39 2009 (r197342) @@ -6585,17 +6585,20 @@ sctp_drain() * occur. We really hope this does NOT happen! */ VNET_ITERATOR_DECL(vnet_iter); - - SCTP_STAT_INCR(sctps_protocol_drain_calls); - if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { - return; - } VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); struct sctp_inpcb *inp; struct sctp_tcb *stcb; + SCTP_STAT_INCR(sctps_protocol_drain_calls); + if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { +#ifdef VIMAGE + continue; +#else + return; +#endif + } SCTP_INP_INFO_RLOCK(); LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { /* For each endpoint */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:08:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DE2B106566C; Sun, 20 Sep 2009 12:08:30 +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 49D8A8FC23; Sun, 20 Sep 2009 12:08:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KC8UrT055806; Sun, 20 Sep 2009 12:08:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KC8U0i055798; Sun, 20 Sep 2009 12:08:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201208.n8KC8U0i055798@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 12:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197343 - in stable/7/sys: . boot/forth conf contrib/pf dev/cas modules modules/cas sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:08:30 -0000 Author: marius Date: Sun Sep 20 12:08:29 2009 New Revision: 197343 URL: http://svn.freebsd.org/changeset/base/197343 Log: MFC: 194246, 194904, 194973 Add cas(4), a driver for Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn Gigabit Ethernet controllers. These are the successors of the Sun GEM controllers and still have a similar but extended transmit logic. As such this driver is based on gem(4). Thanks to marcel@ for providing a Sun Quad GigaSwift Ethernet UTP (QGE) card which was vital for getting this driver to work on architectures not using Open Firmware. Added: stable/7/sys/dev/cas/ - copied from r194246, head/sys/dev/cas/ stable/7/sys/modules/cas/ - copied from r194246, head/sys/modules/cas/ Modified: stable/7/sys/ (props changed) stable/7/sys/boot/forth/loader.conf stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cas/if_cas.c stable/7/sys/dev/cas/if_casvar.h stable/7/sys/modules/Makefile stable/7/sys/sparc64/conf/GENERIC Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Sun Sep 20 11:33:39 2009 (r197342) +++ stable/7/sys/boot/forth/loader.conf Sun Sep 20 12:08:29 2009 (r197343) @@ -220,6 +220,7 @@ if_axe_load="NO" # ASIX Electronics AX8 if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) if_cs_load="NO" # Crystal Semiconductor CS8920 if_cue_load="NO" # CATC USB-EL1210A USB Ethernet Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Sun Sep 20 11:33:39 2009 (r197342) +++ stable/7/sys/conf/NOTES Sun Sep 20 12:08:29 2009 (r197343) @@ -1733,6 +1733,7 @@ device miibus # BCM570x family of controllers, including the 3Com 3c996-T, # the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and # the embedded gigE NICs on Dell PowerEdge 2550 servers. +# cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cnw: Xircom CNW/Netware Airsurfer PC Card adapter @@ -1875,6 +1876,7 @@ device ale # Atheros AR8121/AR8113/AR8 device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn device cxgb # Chelsio T3 10 Gigabit Ethernet device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Sun Sep 20 11:33:39 2009 (r197342) +++ stable/7/sys/conf/files Sun Sep 20 12:08:29 2009 (r197343) @@ -671,6 +671,7 @@ dev/buslogic/bt_pci.c optional bt pci dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus +dev/cas/if_cas.c optional cas dev/ciss/ciss.c optional ciss dev/cm/smc90cx6.c optional cm dev/cmx/cmx.c optional cmx Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Mon Jun 15 18:22:41 2009 (r194246) +++ stable/7/sys/dev/cas/if_cas.c Sun Sep 20 12:08:29 2009 (r197343) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -135,7 +135,8 @@ static void cas_free(void *arg1, void* a static void cas_init(void *xsc); static void cas_init_locked(struct cas_softc *sc); static void cas_init_regs(struct cas_softc *sc); -static void cas_intr(void *v); +static int cas_intr(void *v); +static void cas_intr_task(void *arg, int pending __unused); static int cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int cas_load_txmbuf(struct cas_softc *sc, struct mbuf **m_head); static int cas_mediachange(struct ifnet *ifp); @@ -159,13 +160,13 @@ static void cas_rxdma_callback(void *xsc int nsegs, int error); static void cas_setladrf(struct cas_softc *sc); static void cas_start(struct ifnet *ifp); -static void cas_start_locked(struct ifnet *ifp); static void cas_stop(struct ifnet *ifp); static void cas_suspend(struct cas_softc *sc); static void cas_tick(void *arg); static void cas_tint(struct cas_softc *sc); +static void cas_tx_task(void *arg, int pending __unused); static inline void cas_txkick(struct cas_softc *sc); -static int cas_watchdog(struct cas_softc *sc); +static void cas_watchdog(struct cas_softc *sc); static devclass_t cas_devclass; @@ -201,7 +202,19 @@ cas_attach(struct cas_softc *sc) IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); - callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); + callout_init(&sc->sc_rx_ch, 1); + /* Create local taskq. */ + TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc); + TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); + sc->sc_tq = taskqueue_create_fast("cas_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->sc_tq); + if (sc->sc_tq == NULL) { + device_printf(sc->sc_dev, "could not create taskqueue\n"); + error = ENXIO; + goto fail_ifnet; + } + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->sc_dev)); /* Make sure the chip is stopped. */ cas_reset(sc); @@ -211,7 +224,7 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_MAXSIZE, 0, BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_pdmatag); if (error != 0) - goto fail_ifnet; + goto fail_taskq; error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, @@ -422,6 +435,8 @@ cas_attach(struct cas_softc *sc) bus_dma_tag_destroy(sc->sc_rdmatag); fail_ptag: bus_dma_tag_destroy(sc->sc_pdmatag); + fail_taskq: + taskqueue_free(sc->sc_tq); fail_ifnet: if_free(ifp); return (error); @@ -433,13 +448,16 @@ cas_detach(struct cas_softc *sc) struct ifnet *ifp = sc->sc_ifp; int i; + ether_ifdetach(ifp); CAS_LOCK(sc); cas_stop(ifp); CAS_UNLOCK(sc); callout_drain(&sc->sc_tick_ch); callout_drain(&sc->sc_rx_ch); - ether_ifdetach(ifp); + taskqueue_drain(sc->sc_tq, &sc->sc_intr_task); + taskqueue_drain(sc->sc_tq, &sc->sc_tx_task); if_free(ifp); + taskqueue_free(sc->sc_tq); device_delete_child(sc->sc_dev, sc->sc_miibus); for (i = 0; i < CAS_NRXDESC; i++) @@ -586,12 +604,11 @@ static void cas_tick(void *arg) { struct cas_softc *sc = arg; - struct ifnet *ifp; + struct ifnet *ifp = sc->sc_ifp; uint32_t v; CAS_LOCK_ASSERT(sc, MA_OWNED); - ifp = sc->sc_ifp; /* * Unload collision and error counters. */ @@ -622,8 +639,10 @@ cas_tick(void *arg) mii_tick(sc->sc_mii); - if (cas_watchdog(sc) == EJUSTRETURN) - return; + if (sc->sc_txfree != CAS_MAXTXFREE) + cas_tint(sc); + + cas_watchdog(sc); callout_reset(&sc->sc_tick_ch, hz, cas_tick, sc); } @@ -915,6 +934,9 @@ cas_init_locked(struct cas_softc *sc) CAS_LOCK_ASSERT(sc, MA_OWNED); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + #ifdef CAS_DEBUG CTR2(KTR_CAS, "%s: %s: calling stop", device_get_name(sc->sc_dev), __func__); @@ -994,7 +1016,7 @@ cas_init_locked(struct cas_softc *sc) /* Set up interrupts. */ CAS_WRITE_4(sc, CAS_INTMASK, - ~(CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_TAG_ERR | + ~(CAS_INTR_TX_INT_ME | CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_DONE | CAS_INTR_RX_BUF_NA | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_COMP_FULL | CAS_INTR_RX_BUF_AEMPTY | CAS_INTR_RX_COMP_AFULL | CAS_INTR_RX_LEN_MMATCH | @@ -1003,6 +1025,8 @@ cas_init_locked(struct cas_softc *sc) | CAS_INTR_PCS_INT | CAS_INTR_MIF #endif )); + /* Don't clear top level interrupts when CAS_STATUS_ALIAS is read. */ + CAS_WRITE_4(sc, CAS_CLEAR_ALIAS, 0); CAS_WRITE_4(sc, CAS_MAC_RX_MASK, ~CAS_MAC_RX_OVERFLOW); CAS_WRITE_4(sc, CAS_MAC_TX_MASK, ~(CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)); @@ -1240,7 +1264,7 @@ cas_load_txmbuf(struct cas_softc *sc, st CTR3(KTR_CAS, "%s: start of frame at segment %d, TX %d", __func__, seg, nexttx); #endif - if (sc->sc_txwin += nsegs > CAS_NTXSEGS * 2 / 3) { + if (sc->sc_txwin += nsegs > CAS_MAXTXFREE * 2 / 3) { sc->sc_txwin = 0; sc->sc_txdescs[txs->txs_firstdesc].cd_flags |= htole64(cflags | CAS_TD_START_OF_FRAME | CAS_TD_INT_ME); @@ -1351,13 +1375,12 @@ cas_init_regs(struct cas_softc *sc) } static void -cas_start(struct ifnet *ifp) +cas_tx_task(void *arg, int pending __unused) { - struct cas_softc *sc = ifp->if_softc; + struct ifnet *ifp; - CAS_LOCK(sc); - cas_start_locked(ifp); - CAS_UNLOCK(sc); + ifp = (struct ifnet *)arg; + cas_start(ifp); } static inline void @@ -1379,17 +1402,22 @@ cas_txkick(struct cas_softc *sc) } static void -cas_start_locked(struct ifnet *ifp) +cas_start(struct ifnet *ifp) { struct cas_softc *sc = ifp->if_softc; struct mbuf *m; int kicked, ntx; - CAS_LOCK_ASSERT(sc, MA_OWNED); + CAS_LOCK(sc); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->sc_flags & CAS_LINK) == 0) + IFF_DRV_RUNNING || (sc->sc_flags & CAS_LINK) == 0) { + CAS_UNLOCK(sc); return; + } + + if (sc->sc_txfree < CAS_MAXTXFREE / 4) + cas_tint(sc); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: txfree %d, txnext %d", @@ -1434,6 +1462,8 @@ cas_start_locked(struct ifnet *ifp) sc->sc_wdog_timer); #endif } + + CAS_UNLOCK(sc); } static void @@ -1530,17 +1560,10 @@ cas_tint(struct cas_softc *sc) #endif if (progress) { - if (sc->sc_txfree == CAS_NTXDESC - 1) - sc->sc_txwin = 0; - - /* - * We freed some descriptors, so reset IFF_DRV_OACTIVE - * and restart. - */ + /* We freed some descriptors, so reset IFF_DRV_OACTIVE. */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (STAILQ_EMPTY(&sc->sc_txdirtyq)) sc->sc_wdog_timer = 0; - cas_start_locked(ifp); } #ifdef CAS_DEBUG @@ -1554,7 +1577,7 @@ cas_rint_timeout(void *arg) { struct cas_softc *sc = arg; - CAS_LOCK_ASSERT(sc, MA_OWNED); + CAS_LOCK_ASSERT(sc, MA_NOTOWNED); cas_rint(sc); } @@ -1569,7 +1592,7 @@ cas_rint(struct cas_softc *sc) uint32_t rxhead; u_int idx, idx2, len, off, skip; - CAS_LOCK_ASSERT(sc, MA_OWNED); + CAS_LOCK_ASSERT(sc, MA_NOTOWNED); callout_stop(&sc->sc_rx_ch); @@ -1674,14 +1697,16 @@ cas_rint(struct cas_softc *sc) refcount_acquire(&rxds->rxds_refcount); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); +#if __FreeBSD_version < 800016 MEXTADD(m, (caddr_t)rxds->rxds_buf + off * 256 + ETHER_ALIGN, len, cas_free, -#if __FreeBSD_version < 800016 - rxds, + rxds, M_RDONLY, EXT_NET_DRV); #else + MEXTADD(m, (caddr_t)rxds->rxds_buf + + off * 256 + ETHER_ALIGN, len, cas_free, sc, (void *)(uintptr_t)idx, -#endif M_RDONLY, EXT_NET_DRV); +#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1695,9 +1720,7 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ - CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); - CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1719,14 +1742,16 @@ cas_rint(struct cas_softc *sc) m->m_len = min(CAS_PAGE_SIZE - off, len); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, - m->m_len, cas_free, #if __FreeBSD_version < 800016 - rxds, + MEXTADD(m, (caddr_t)rxds->rxds_buf + off, + m->m_len, cas_free, rxds, M_RDONLY, + EXT_NET_DRV); #else - sc, (void *)(uintptr_t)idx, + MEXTADD(m, (caddr_t)rxds->rxds_buf + off, + m->m_len, cas_free, sc, + (void *)(uintptr_t)idx, M_RDONLY, + EXT_NET_DRV); #endif - M_RDONLY, EXT_NET_DRV); if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1753,14 +1778,16 @@ cas_rint(struct cas_softc *sc) bus_dmamap_sync(sc->sc_rdmatag, rxds2->rxds_dmamap, BUS_DMASYNC_POSTREAD); - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, #if __FreeBSD_version < 800016 - rxds2, + MEXTADD(m2, (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, rxds2, + M_RDONLY, EXT_NET_DRV); #else + MEXTADD(m2, (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, sc, (void *)(uintptr_t)idx2, -#endif M_RDONLY, EXT_NET_DRV); +#endif if ((m2->m_flags & M_EXT) == 0) { m_freem(m2); m2 = NULL; @@ -1781,9 +1808,7 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ - CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); - CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1799,6 +1824,8 @@ cas_rint(struct cas_softc *sc) skip: cas_rxcompinit(&sc->sc_rxcomps[sc->sc_rxcptr]); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; } CAS_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); CAS_WRITE_4(sc, CAS_RX_COMP_TAIL, sc->sc_rxcptr); @@ -1819,7 +1846,7 @@ cas_free(void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; - u_int idx, locked; + u_int idx; #if __FreeBSD_version < 800016 rxds = arg2; @@ -1837,18 +1864,17 @@ cas_free(void *arg1, void *arg2) * NB: this function can be called via m_freem(9) within * this driver! */ - if ((locked = CAS_LOCK_OWNED(sc)) == 0) - CAS_LOCK(sc); + cas_add_rxdesc(sc, idx); - if (locked == 0) - CAS_UNLOCK(sc); } static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx) { + u_int locked; - CAS_LOCK_ASSERT(sc, MA_OWNED); + if ((locked = CAS_LOCK_OWNED(sc)) == 0) + CAS_LOCK(sc); bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap, BUS_DMASYNC_PREREAD); @@ -1866,13 +1892,19 @@ cas_add_rxdesc(struct cas_softc *sc, u_i CAS_WRITE_4(sc, CAS_RX_KICK, (sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK); } + + if (locked == 0) + CAS_UNLOCK(sc); } static void cas_eint(struct cas_softc *sc, u_int status) { + struct ifnet *ifp = sc->sc_ifp; + + CAS_LOCK_ASSERT(sc, MA_NOTOWNED); - sc->sc_ifp->if_ierrors++; + ifp->if_ierrors++; device_printf(sc->sc_dev, "%s: status 0x%x", __func__, status); if ((status & CAS_INTR_PCI_ERROR_INT) != 0) { @@ -1886,21 +1918,43 @@ cas_eint(struct cas_softc *sc, u_int sta } printf("\n"); - cas_init_locked(sc); - cas_start_locked(sc->sc_ifp); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + cas_init(sc); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } -static void +static int cas_intr(void *v) { struct cas_softc *sc = v; + + if (__predict_false((CAS_READ_4(sc, CAS_STATUS_ALIAS) & + CAS_INTR_SUMMARY) == 0)) + return (FILTER_STRAY); + + /* Disable interrupts. */ + CAS_WRITE_4(sc, CAS_INTMASK, 0xffffffff); + taskqueue_enqueue(sc->sc_tq, &sc->sc_intr_task); + + return (FILTER_HANDLED); +} + +static void +cas_intr_task(void *arg, int pending __unused) +{ + struct cas_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; uint32_t status, status2; - status = CAS_READ_4(sc, CAS_STATUS); - if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) + CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - CAS_LOCK(sc); + status = CAS_READ_4(sc, CAS_STATUS); + if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) + goto done; #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", @@ -1941,7 +1995,6 @@ cas_intr(void *v) (CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) { cas_eint(sc, status); - CAS_UNLOCK(sc); return; } @@ -1968,21 +2021,48 @@ cas_intr(void *v) (CAS_INTR_RX_DONE | CAS_INTR_RX_BUF_NA | CAS_INTR_RX_COMP_FULL | CAS_INTR_RX_BUF_AEMPTY | CAS_INTR_RX_COMP_AFULL)) != 0) { cas_rint(sc); +#ifdef CAS_DEBUG if (__predict_false((status & (CAS_INTR_RX_BUF_NA | CAS_INTR_RX_COMP_FULL | CAS_INTR_RX_BUF_AEMPTY | CAS_INTR_RX_COMP_AFULL)) != 0)) device_printf(sc->sc_dev, "RX fault, status %x\n", status); +#endif } if ((status & - (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) + (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) { + CAS_LOCK(sc); cas_tint(sc); + CAS_UNLOCK(sc); + } - CAS_UNLOCK(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); + + status = CAS_READ_4(sc, CAS_STATUS_ALIAS); + if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) { + taskqueue_enqueue(sc->sc_tq, &sc->sc_intr_task); + return; + } + + done: + /* Re-enable interrupts. */ + CAS_WRITE_4(sc, CAS_INTMASK, + ~(CAS_INTR_TX_INT_ME | CAS_INTR_TX_TAG_ERR | + CAS_INTR_RX_DONE | CAS_INTR_RX_BUF_NA | CAS_INTR_RX_TAG_ERR | + CAS_INTR_RX_COMP_FULL | CAS_INTR_RX_BUF_AEMPTY | + CAS_INTR_RX_COMP_AFULL | CAS_INTR_RX_LEN_MMATCH | + CAS_INTR_PCI_ERROR_INT +#ifdef CAS_DEBUG + | CAS_INTR_PCS_INT | CAS_INTR_MIF +#endif + )); } -static int +static void cas_watchdog(struct cas_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -2003,7 +2083,7 @@ cas_watchdog(struct cas_softc *sc) #endif if (sc->sc_wdog_timer == 0 || --sc->sc_wdog_timer != 0) - return (0); + return; if ((sc->sc_flags & CAS_LINK) != 0) device_printf(sc->sc_dev, "device timeout\n"); @@ -2012,9 +2092,10 @@ cas_watchdog(struct cas_softc *sc) ++ifp->if_oerrors; /* Try to get more packets going. */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; cas_init_locked(sc); - cas_start_locked(ifp); - return (EJUSTRETURN); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } static void @@ -2378,7 +2459,8 @@ cas_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: CAS_LOCK(sc); - cas_setladrf(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + cas_setladrf(sc); CAS_UNLOCK(sc); break; case SIOCSIFMTU: @@ -2729,7 +2811,7 @@ cas_pci_attach(device_t dev) } if (bus_setup_intr(dev, sc->sc_res[CAS_RES_INTR], INTR_TYPE_NET | - INTR_MPSAFE, NULL, cas_intr, sc, &sc->sc_ih) != 0) { + INTR_MPSAFE, cas_intr, NULL, sc, &sc->sc_ih) != 0) { device_printf(dev, "failed to set up interrupt\n"); cas_detach(sc); goto fail; Modified: stable/7/sys/dev/cas/if_casvar.h ============================================================================== --- head/sys/dev/cas/if_casvar.h Mon Jun 15 18:22:41 2009 (r194246) +++ stable/7/sys/dev/cas/if_casvar.h Sun Sep 20 12:08:29 2009 (r197343) @@ -138,6 +138,9 @@ struct cas_softc { u_char sc_enaddr[ETHER_ADDR_LEN]; struct callout sc_tick_ch; /* tick callout */ struct callout sc_rx_ch; /* delayed RX callout */ + struct task sc_intr_task; + struct task sc_tx_task; + struct taskqueue *sc_tq; u_int sc_wdog_timer; /* watchdog timer */ void *sc_ih; Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Sun Sep 20 11:33:39 2009 (r197342) +++ stable/7/sys/modules/Makefile Sun Sep 20 12:08:29 2009 (r197343) @@ -46,6 +46,7 @@ SUBDIR= ${_3dfx} \ ${_canbepm} \ ${_canbus} \ ${_cardbus} \ + cas \ ${_cbb} \ cd9660 \ cd9660_iconv \ Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Sun Sep 20 11:33:39 2009 (r197342) +++ stable/7/sys/sparc64/conf/GENERIC Sun Sep 20 12:08:29 2009 (r197343) @@ -164,6 +164,7 @@ device txp # 3Com 3cR990 (``Typhoon'') device miibus # MII bus support #device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn device dc # DEC/Intel 21143 and various workalikes device fxp # Intel EtherExpress PRO/100B (82557, 82558) device gem # Sun GEM/Sun ERI/Apple GMAC From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:12:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB641065676; Sun, 20 Sep 2009 12:12:36 +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 988328FC17; Sun, 20 Sep 2009 12:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KCCabO055935; Sun, 20 Sep 2009 12:12:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KCCauu055933; Sun, 20 Sep 2009 12:12:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201212.n8KCCauu055933@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 12:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197344 - in stable/7/sys: . contrib/pf dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:12:36 -0000 Author: marius Date: Sun Sep 20 12:12:36 2009 New Revision: 197344 URL: http://svn.freebsd.org/changeset/base/197344 Log: - Remove unused variables. [1] - Remove redundant zeroing of tmf_req which Coverity Prevent(tm) complains about. [2] Submitted by: Christoph Mallon [1] Found with: Coverity Prevent(tm) [2] CID: 2496 [2] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mpt/mpt_cam.c Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sun Sep 20 12:08:29 2009 (r197343) +++ stable/7/sys/dev/mpt/mpt_cam.c Sun Sep 20 12:12:36 2009 (r197344) @@ -884,11 +884,6 @@ mpt_sata_pass_reply_handler(struct mpt_s if (req != NULL) { if (reply_frame != NULL) { - MSG_SATA_PASSTHROUGH_REQUEST *pass; - MSG_SATA_PASSTHROUGH_REPLY *reply; - - pass = (MSG_SATA_PASSTHROUGH_REQUEST *)req->req_vbuf; - reply = (MSG_SATA_PASSTHROUGH_REPLY *)reply_frame; req->IOCStatus = le16toh(reply_frame->IOCStatus); } req->state &= ~REQ_STATE_QUEUED; @@ -1063,7 +1058,7 @@ mpt_read_config_info_spi(struct mpt_soft static int mpt_set_initial_config_spi(struct mpt_softc *mpt) { - int i, j, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id; + int i, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id; int error; mpt->mpt_disc_enable = 0xff; @@ -1101,15 +1096,11 @@ mpt_set_initial_config_spi(struct mpt_so * all targets back to async/narrow. * * We skip this step if the BIOS has already negotiated - * speeds with the targets and does not require us to - * do Domain Validation. + * speeds with the targets. */ i = mpt->mpt_port_page2.PortSettings & MPI_SCSIPORTPAGE2_PORT_MASK_NEGO_MASTER_SETTINGS; - j = mpt->mpt_port_page2.PortFlags & - MPI_SCSIPORTPAGE2_PORT_FLAGS_DV_MASK; - if (i == MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS /* && - j == MPI_SCSIPORTPAGE2_PORT_FLAGS_OFF_DV */) { + if (i == MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS) { mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "honoring BIOS transfer negotiations\n"); } else { @@ -2602,7 +2593,6 @@ mpt_scsi_reply_handler(struct mpt_softc { MSG_SCSI_IO_REQUEST *scsi_req; union ccb *ccb; - target_id_t tgt; if (req->state == REQ_STATE_FREE) { mpt_prt(mpt, "mpt_scsi_reply_handler: req already free\n"); @@ -2617,7 +2607,6 @@ mpt_scsi_reply_handler(struct mpt_softc return (TRUE); } - tgt = scsi_req->TargetID; mpt_req_untimeout(req, mpt_timeout, ccb); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; @@ -2971,13 +2960,9 @@ mpt_fc_els_reply_handler(struct mpt_soft } if (tgt_req) { mpt_tgt_state_t *tgt = MPT_TGT_STATE(mpt, tgt_req); - uint8_t *vbuf; union ccb *ccb = tgt->ccb; uint32_t ct_id; - vbuf = tgt_req->req_vbuf; - vbuf += MPT_RQSL(mpt); - /* * Check to make sure we have the correct command * The reply descriptor in the target state should @@ -3079,7 +3064,6 @@ mpt_scsi_reply_frame_handler(struct mpt_ MSG_SCSI_IO_REPLY *scsi_io_reply; u_int ioc_status; u_int sstate; - u_int loginfo; MPT_DUMP_REPLY_FRAME(mpt, reply_frame); KASSERT(reply_frame->Function == MPI_FUNCTION_SCSI_IO_REQUEST @@ -3090,7 +3074,6 @@ mpt_scsi_reply_frame_handler(struct mpt_ scsi_io_reply = (MSG_SCSI_IO_REPLY *)reply_frame; ioc_status = le16toh(scsi_io_reply->IOCStatus); - loginfo = ioc_status & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE; ioc_status &= MPI_IOCSTATUS_MASK; sstate = scsi_io_reply->SCSIState; @@ -4040,16 +4023,11 @@ mpt_scsi_send_tmf(struct mpt_softc *mpt, memset(tmf_req, 0, sizeof(*tmf_req)); tmf_req->TargetID = target; tmf_req->Bus = channel; - tmf_req->ChainOffset = 0; tmf_req->Function = MPI_FUNCTION_SCSI_TASK_MGMT; - tmf_req->Reserved = 0; tmf_req->TaskType = type; - tmf_req->Reserved1 = 0; tmf_req->MsgFlags = flags; tmf_req->MsgContext = htole32(mpt->tmf_req->index | scsi_tmf_handler_id); - memset(&tmf_req->LUN, 0, - sizeof(tmf_req->LUN) + sizeof(tmf_req->Reserved2)); if (lun > 256) { tmf_req->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); tmf_req->LUN[1] = lun & 0xff; From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:14:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36CFD1065670; Sun, 20 Sep 2009 12:14:43 +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 23B678FC1A; Sun, 20 Sep 2009 12:14:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KCEg5o056026; Sun, 20 Sep 2009 12:14:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KCEg7E056020; Sun, 20 Sep 2009 12:14:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201214.n8KCEg7E056020@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 12:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197345 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:14:43 -0000 Author: marius Date: Sun Sep 20 12:14:42 2009 New Revision: 197345 URL: http://svn.freebsd.org/changeset/base/197345 Log: MFC: r194247 Add a man page for cas(4) and reference it as appropriate. Added: stable/7/share/man/man4/cas.4 - copied unchanged from r194247, head/share/man/man4/cas.4 Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/Makefile stable/7/share/man/man4/altq.4 stable/7/share/man/man4/miibus.4 stable/7/share/man/man4/vlan.4 Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Sun Sep 20 12:12:36 2009 (r197344) +++ stable/7/share/man/man4/Makefile Sun Sep 20 12:14:42 2009 (r197345) @@ -46,6 +46,7 @@ MAN= aac.4 \ bt.4 \ cardbus.4 \ carp.4 \ + cas.4 \ ccd.4 \ cd.4 \ cdce.4 \ @@ -448,6 +449,7 @@ MLINKS+=bfe.4 if_bfe.4 MLINKS+=bge.4 if_bge.4 MLINKS+=bktr.4 brooktree.4 MLINKS+=cnw.4 if_cnw.4 +MLINKS+=cas.4 if_cas.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=dc.4 if_dc.4 Modified: stable/7/share/man/man4/altq.4 ============================================================================== --- stable/7/share/man/man4/altq.4 Sun Sep 20 12:12:36 2009 (r197344) +++ stable/7/share/man/man4/altq.4 Sun Sep 20 12:14:42 2009 (r197345) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2009 +.Dd June 14, 2009 .Dt ALTQ 4 .Os .Sh NAME @@ -126,6 +126,7 @@ They have been applied to the following .Xr bce 4 , .Xr bfe 4 , .Xr bge 4 , +.Xr cas 4 , .Xr dc 4 , .Xr de 4 , .Xr ed 4 , Copied: stable/7/share/man/man4/cas.4 (from r194247, head/share/man/man4/cas.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/cas.4 Sun Sep 20 12:14:42 2009 (r197345, copy of r194247, head/share/man/man4/cas.4) @@ -0,0 +1,154 @@ +.\" +.\" Copyright (c) 2009 Marius Strobl +.\" 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 June 15, 2009 +.Dt CAS 4 +.Os +.Sh NAME +.Nm cas +.Nd Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn Gigabit Ethernet 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 miibus" +.Cd "device cas" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_cas="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Sun Cassini/Cassini+ and National +Semiconductor DP83065 Saturn Gigabit Ethernet controllers found +on-board in Sun UltraSPARC machines and as add-on cards. +.Pp +All controllers supported by the +.Nm +driver have TCP/UDP checksum offload capability for both receive and +transmit, support for the reception and transmission of extended frames +for +.Xr vlan 4 +and an interrupt coalescing/moderation mechanism as well as a 512-bit +multicast hash filter. +.Pp +The +.Nm +driver also supports Jumbo Frames (up to 9022 bytes), which can be +configured via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +.Sh HARDWARE +.Pp +The chips supported by the +.Nm +driver are: +.Pp +.Bl -bullet -compact +.It +National Semiconductor DP83065 Saturn Gigabit Ethernet +.It +Sun Cassini Gigabit Ethernet +.It +Sun Cassini+ Gigabit Ethernet +.El +.Pp +The +following add-on cards are known to work with the +.Nm +driver at this time: +.Pp +.Bl -bullet -compact +.It +Sun GigaSwift Ethernet 1.0 UTP (Cassini) +(part no.\& 501-5902) +.It +Sun GigaSwift Ethernet UTP (GCS) +(part no.\& 501-6719) +.It +Sun Quad GigaSwift Ethernet UTP (QGE) +(part no.\& 501-6522) +.El +.Sh NOTES +On sparc64 the +.Nm +driver respects the +.Va local-mac-address? +system configuration variable which can be set in the Open Firmware boot +monitor using the +.Ic setenv +command or by +.Xr eeprom 8 . +If set to +.Dq Li false +(the default), the +.Nm +driver will use the system's default MAC address for all of its devices. +If set to +.Dq Li true , +the unique MAC address of each interface is used if present rather than +the system's default MAC address. +.Pp +Supported interfaces having their own MAC address include on-board +versions on boards equipped with more than one Ethernet interface and +all add-on cards. +.Sh SEE ALSO +.Xr altq 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr vlan 4 , +.Xr eeprom 8 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 +and +.Fx 7.3 . +It is named after the +.Nm +driver which first appeared in +.Ox 4.1 +and supports the same set of controllers but is otherwise unrelated. +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Marius Strobl +.Aq marius@FreeBSD.org +based on the +.Xr gem 4 +driver. Modified: stable/7/share/man/man4/miibus.4 ============================================================================== --- stable/7/share/man/man4/miibus.4 Sun Sep 20 12:12:36 2009 (r197344) +++ stable/7/share/man/man4/miibus.4 Sun Sep 20 12:14:42 2009 (r197345) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2009 +.Dd June 14, 2009 .Dt MIIBUS 4 .Os .Sh NAME @@ -61,6 +61,8 @@ Broadcom NetXtreme II Gigabit Ethernet Broadcom BCM4401 Ethernet .It Xr bge 4 Broadcom BCM570xx Gigabit Ethernet +.It Xr cas 4 +Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn .It Xr dc 4 DEC/Intel 21143 and various workalikes .It Xr ed 4 @@ -137,6 +139,7 @@ but as a result are not well behaved new .Xr bce 4 , .Xr bfe 4 , .Xr bge 4 , +.Xr cas 4 , .Xr dc 4 , .Xr ed 4 , .Xr et 4 , Modified: stable/7/share/man/man4/vlan.4 ============================================================================== --- stable/7/share/man/man4/vlan.4 Sun Sep 20 12:12:36 2009 (r197344) +++ stable/7/share/man/man4/vlan.4 Sun Sep 20 12:14:42 2009 (r197345) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2009 +.Dd June 14, 2009 .Dt VLAN 4 .Os .Sh NAME @@ -161,6 +161,7 @@ The following interfaces support long fr .Nm natively: .Xr bfe 4 , +.Xr cas 4 , .Xr dc 4 , .Xr fwe 4 , .Xr fxp 4 , From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:19:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF3F106566B; Sun, 20 Sep 2009 12:19: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 2C9C88FC14; Sun, 20 Sep 2009 12:19:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KCJMhQ056158; Sun, 20 Sep 2009 12:19:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KCJMwO056156; Sun, 20 Sep 2009 12:19:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201219.n8KCJMwO056156@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 12:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197346 - stable/7/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:19:22 -0000 Author: marius Date: Sun Sep 20 12:19:21 2009 New Revision: 197346 URL: http://svn.freebsd.org/changeset/base/197346 Log: MFC: r194248 Add cas(4). Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml (contents, props changed) Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Sep 20 12:14:42 2009 (r197345) +++ stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Sep 20 12:19:21 2009 (r197346) @@ -699,6 +699,8 @@ &hwlist.bge; + &hwlist.cas; + &hwlist.cdce; [&arch.amd64;, &arch.i386;] Crystal Semiconductor CS89x0-based NICs From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:24:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590E5106568B; Sun, 20 Sep 2009 12:24:55 +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 46F378FC08; Sun, 20 Sep 2009 12:24:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KCOtNU056311; Sun, 20 Sep 2009 12:24:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KCOt9K056309; Sun, 20 Sep 2009 12:24:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201224.n8KCOt9K056309@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 12:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197347 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:24:55 -0000 Author: marius Date: Sun Sep 20 12:24:55 2009 New Revision: 197347 URL: http://svn.freebsd.org/changeset/base/197347 Log: MFC: r194249 Add cas(4). Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/devices.c Modified: stable/7/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/7/usr.sbin/sysinstall/devices.c Sun Sep 20 12:19:21 2009 (r197346) +++ stable/7/usr.sbin/sysinstall/devices.c Sun Sep 20 12:24:55 2009 (r197347) @@ -104,6 +104,7 @@ static struct _devname { NETWORK("bce", "Broadcom NetXtreme II Gigabit Ethernet card"), NETWORK("bfe", "Broadcom BCM440x PCI Ethernet card"), NETWORK("bge", "Broadcom BCM570x PCI Gigabit Ethernet card"), + NETWORK("cas", "Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet"), NETWORK("cue", "CATC USB Ethernet adapter"), NETWORK("cxgb", "Chelsio T3 10Gb Ethernet card"), NETWORK("fpa", "DEC DEFPA PCI FDDI card"), From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:40:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B33A1065670; Sun, 20 Sep 2009 12:40:56 +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 5A37B8FC17; Sun, 20 Sep 2009 12:40:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KCeu6e056622; Sun, 20 Sep 2009 12:40:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KCeubH056620; Sun, 20 Sep 2009 12:40:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909201240.n8KCeubH056620@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 20 Sep 2009 12:40: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: r197348 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:40:56 -0000 Author: kib Date: Sun Sep 20 12:40:56 2009 New Revision: 197348 URL: http://svn.freebsd.org/changeset/base/197348 Log: Old (a.out) rtld attempts to mmap zero-length region, e.g. when bss of the linked object is zero-length. More old code assumes that mmap of zero length returns success. For a.out and pre-8 ELF binaries, allow the mmap of zero length. Reported by: tegge Reviewed by: tegge, alc, jhb MFC after: 3 days Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Sep 20 12:24:55 2009 (r197347) +++ head/sys/vm/vm_mmap.c Sun Sep 20 12:40:56 2009 (r197348) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -229,7 +230,8 @@ mmap(td, uap) fp = NULL; /* make sure mapping fits into numeric range etc */ - if (uap->len == 0 || + if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && + curproc->p_osrel >= 800104) || ((flags & MAP_ANON) && uap->fd != -1)) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 12:56:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A3B71065693; Sun, 20 Sep 2009 12:56:51 +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 161F78FC13; Sun, 20 Sep 2009 12:56:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KCupqk057071; Sun, 20 Sep 2009 12:56:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KCuofu057064; Sun, 20 Sep 2009 12:56:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201256.n8KCuofu057064@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 12:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197349 - in stable/7/sys: . conf contrib/pf dev/gem modules/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:56:51 -0000 Author: marius Date: Sun Sep 20 12:56:50 2009 New Revision: 197349 URL: http://svn.freebsd.org/changeset/base/197349 Log: MFC: r194763, r194886 - Initialize the ifnet structure, especially if_dname, before probing the PHYs as some PHY drivers use it (but probably shouldn't). How gem(4) has worked with brgphy(4) on powerpc without this so far is unclear to me. - Call ether_ifdetach(9) before stopping the controller and the callouts. The consensus is that the latter is now safe to do and should also solve the problem of active BPF listeners clearing promiscuous mode can result in the tick callout being restarted which in turn will trigger a panic once it's actually gone. - Introduce a dying flag which is set during detach and checked in gem_ioctl() in order to prevent active BPF listeners to clear promiscuous mode which may lead to the tick callout being restarted which will trigger a panic once it's actually gone. - In gem_stop() reset rather than just disable the transmitter and receiver in order to ensure we're not unloading DMA maps still in use by the hardware. [1] - The blanking time is specified in PCI clocks so we should use twice the value when operating at 66MHz. - Spell some 2 as ETHER_ALIGN and a 19 as GEM_STATUS_TX_COMPLETION_SHFT to make the actual intentions clear. - As we don't unload the peak attempts counter ignore its overflow interrupts. - Remove a stale setting of a variable to GEM_TD_INTERRUPT_ME which isn't used afterwards. - For optimum performance increment the TX kick register in multiples of 4 if possible as suggested by the documentation. - Partially revert r164931; drivers should only clear the watchdog timer if all outstanding TX descriptors are done. - Fix some debugging strings. - Add a missing BUS_DMASYNC_POSTWRITE in gem_rint(). - As the error paths in the interrupt handler are generally unlikely predict them as false. - Add support for the SBus version of the GEM controller. [2] - Add some lock assertions. - Improve some comments. - Fix some more or less cosmetic issues in the code of the PCI front-end. - Change some softc members to be unsigned where more appropriate and remove unused ones. Obtained from: NetBSD (partially) [2], OpenBSD [1] Added: stable/7/sys/dev/gem/if_gem_sbus.c - copied unchanged from r194763, head/sys/dev/gem/if_gem_sbus.c Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gem_pci.c stable/7/sys/dev/gem/if_gemreg.h stable/7/sys/dev/gem/if_gemvar.h stable/7/sys/modules/gem/Makefile Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Sun Sep 20 12:40:56 2009 (r197348) +++ stable/7/sys/conf/files Sun Sep 20 12:56:50 2009 (r197349) @@ -841,6 +841,7 @@ dev/flash/at45d.c optional at45d dev/fxp/if_fxp.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci +dev/gem/if_gem_sbus.c optional gem sbus dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci dev/hatm/if_hatm_ioctl.c optional hatm pci Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Sun Sep 20 12:40:56 2009 (r197348) +++ stable/7/sys/dev/gem/if_gem.c Sun Sep 20 12:56:50 2009 (r197349) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); CTASSERT(powerof2(GEM_NRXDESC) && GEM_NRXDESC >= 32 && GEM_NRXDESC <= 8192); CTASSERT(powerof2(GEM_NTXDESC) && GEM_NTXDESC >= 32 && GEM_NTXDESC <= 8192); -#define TRIES 10000 +#define GEM_TRIES 10000 /* * The hardware supports basic TCP/UDP checksum offloading. However, @@ -119,7 +119,7 @@ static void gem_rint(struct gem_softc *s #ifdef GEM_RINT_TIMEOUT static void gem_rint_timeout(void *arg); #endif -static __inline void gem_rxcksum(struct mbuf *m, uint64_t flags); +static inline void gem_rxcksum(struct mbuf *m, uint64_t flags); static void gem_rxdrain(struct gem_softc *sc); static void gem_setladrf(struct gem_softc *sc); static void gem_start(struct ifnet *ifp); @@ -127,6 +127,7 @@ static void gem_start_locked(struct ifne static void gem_stop(struct ifnet *ifp, int disable); static void gem_tick(void *arg); static void gem_tint(struct gem_softc *sc); +static inline void gem_txkick(struct gem_softc *sc); static int gem_watchdog(struct gem_softc *sc); devclass_t gem_devclass; @@ -151,9 +152,24 @@ gem_attach(struct gem_softc *sc) int error, i; uint32_t v; + if (bootverbose) + device_printf(sc->sc_dev, "flags=0x%x\n", sc->sc_flags); + + /* Set up ifnet structure. */ ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) return (ENOSPC); + sc->sc_csum_features = GEM_CSUM_FEATURES; + ifp->if_softc = sc; + if_initname(ifp, device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = gem_start; + ifp->if_ioctl = gem_ioctl; + ifp->if_init = gem_init; + IFQ_SET_MAXLEN(&ifp->if_snd, GEM_TXQUEUELEN); + ifp->if_snd.ifq_drv_maxlen = GEM_TXQUEUELEN; + IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); #ifdef GEM_RINT_TIMEOUT @@ -161,27 +177,26 @@ gem_attach(struct gem_softc *sc) #endif /* Make sure the chip is stopped. */ - ifp->if_softc = sc; gem_reset(sc); error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->sc_pdmatag); - if (error) + if (error != 0) goto fail_ifnet; error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_rdmatag); - if (error) + if (error != 0) goto fail_ptag; error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * GEM_NTXSEGS, GEM_NTXSEGS, MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_tdmatag); - if (error) + if (error != 0) goto fail_rtag; error = bus_dma_tag_create(sc->sc_pdmatag, PAGE_SIZE, 0, @@ -189,7 +204,7 @@ gem_attach(struct gem_softc *sc) sizeof(struct gem_control_data), 1, sizeof(struct gem_control_data), 0, NULL, NULL, &sc->sc_cdmatag); - if (error) + if (error != 0) goto fail_ttag; /* @@ -199,7 +214,7 @@ gem_attach(struct gem_softc *sc) if ((error = bus_dmamem_alloc(sc->sc_cdmatag, (void **)&sc->sc_control_data, BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &sc->sc_cddmamap))) { + &sc->sc_cddmamap)) != 0) { device_printf(sc->sc_dev, "unable to allocate control data, error = %d\n", error); goto fail_ctag; @@ -338,19 +353,6 @@ gem_attach(struct gem_softc *sc) device_printf(sc->sc_dev, "%ukB RX FIFO, %ukB TX FIFO\n", sc->sc_rxfifosize / 1024, v / 16); - sc->sc_csum_features = GEM_CSUM_FEATURES; - /* Initialize ifnet structure. */ - ifp->if_softc = sc; - if_initname(ifp, device_get_name(sc->sc_dev), - device_get_unit(sc->sc_dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_start = gem_start; - ifp->if_ioctl = gem_ioctl; - ifp->if_init = gem_init; - IFQ_SET_MAXLEN(&ifp->if_snd, GEM_TXQUEUELEN); - ifp->if_snd.ifq_drv_maxlen = GEM_TXQUEUELEN; - IFQ_SET_READY(&ifp->if_snd); - /* Attach the interface. */ ether_ifattach(ifp, sc->sc_enaddr); @@ -401,6 +403,7 @@ gem_detach(struct gem_softc *sc) struct ifnet *ifp = sc->sc_ifp; int i; + ether_ifdetach(ifp); GEM_LOCK(sc); gem_stop(ifp, 1); GEM_UNLOCK(sc); @@ -408,7 +411,6 @@ gem_detach(struct gem_softc *sc) #ifdef GEM_RINT_TIMEOUT callout_drain(&sc->sc_rx_ch); #endif - ether_ifdetach(ifp); if_free(ifp); device_delete_child(sc->sc_dev, sc->sc_miibus); @@ -456,7 +458,7 @@ gem_resume(struct gem_softc *sc) GEM_UNLOCK(sc); } -static __inline void +static inline void gem_rxcksum(struct mbuf *m, uint64_t flags) { struct ether_header *eh; @@ -535,12 +537,11 @@ static void gem_tick(void *arg) { struct gem_softc *sc = arg; - struct ifnet *ifp; + struct ifnet *ifp = sc->sc_ifp; uint32_t v; GEM_LOCK_ASSERT(sc, MA_OWNED); - ifp = sc->sc_ifp; /* * Unload collision and error counters. */ @@ -584,7 +585,7 @@ gem_bitwait(struct gem_softc *sc, u_int int i; uint32_t reg; - for (i = TRIES; i--; DELAY(100)) { + for (i = GEM_TRIES; i--; DELAY(100)) { reg = GEM_BANKN_READ_M(bank, 4, sc, r); if ((reg & clr) == 0 && (reg & set) == set) return (1); @@ -593,8 +594,7 @@ gem_bitwait(struct gem_softc *sc, u_int } static void -gem_reset(sc) - struct gem_softc *sc; +gem_reset(struct gem_softc *sc) { #ifdef GEM_DEBUG @@ -644,9 +644,8 @@ gem_stop(struct ifnet *ifp, int disable) callout_stop(&sc->sc_rx_ch); #endif - /* XXX should we reset these instead? */ - gem_disable_tx(sc); - gem_disable_rx(sc); + gem_reset_tx(sc); + gem_reset_rx(sc); /* * Release any queued transmit buffers. @@ -721,7 +720,7 @@ gem_reset_rxdma(struct gem_softc *sc) if (sc->sc_rxsoft[i].rxs_mbuf != NULL) GEM_UPDATE_RXDESC(sc, i); sc->sc_rxptr = 0; - GEM_CDSYNC(sc, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* NOTE: we use only 32-bit DMA addresses here. */ GEM_BANK1_WRITE_4(sc, GEM_RX_RING_PTR_HI, 0); @@ -732,9 +731,11 @@ gem_reset_rxdma(struct gem_softc *sc) ((ETHER_HDR_LEN + sizeof(struct ip)) << GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | - (2 << GEM_RX_CONFIG_FBOFF_SHFT)); + (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); + /* Adjust for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, - (6 << GEM_RX_BLANKING_TIME_SHIFT) | 6); + ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << + GEM_RX_BLANKING_TIME_SHIFT) | 6); GEM_BANK1_WRITE_4(sc, GEM_RX_PAUSE_THRESH, (3 * sc->sc_rxfifosize / 256) | ((sc->sc_rxfifosize / 256) << 12)); @@ -798,12 +799,13 @@ gem_disable_tx(struct gem_softc *sc) } static int -gem_meminit(sc) - struct gem_softc *sc; +gem_meminit(struct gem_softc *sc) { struct gem_rxsoft *rxs; int error, i; + GEM_LOCK_ASSERT(sc, MA_OWNED); + /* * Initialize the transmit descriptor ring. */ @@ -837,7 +839,8 @@ gem_meminit(sc) GEM_INIT_RXDESC(sc, i); } sc->sc_rxptr = 0; - GEM_CDSYNC(sc, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -938,6 +941,20 @@ gem_init_locked(struct gem_softc *sc) #endif /* step 8. Global Configuration & Interrupt Mask */ + + /* + * Set the internal arbitration to "infinite" bursts of the + * maximum length of 31 * 64 bytes so DMA transfers aren't + * split up in cache line size chunks. This greatly improves + * RX performance. + * Enable silicon bug workarounds for the Apple variants. + */ + GEM_BANK1_WRITE_4(sc, GEM_CONFIG, + GEM_CONFIG_TXDMA_LIMIT | GEM_CONFIG_RXDMA_LIMIT | + ((sc->sc_flags & GEM_PCI) != 0 ? GEM_CONFIG_BURST_INF : + GEM_CONFIG_BURST_64) | (GEM_IS_APPLE(sc) ? + GEM_CONFIG_RONPAULBIT | GEM_CONFIG_BUG2FIX : 0)); + GEM_BANK1_WRITE_4(sc, GEM_INTMASK, ~(GEM_INTR_TX_INTME | GEM_INTR_TX_EMPTY | GEM_INTR_RX_DONE | GEM_INTR_RX_NOBUF | GEM_INTR_RX_TAG_ERR | GEM_INTR_PERR | @@ -949,7 +966,8 @@ gem_init_locked(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_MASK, - GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP); + GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP | + GEM_MAC_TX_PEAK_EXP); #ifdef GEM_DEBUG GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_MASK, ~(GEM_MAC_PAUSED | GEM_MAC_PAUSE | GEM_MAC_RESUME)); @@ -961,7 +979,8 @@ gem_init_locked(struct gem_softc *sc) /* step 9. ETX Configuration: use mostly default values. */ /* Enable DMA. */ - v = gem_ringsize(GEM_NTXDESC /* XXX */); + v = gem_ringsize(GEM_NTXDESC); + /* Set TX FIFO threshold and enable DMA. */ v |= ((sc->sc_variant == GEM_SUN_ERI ? 0x100 : 0x4ff) << 10) & GEM_TX_CONFIG_TXFIFO_TH; GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, v | GEM_TX_CONFIG_TXDMA_EN); @@ -973,14 +992,16 @@ gem_init_locked(struct gem_softc *sc) /* RX TCP/UDP checksum offset */ v |= ((ETHER_HDR_LEN + sizeof(struct ip)) << GEM_RX_CONFIG_CXM_START_SHFT); - - /* Enable DMA. */ + /* Set RX FIFO threshold, set first byte offset and enable DMA. */ GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, v | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | - (2 << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); + (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | + GEM_RX_CONFIG_RXDMA_EN); + /* Adjust for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, - (6 << GEM_RX_BLANKING_TIME_SHIFT) | 6); + ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << + GEM_RX_BLANKING_TIME_SHIFT) | 6); /* * The following value is for an OFF Threshold of about 3/4 full @@ -1002,7 +1023,7 @@ gem_init_locked(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot configure RX MAC\n"); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); - /* step 13. TX_MAC Configuration Register */ + /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); @@ -1037,6 +1058,8 @@ gem_load_txmbuf(struct gem_softc *sc, st uint64_t cflags, flags; int error, nexttx, nsegs, offset, seg; + GEM_LOCK_ASSERT(sc, MA_OWNED); + /* Get a work queue entry. */ if ((txs = STAILQ_FIRST(&sc->sc_txfreeq)) == NULL) { /* Ran out of descriptors. */ @@ -1143,7 +1166,6 @@ gem_load_txmbuf(struct gem_softc *sc, st #endif if (++sc->sc_txwin > GEM_NTXSEGS * 2 / 3) { sc->sc_txwin = 0; - flags |= GEM_TD_INTERRUPT_ME; sc->sc_txdescs[txs->txs_firstdesc].gd_flags |= GEM_DMA_WRITE(sc, GEM_TD_INTERRUPT_ME | GEM_TD_START_OF_PACKET); @@ -1175,6 +1197,8 @@ gem_init_regs(struct gem_softc *sc) { const u_char *laddr = IF_LLADDR(sc->sc_ifp); + GEM_LOCK_ASSERT(sc, MA_OWNED); + /* These registers are not cleared on reset. */ if ((sc->sc_flags & GEM_INITED) == 0) { /* magic values */ @@ -1182,16 +1206,19 @@ gem_init_regs(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_IPG1, 8); GEM_BANK1_WRITE_4(sc, GEM_MAC_IPG2, 4); + /* min frame length */ GEM_BANK1_WRITE_4(sc, GEM_MAC_MAC_MIN_FRAME, ETHER_MIN_LEN); - /* max frame and max burst size */ + /* max frame length and max burst size */ GEM_BANK1_WRITE_4(sc, GEM_MAC_MAC_MAX_FRAME, (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) | (0x2000 << 16)); + /* more magic values */ GEM_BANK1_WRITE_4(sc, GEM_MAC_PREAMBLE_LEN, 0x7); GEM_BANK1_WRITE_4(sc, GEM_MAC_JAM_SIZE, 0x4); GEM_BANK1_WRITE_4(sc, GEM_MAC_ATTEMPT_LIMIT, 0x10); - /* dunno... */ GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_TYPE, 0x8088); + + /* random number seed */ GEM_BANK1_WRITE_4(sc, GEM_MAC_RANDOM_SEED, ((laddr[5] << 8) | laddr[4]) & 0x3ff); @@ -1209,7 +1236,6 @@ gem_init_regs(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR_FILTER0, 0); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR_FILTER1, 0); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR_FILTER2, 0); - GEM_BANK1_WRITE_4(sc, GEM_MAC_ADR_FLT_MASK1_2, 0); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADR_FLT_MASK0, 0); @@ -1232,18 +1258,6 @@ gem_init_regs(struct gem_softc *sc) /* Set XOFF PAUSE time. */ GEM_BANK1_WRITE_4(sc, GEM_MAC_SEND_PAUSE_CMD, 0x1BF0); - /* - * Set the internal arbitration to "infinite" bursts of the - * maximum length of 31 * 64 bytes so DMA transfers aren't - * split up in cache line size chunks. This greatly improves - * especially RX performance. - * Enable silicon bug workarounds for the Apple variants. - */ - GEM_BANK1_WRITE_4(sc, GEM_CONFIG, - GEM_CONFIG_TXDMA_LIMIT | GEM_CONFIG_RXDMA_LIMIT | - GEM_CONFIG_BURST_INF | (GEM_IS_APPLE(sc) ? - GEM_CONFIG_RONPAULBIT | GEM_CONFIG_BUG2FIX : 0)); - /* Set the station address. */ GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR0, (laddr[4] << 8) | laddr[5]); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR1, (laddr[2] << 8) | laddr[3]); @@ -1263,12 +1277,32 @@ gem_start(struct ifnet *ifp) GEM_UNLOCK(sc); } +static inline void +gem_txkick(struct gem_softc *sc) +{ + + /* + * Update the TX kick register. This register has to point to the + * descriptor after the last valid one and for optimum performance + * should be incremented in multiples of 4 (the DMA engine fetches/ + * updates descriptors in batches of 4). + */ +#ifdef GEM_DEBUG + CTR3(KTR_GEM, "%s: %s: kicking TX %d", + device_get_name(sc->sc_dev), __func__, sc->sc_txnext); +#endif + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + GEM_BANK1_WRITE_4(sc, GEM_TX_KICK, sc->sc_txnext); +} + static void gem_start_locked(struct ifnet *ifp) { struct gem_softc *sc = ifp->if_softc; struct mbuf *m; - int ntx; + int kicked, ntx; + + GEM_LOCK_ASSERT(sc, MA_OWNED); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING || (sc->sc_flags & GEM_LINK) == 0) @@ -1280,6 +1314,7 @@ gem_start_locked(struct ifnet *ifp) sc->sc_txnext); #endif ntx = 0; + kicked = 0; for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->sc_txfree > 1;) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) @@ -1291,19 +1326,18 @@ gem_start_locked(struct ifnet *ifp) IFQ_DRV_PREPEND(&ifp->if_snd, m); break; } + if ((sc->sc_txnext % 4) == 0) { + gem_txkick(sc); + kicked = 1; + } else + kicked = 0; ntx++; - /* Kick the transmitter. */ -#ifdef GEM_DEBUG - CTR3(KTR_GEM, "%s: %s: kicking TX %d", - device_get_name(sc->sc_dev), __func__, sc->sc_txnext); -#endif - GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - GEM_BANK1_WRITE_4(sc, GEM_TX_KICK, sc->sc_txnext); - BPF_MTAP(ifp, m); } if (ntx > 0) { + if (kicked == 0) + gem_txkick(sc); #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: packets enqueued, OWN on %d", device_get_name(sc->sc_dev), sc->sc_txnext); @@ -1324,10 +1358,13 @@ gem_tint(struct gem_softc *sc) { struct ifnet *ifp = sc->sc_ifp; struct gem_txsoft *txs; - int txlast, progress; + int progress; + uint32_t txlast; #ifdef GEM_DEBUG int i; + GEM_LOCK_ASSERT(sc, MA_OWNED); + CTR2(KTR_GEM, "%s: %s", device_get_name(sc->sc_dev), __func__); #endif @@ -1338,7 +1375,6 @@ gem_tint(struct gem_softc *sc) progress = 0; GEM_CDSYNC(sc, BUS_DMASYNC_POSTREAD); while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) { - #ifdef GEM_DEBUG if ((ifp->if_flags & IFF_DEBUG) != 0) { printf(" txsoft %p transmit chain:\n", txs); @@ -1419,8 +1455,8 @@ gem_tint(struct gem_softc *sc) * and restart. */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sc->sc_wdog_timer = STAILQ_EMPTY(&sc->sc_txdirtyq) ? 0 : 5; - + if (STAILQ_EMPTY(&sc->sc_txdirtyq)) + sc->sc_wdog_timer = 0; gem_start_locked(ifp); } @@ -1437,6 +1473,7 @@ gem_rint_timeout(void *arg) struct gem_softc *sc = arg; GEM_LOCK_ASSERT(sc, MA_OWNED); + gem_rint(sc); } #endif @@ -1449,6 +1486,8 @@ gem_rint(struct gem_softc *sc) uint64_t rxstat; uint32_t rxcomp; + GEM_LOCK_ASSERT(sc, MA_OWNED); + #ifdef GEM_RINT_TIMEOUT callout_stop(&sc->sc_rx_ch); #endif @@ -1461,12 +1500,11 @@ gem_rint(struct gem_softc *sc) * how long the following loop can execute. */ rxcomp = GEM_BANK1_READ_4(sc, GEM_RX_COMPLETION); - #ifdef GEM_DEBUG - CTR3(KTR_GEM, "%s: sc->rxptr %d, complete %d", + CTR3(KTR_GEM, "%s: sc->sc_rxptr %d, complete %d", __func__, sc->sc_rxptr, rxcomp); #endif - GEM_CDSYNC(sc, BUS_DMASYNC_POSTREAD); + GEM_CDSYNC(sc, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); for (; sc->sc_rxptr != rxcomp;) { m = sc->sc_rxsoft[sc->sc_rxptr].rxs_mbuf; rxstat = GEM_DMA_READ(sc, @@ -1525,9 +1563,9 @@ gem_rint(struct gem_softc *sc) /* * Update the RX kick register. This register has to point * to the descriptor after the last valid one (before the - * current batch) and must be incremented in multiples of - * 4 (because the DMA engine fetches/updates descriptors - * in batches of 4). + * current batch) and for optimum performance should be + * incremented in multiples of 4 (the DMA engine fetches/ + * updates descriptors in batches of 4). */ sc->sc_rxptr = GEM_NEXTRX(sc->sc_rxptr); if ((sc->sc_rxptr % 4) == 0) { @@ -1545,7 +1583,7 @@ gem_rint(struct gem_softc *sc) } ifp->if_ipackets++; - m->m_data += 2; /* We're already off by two */ + m->m_data += ETHER_ALIGN; /* first byte offset */ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = GEM_RD_BUFLEN(rxstat); @@ -1559,7 +1597,7 @@ gem_rint(struct gem_softc *sc) } #ifdef GEM_DEBUG - CTR3(KTR_GEM, "%s: done sc->rxptr %d, complete %d", __func__, + CTR3(KTR_GEM, "%s: done sc->sc_rxptr %d, complete %d", __func__, sc->sc_rxptr, GEM_BANK1_READ_4(sc, GEM_RX_COMPLETION)); #endif } @@ -1572,6 +1610,8 @@ gem_add_rxbuf(struct gem_softc *sc, int bus_dma_segment_t segs[1]; int error, nsegs; + GEM_LOCK_ASSERT(sc, MA_OWNED); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); @@ -1620,7 +1660,15 @@ gem_eint(struct gem_softc *sc, u_int sta return; } - device_printf(sc->sc_dev, "%s: status=%x\n", __func__, status); + device_printf(sc->sc_dev, "%s: status 0x%x", __func__, status); + if ((status & GEM_INTR_BERR) != 0) { + if ((sc->sc_flags & GEM_PCI) != 0) + printf(", PCI bus error 0x%x\n", + GEM_BANK1_READ_4(sc, GEM_PCI_ERROR_STATUS)); + else + printf(", SBus error 0x%x\n", + GEM_BANK1_READ_4(sc, GEM_SBUS_STATUS)); + } } void @@ -1634,8 +1682,8 @@ gem_intr(void *v) #ifdef GEM_DEBUG CTR4(KTR_GEM, "%s: %s: cplt %x, status %x", - device_get_name(sc->sc_dev), __func__, (status >> 19), - (u_int)status); + device_get_name(sc->sc_dev), __func__, + (status >> GEM_STATUS_TX_COMPLETION_SHFT), (u_int)status); /* * PCS interrupts must be cleared, otherwise no traffic is passed! @@ -1665,7 +1713,7 @@ gem_intr(void *v) device_printf(sc->sc_dev, "%s: MIF interrupt\n", __func__); #endif - if ((status & + if (__predict_false(status & (GEM_INTR_RX_TAG_ERR | GEM_INTR_PERR | GEM_INTR_BERR)) != 0) gem_eint(sc, status); @@ -1675,17 +1723,20 @@ gem_intr(void *v) if ((status & (GEM_INTR_TX_EMPTY | GEM_INTR_TX_INTME)) != 0) gem_tint(sc); - if (status & GEM_INTR_TX_MAC) { + if (__predict_false((status & GEM_INTR_TX_MAC) != 0)) { status2 = GEM_BANK1_READ_4(sc, GEM_MAC_TX_STATUS); if ((status2 & - ~(GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP)) != 0) + ~(GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP | + GEM_MAC_TX_PEAK_EXP)) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); if ((status2 & - (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) + (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) { + sc->sc_ifp->if_oerrors++; gem_init_locked(sc); + } } - if (status & GEM_INTR_RX_MAC) { + if (__predict_false((status & GEM_INTR_RX_MAC) != 0)) { status2 = GEM_BANK1_READ_4(sc, GEM_MAC_RX_STATUS); /* * At least with GEM_SUN_GEM and some GEM_SUN_ERI @@ -1906,6 +1957,8 @@ gem_mii_statchg(device_t dev) sc = device_get_softc(dev); + GEM_LOCK_ASSERT(sc, MA_OWNED); + #ifdef GEM_DEBUG if ((sc->sc_ifp->if_flags & IFF_DEBUG) != 0) device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", @@ -1985,7 +2038,7 @@ gem_mii_statchg(device_t dev) if ((GEM_BANK1_READ_4(sc, GEM_MIF_CONFIG) & GEM_MIF_CONFIG_PHY_SEL) != 0) { /* External MII needs echo disable if half duplex. */ - if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & + if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) == 0) v |= GEM_MAC_XIF_ECHO_DISABL; } else Modified: stable/7/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/7/sys/dev/gem/if_gem_pci.c Sun Sep 20 12:40:56 2009 (r197348) +++ stable/7/sys/dev/gem/if_gem_pci.c Sun Sep 20 12:56:50 2009 (r197349) @@ -90,7 +90,7 @@ static device_method_t gem_pci_methods[] DEVMETHOD(miibus_writereg, gem_mii_writereg), DEVMETHOD(miibus_statchg, gem_mii_statchg), - { 0, 0 } + KOBJMETHOD_END }; static driver_t gem_pci_driver = { @@ -107,7 +107,7 @@ static const struct gem_pci_dev { uint32_t gpd_devid; int gpd_variant; const char *gpd_desc; -} gem_pci_devlist[] = { +} const gem_pci_devlist[] = { { 0x1101108e, GEM_SUN_ERI, "Sun ERI 10/100 Ethernet" }, { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet" }, { 0x0021106b, GEM_APPLE_GMAC, "Apple UniNorth GMAC Ethernet" }, @@ -200,13 +200,18 @@ gem_pci_attach(device_t dev) GEM_PCI_BANK2_OFFSET, GEM_PCI_BANK2_SIZE, &sc->sc_res[GEM_RES_BANK2]->r_bushandle); + /* Determine whether we're running at 66MHz. */ + if ((GEM_BANK2_READ_4(sc, GEM_PCI_BIF_CONFIG) & + GEM_PCI_BIF_CNF_M66EN) != 0) + sc->sc_flags |= GEM_PCI66; + #if defined(__powerpc__) || defined(__sparc64__) OF_getetheraddr(dev, sc->sc_enaddr); #else /* * Dig out VPD (vital product data) and read NA (network address). - * The VPD of GEM resides in the PCI Expansion ROM (PCI FCode) and - * can't be accessed via the PCI capability pointer. + * The VPD resides in the PCI Expansion ROM (PCI FCode) and can't + * be accessed via the PCI capability pointer. * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and later) * chapter 2 describes the data structure. */ @@ -225,22 +230,21 @@ gem_pci_attach(device_t dev) #define PCI_VPDRES_BYTE0 0x00 #define PCI_VPDRES_ISLARGE(x) ((x) & 0x80) #define PCI_VPDRES_LARGE_NAME(x) ((x) & 0x7f) -#define PCI_VPDRES_TYPE_VPD 0x10 /* large */ #define PCI_VPDRES_LARGE_LEN_LSB 0x01 #define PCI_VPDRES_LARGE_LEN_MSB 0x02 -#define PCI_VPDRES_LARGE_DATA 0x03 -#define PCI_VPD_SIZE 0x03 +#define PCI_VPDRES_LARGE_SIZE 0x03 +#define PCI_VPDRES_TYPE_VPD 0x10 /* large */ #define PCI_VPD_KEY0 0x00 #define PCI_VPD_KEY1 0x01 #define PCI_VPD_LEN 0x02 -#define PCI_VPD_DATA 0x03 +#define PCI_VPD_SIZE 0x03 #define GEM_ROM_READ_1(sc, offs) \ - GEM_BANK1_READ_1((sc), GEM_PCI_ROM_OFFSET + (offs)) + GEM_BANK1_READ_1((sc), GEM_PCI_ROM_OFFSET + (offs)) #define GEM_ROM_READ_2(sc, offs) \ - GEM_BANK1_READ_2((sc), GEM_PCI_ROM_OFFSET + (offs)) + GEM_BANK1_READ_2((sc), GEM_PCI_ROM_OFFSET + (offs)) #define GEM_ROM_READ_4(sc, offs) \ - GEM_BANK1_READ_4((sc), GEM_PCI_ROM_OFFSET + (offs)) + GEM_BANK1_READ_4((sc), GEM_PCI_ROM_OFFSET + (offs)) /* Read PCI Expansion ROM header. */ if (GEM_ROM_READ_2(sc, PCI_ROMHDR_SIG) != PCI_ROMHDR_SIG_MAGIC || @@ -273,22 +277,22 @@ gem_pci_attach(device_t dev) j + PCI_VPDRES_BYTE0)) == 0 || PCI_VPDRES_LARGE_NAME(GEM_ROM_READ_1(sc, j + PCI_VPDRES_BYTE0)) != PCI_VPDRES_TYPE_VPD || - (GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_LEN_LSB) << 8 | + ((GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_LEN_LSB) << 8) | GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_LEN_MSB)) != PCI_VPD_SIZE + ETHER_ADDR_LEN || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_KEY0) != + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_KEY0) != 0x4e /* N */ || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_KEY1) != + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_KEY1) != 0x41 /* A */ || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_LEN) != + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_LEN) != ETHER_ADDR_LEN || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_DATA + + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_SIZE + ETHER_ADDR_LEN) != 0x79) { device_printf(dev, "unexpected PCI VPD\n"); goto fail; } bus_read_region_1(sc->sc_res[GEM_RES_BANK1], - GEM_PCI_ROM_OFFSET + j + PCI_VPDRES_LARGE_DATA + PCI_VPD_DATA, + GEM_PCI_ROM_OFFSET + j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_SIZE, sc->sc_enaddr, ETHER_ADDR_LEN); #endif @@ -330,19 +334,15 @@ gem_pci_detach(device_t dev) static int gem_pci_suspend(device_t dev) { - struct gem_softc *sc; - sc = device_get_softc(dev); - gem_suspend(sc); + gem_suspend(device_get_softc(dev)); return (0); } static int gem_pci_resume(device_t dev) { - struct gem_softc *sc; - sc = device_get_softc(dev); - gem_resume(sc); + gem_resume(device_get_softc(dev)); return (0); } Copied: stable/7/sys/dev/gem/if_gem_sbus.c (from r194763, head/sys/dev/gem/if_gem_sbus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/gem/if_gem_sbus.c Sun Sep 20 12:56:50 2009 (r197349, copy of r194763, head/sys/dev/gem/if_gem_sbus.c) @@ -0,0 +1,210 @@ +/*- + * Copyright (C) 2001 Eduardo Horvath. + * Copyright (c) 2007 Marius Strobl + * 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. + * + * from: NetBSD: if_gem_pci.c,v 1.7 2001/10/18 15:09:15 thorpej Exp + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * SBus bindings for Sun GEM Ethernet controllers + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include + +#include +#include + +#include "miibus_if.h" + +static device_probe_t gem_sbus_probe; +static device_attach_t gem_sbus_attach; +static device_detach_t gem_sbus_detach; +static device_suspend_t gem_sbus_suspend; +static device_resume_t gem_sbus_resume; + +static device_method_t gem_sbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gem_sbus_probe), + DEVMETHOD(device_attach, gem_sbus_attach), + DEVMETHOD(device_detach, gem_sbus_detach), + DEVMETHOD(device_suspend, gem_sbus_suspend), + DEVMETHOD(device_resume, gem_sbus_resume), + /* Use the suspend handler here, it is all that is required. */ + DEVMETHOD(device_shutdown, gem_sbus_suspend), + + /* bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* MII interface */ + DEVMETHOD(miibus_readreg, gem_mii_readreg), + DEVMETHOD(miibus_writereg, gem_mii_writereg), + DEVMETHOD(miibus_statchg, gem_mii_statchg), + + KOBJMETHOD_END +}; + +static driver_t gem_sbus_driver = { + "gem", + gem_sbus_methods, + sizeof(struct gem_softc) +}; + +DRIVER_MODULE(gem, sbus, gem_sbus_driver, gem_devclass, 0, 0); +MODULE_DEPEND(gem, sbus, 1, 1, 1); +MODULE_DEPEND(gem, ether, 1, 1, 1); + +static int +gem_sbus_probe(device_t dev) +{ + + if (strcmp(ofw_bus_get_name(dev), "network") == 0 && + ofw_bus_get_compat(dev) != NULL && + strcmp(ofw_bus_get_compat(dev), "SUNW,sbus-gem") == 0) { + device_set_desc(dev, "Sun GEM Gigabit Ethernet"); + return (0); + } + + return (ENXIO); +} + +static struct resource_spec gem_sbus_res_spec[] = { + { SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE }, /* GEM_RES_INTR */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* GEM_RES_BANK1 */ + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* GEM_RES_BANK2 */ + { -1, 0 } +}; + +static int +gem_sbus_attach(device_t dev) +{ + struct gem_softc *sc; + int burst; + uint32_t val; + + sc = device_get_softc(dev); + sc->sc_variant = GEM_SUN_GEM; + sc->sc_dev = dev; + + if (bus_alloc_resources(dev, gem_sbus_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); + return (ENXIO); + } + + GEM_LOCK_INIT(sc, device_get_nameunit(dev)); + + OF_getetheraddr(dev, sc->sc_enaddr); + + burst = sbus_get_burstsz(dev); + val = GEM_SBUS_CFG_PARITY; + if ((burst & SBUS_BURST64_MASK) != 0) { + val |= GEM_SBUS_CFG_64BIT; + burst >>= SBUS_BURST64_SHIFT; + } + if ((burst & SBUS_BURST_64) != 0) + val |= GEM_SBUS_CFG_BURST_64; + else if ((burst & SBUS_BURST_32) != 0) + val |= GEM_SBUS_CFG_BURST_32; + else { + device_printf(dev, "unsupported burst size\n"); + goto fail; + } + /* Reset the SBus interface only. */ + (void)GEM_BANK2_READ_4(sc, GEM_SBUS_BIF_RESET); + DELAY(100); + GEM_BANK2_WRITE_4(sc, GEM_SBUS_CONFIG, val); + + if (gem_attach(sc) != 0) { + device_printf(dev, "could not be attached\n"); + goto fail; + } + + if (bus_setup_intr(dev, sc->sc_res[GEM_RES_INTR], INTR_TYPE_NET | + INTR_MPSAFE, NULL, gem_intr, sc, &sc->sc_ih) != 0) { + device_printf(dev, "failed to set up interrupt\n"); + gem_detach(sc); + goto fail; + } + return (0); + + fail: + GEM_LOCK_DESTROY(sc); + bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); + return (ENXIO); +} + +static int +gem_sbus_detach(device_t dev) +{ + struct gem_softc *sc; + + sc = device_get_softc(dev); + bus_teardown_intr(dev, sc->sc_res[GEM_RES_INTR], sc->sc_ih); + gem_detach(sc); + GEM_LOCK_DESTROY(sc); + bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); + return (0); +} + +static int +gem_sbus_suspend(device_t dev) +{ + + gem_suspend(device_get_softc(dev)); + return (0); +} + +static int +gem_sbus_resume(device_t dev) +{ + + gem_resume(device_get_softc(dev)); + return (0); +} Modified: stable/7/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/7/sys/dev/gem/if_gemreg.h Sun Sep 20 12:40:56 2009 (r197348) +++ stable/7/sys/dev/gem/if_gemreg.h Sun Sep 20 12:56:50 2009 (r197349) @@ -32,7 +32,7 @@ #ifndef _IF_GEMREG_H #define _IF_GEMREG_H -/* Register definitions for Sun GEM gigabit ethernet */ +/* register definitions for Apple GMAC, Sun ERI and Sun GEM */ /* * First bank: this registers live at the start of the PCI @@ -47,97 +47,110 @@ #define GEM_INTACK 0x0014 /* Interrupt acknowledge, W/O */ #define GEM_STATUS_ALIAS 0x001c *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 13:28:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3CA61065670; Sun, 20 Sep 2009 13:28: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 B29618FC12; Sun, 20 Sep 2009 13:28:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KDSJ7u057825; Sun, 20 Sep 2009 13:28:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KDSJnm057823; Sun, 20 Sep 2009 13:28:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909201328.n8KDSJnm057823@svn.freebsd.org> From: John Baldwin Date: Sun, 20 Sep 2009 13:28: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: r197350 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 13:28:19 -0000 Author: jhb Date: Sun Sep 20 13:28:19 2009 New Revision: 197350 URL: http://svn.freebsd.org/changeset/base/197350 Log: Re-remove the IBM0057 ID used for PS/2 mouse controllers. The asl for the 61p includes the hotkey device as IBM0068 and the mouse as IBM0057 similar to other systems. Submitted by: marius MFC after: 3 days Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Sun Sep 20 12:56:50 2009 (r197349) +++ head/sys/dev/acpi_support/acpi_ibm.c Sun Sep 20 13:28:19 2009 (r197350) @@ -288,7 +288,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0057", "IBM0068", NULL}; +static char *ibm_ids[] = {"IBM0068", NULL}; static void ibm_led(void *softc, int onoff) From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 13:28:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 250601065676; Sun, 20 Sep 2009 13:28:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 135188FC15; Sun, 20 Sep 2009 13:28:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KDSTAF057872; Sun, 20 Sep 2009 13:28:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KDST3f057869; Sun, 20 Sep 2009 13:28:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909201328.n8KDST3f057869@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 20 Sep 2009 13:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197351 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 13:28:30 -0000 Author: pjd Date: Sun Sep 20 13:28:29 2009 New Revision: 197351 URL: http://svn.freebsd.org/changeset/base/197351 Log: Purge namecache in the same place OpenSolaris does. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Sep 20 13:28:19 2009 (r197350) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Sep 20 13:28:29 2009 (r197351) @@ -2354,9 +2354,6 @@ zfs_ioc_rollback(zfs_cmd_t *zc) if (error == 0) { int resume_err; -#ifdef FREEBSD_NAMECACHE - cache_purgevfs(zfsvfs->z_vfs); -#endif ASSERT(strcmp(osname, zc->zc_name) == 0); error = dmu_objset_rollback(os); resume_err = zfs_resume_fs(zfsvfs, osname, mode); @@ -2543,9 +2540,6 @@ zfs_ioc_recv(zfs_cmd_t *zc) if (error == 0) { int resume_err; -#ifdef FREEBSD_NAMECACHE - cache_purgevfs(zfsvfs->z_vfs); -#endif error = dmu_recv_end(&drc); resume_err = zfs_resume_fs(zfsvfs, osname, mode); error = error ? error : resume_err; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 20 13:28:19 2009 (r197350) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 20 13:28:29 2009 (r197351) @@ -898,6 +898,9 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea * 'z_parent' is self referential for non-snapshots. */ (void) dnlc_purge_vfsp(zfsvfs->z_parent->z_vfs, 0); +#ifdef FREEBSD_NAMECACHE + cache_purgevfs(zfsvfs->z_parent->z_vfs); +#endif } /* From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 13:39:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99EB9106566C; Sun, 20 Sep 2009 13:39:45 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8488E8FC0A; Sun, 20 Sep 2009 13:39:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KDdjVY058173; Sun, 20 Sep 2009 13:39:45 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KDdjSA058122; Sun, 20 Sep 2009 13:39:45 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909201339.n8KDdjSA058122@svn.freebsd.org> From: Diomidis Spinellis Date: Sun, 20 Sep 2009 13:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197352 - in head/tools/regression/usr.bin/sed: . regress.multitest.out X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 13:39:45 -0000 Author: dds Date: Sun Sep 20 13:39:44 2009 New Revision: 197352 URL: http://svn.freebsd.org/changeset/base/197352 Log: The transition to Subversion allows us to rename files without repo-copy hacks. Remove the test-number prefix from the name of the output files, so that new test cases can be easily added. Added: head/tools/regression/usr.bin/sed/regress.multitest.out/1.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/1_1.1 head/tools/regression/usr.bin/sed/regress.multitest.out/1.10 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/11_1.10 head/tools/regression/usr.bin/sed/regress.multitest.out/1.11 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/12_1.11 head/tools/regression/usr.bin/sed/regress.multitest.out/1.12 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/13_1.12 head/tools/regression/usr.bin/sed/regress.multitest.out/1.13 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/14_1.13 head/tools/regression/usr.bin/sed/regress.multitest.out/1.14 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/15_1.14 head/tools/regression/usr.bin/sed/regress.multitest.out/1.15 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/16_1.15 head/tools/regression/usr.bin/sed/regress.multitest.out/1.16 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/17_1.16 head/tools/regression/usr.bin/sed/regress.multitest.out/1.17 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/18_1.17 head/tools/regression/usr.bin/sed/regress.multitest.out/1.18 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/19_1.18 head/tools/regression/usr.bin/sed/regress.multitest.out/1.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/2_1.2 head/tools/regression/usr.bin/sed/regress.multitest.out/1.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/3_1.3 head/tools/regression/usr.bin/sed/regress.multitest.out/1.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/4_1.4 head/tools/regression/usr.bin/sed/regress.multitest.out/1.4.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/5_1.4.1 head/tools/regression/usr.bin/sed/regress.multitest.out/1.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/6_1.5 head/tools/regression/usr.bin/sed/regress.multitest.out/1.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/7_1.6 head/tools/regression/usr.bin/sed/regress.multitest.out/1.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/8_1.7 head/tools/regression/usr.bin/sed/regress.multitest.out/1.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/9_1.8 head/tools/regression/usr.bin/sed/regress.multitest.out/1.9 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/10_1.9 head/tools/regression/usr.bin/sed/regress.multitest.out/2.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/20_2.1 head/tools/regression/usr.bin/sed/regress.multitest.out/2.10 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/29_2.10 head/tools/regression/usr.bin/sed/regress.multitest.out/2.11 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/30_2.11 head/tools/regression/usr.bin/sed/regress.multitest.out/2.12 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/31_2.12 head/tools/regression/usr.bin/sed/regress.multitest.out/2.13 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/32_2.13 head/tools/regression/usr.bin/sed/regress.multitest.out/2.14 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/33_2.14 head/tools/regression/usr.bin/sed/regress.multitest.out/2.15 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/34_2.15 head/tools/regression/usr.bin/sed/regress.multitest.out/2.16 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/35_2.16 head/tools/regression/usr.bin/sed/regress.multitest.out/2.17 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/36_2.17 head/tools/regression/usr.bin/sed/regress.multitest.out/2.18 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/37_2.18 head/tools/regression/usr.bin/sed/regress.multitest.out/2.19 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/38_2.19 head/tools/regression/usr.bin/sed/regress.multitest.out/2.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/21_2.2 head/tools/regression/usr.bin/sed/regress.multitest.out/2.20 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/39_2.20 head/tools/regression/usr.bin/sed/regress.multitest.out/2.21 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/40_2.21 head/tools/regression/usr.bin/sed/regress.multitest.out/2.22 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/41_2.22 head/tools/regression/usr.bin/sed/regress.multitest.out/2.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/22_2.3 head/tools/regression/usr.bin/sed/regress.multitest.out/2.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/23_2.4 head/tools/regression/usr.bin/sed/regress.multitest.out/2.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/24_2.5 head/tools/regression/usr.bin/sed/regress.multitest.out/2.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/25_2.6 head/tools/regression/usr.bin/sed/regress.multitest.out/2.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/26_2.7 head/tools/regression/usr.bin/sed/regress.multitest.out/2.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/27_2.8 head/tools/regression/usr.bin/sed/regress.multitest.out/2.9 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/28_2.9 head/tools/regression/usr.bin/sed/regress.multitest.out/3.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/40_3.1 head/tools/regression/usr.bin/sed/regress.multitest.out/3.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/41_3.2 head/tools/regression/usr.bin/sed/regress.multitest.out/3.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/42_3.3 head/tools/regression/usr.bin/sed/regress.multitest.out/3.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/43_3.4 head/tools/regression/usr.bin/sed/regress.multitest.out/4.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/44_4.1 head/tools/regression/usr.bin/sed/regress.multitest.out/4.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/45_4.2 head/tools/regression/usr.bin/sed/regress.multitest.out/4.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/46_4.3 head/tools/regression/usr.bin/sed/regress.multitest.out/4.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/47_4.4 head/tools/regression/usr.bin/sed/regress.multitest.out/4.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/48_4.5 head/tools/regression/usr.bin/sed/regress.multitest.out/4.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/49_4.6 head/tools/regression/usr.bin/sed/regress.multitest.out/4.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/50_4.7 head/tools/regression/usr.bin/sed/regress.multitest.out/4.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/51_4.8 head/tools/regression/usr.bin/sed/regress.multitest.out/5.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/52_5.1 head/tools/regression/usr.bin/sed/regress.multitest.out/5.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/53_5.2 head/tools/regression/usr.bin/sed/regress.multitest.out/5.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/54_5.3 head/tools/regression/usr.bin/sed/regress.multitest.out/5.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/55_5.4 head/tools/regression/usr.bin/sed/regress.multitest.out/5.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/56_5.5 head/tools/regression/usr.bin/sed/regress.multitest.out/5.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/57_5.6 head/tools/regression/usr.bin/sed/regress.multitest.out/5.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/58_5.7 head/tools/regression/usr.bin/sed/regress.multitest.out/5.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/59_5.8 head/tools/regression/usr.bin/sed/regress.multitest.out/6.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/60_6.1 head/tools/regression/usr.bin/sed/regress.multitest.out/6.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/61_6.2 head/tools/regression/usr.bin/sed/regress.multitest.out/6.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/62_6.3 head/tools/regression/usr.bin/sed/regress.multitest.out/6.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/63_6.4 head/tools/regression/usr.bin/sed/regress.multitest.out/6.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/64_6.5 head/tools/regression/usr.bin/sed/regress.multitest.out/6.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/65_6.6 head/tools/regression/usr.bin/sed/regress.multitest.out/7.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/66_7.1 head/tools/regression/usr.bin/sed/regress.multitest.out/7.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/67_7.2 head/tools/regression/usr.bin/sed/regress.multitest.out/7.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/68_7.3 head/tools/regression/usr.bin/sed/regress.multitest.out/7.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/69_7.4 head/tools/regression/usr.bin/sed/regress.multitest.out/7.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/70_7.5 head/tools/regression/usr.bin/sed/regress.multitest.out/7.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/71_7.6 head/tools/regression/usr.bin/sed/regress.multitest.out/7.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/72_7.7 head/tools/regression/usr.bin/sed/regress.multitest.out/7.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/73_7.8 head/tools/regression/usr.bin/sed/regress.multitest.out/8.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/74_8.1 head/tools/regression/usr.bin/sed/regress.multitest.out/8.10 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/83_8.10 head/tools/regression/usr.bin/sed/regress.multitest.out/8.11 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/84_8.11 head/tools/regression/usr.bin/sed/regress.multitest.out/8.12 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/85_8.12 head/tools/regression/usr.bin/sed/regress.multitest.out/8.13 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/86_8.13 head/tools/regression/usr.bin/sed/regress.multitest.out/8.14 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/87_8.14 head/tools/regression/usr.bin/sed/regress.multitest.out/8.15 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/88_8.15 head/tools/regression/usr.bin/sed/regress.multitest.out/8.16 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/89_8.16 head/tools/regression/usr.bin/sed/regress.multitest.out/8.17 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/90_8.17 head/tools/regression/usr.bin/sed/regress.multitest.out/8.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/75_8.2 head/tools/regression/usr.bin/sed/regress.multitest.out/8.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/76_8.3 head/tools/regression/usr.bin/sed/regress.multitest.out/8.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/77_8.4 head/tools/regression/usr.bin/sed/regress.multitest.out/8.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/78_8.5 head/tools/regression/usr.bin/sed/regress.multitest.out/8.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/79_8.6 head/tools/regression/usr.bin/sed/regress.multitest.out/8.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/80_8.7 head/tools/regression/usr.bin/sed/regress.multitest.out/8.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/81_8.8 head/tools/regression/usr.bin/sed/regress.multitest.out/8.9 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/82_8.9 head/tools/regression/usr.bin/sed/regress.multitest.out/9.1 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/91_9.1 head/tools/regression/usr.bin/sed/regress.multitest.out/9.10 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/100_9.10 head/tools/regression/usr.bin/sed/regress.multitest.out/9.11 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/101_9.11 head/tools/regression/usr.bin/sed/regress.multitest.out/9.12 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/102_9.12 head/tools/regression/usr.bin/sed/regress.multitest.out/9.13 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/103_9.13 head/tools/regression/usr.bin/sed/regress.multitest.out/9.14 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/104_9.14 head/tools/regression/usr.bin/sed/regress.multitest.out/9.15 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/105_9.15 head/tools/regression/usr.bin/sed/regress.multitest.out/9.16 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/106_9.16 head/tools/regression/usr.bin/sed/regress.multitest.out/9.17 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/107_9.17 head/tools/regression/usr.bin/sed/regress.multitest.out/9.18 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/108_9.18 head/tools/regression/usr.bin/sed/regress.multitest.out/9.19 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/109_9.19 head/tools/regression/usr.bin/sed/regress.multitest.out/9.2 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/92_9.2 head/tools/regression/usr.bin/sed/regress.multitest.out/9.20 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/110_9.20 head/tools/regression/usr.bin/sed/regress.multitest.out/9.21 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/111_9.21 head/tools/regression/usr.bin/sed/regress.multitest.out/9.22 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/112_9.22 head/tools/regression/usr.bin/sed/regress.multitest.out/9.23 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/113_9.23 head/tools/regression/usr.bin/sed/regress.multitest.out/9.24 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/114_9.24 head/tools/regression/usr.bin/sed/regress.multitest.out/9.25 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/115_9.25 head/tools/regression/usr.bin/sed/regress.multitest.out/9.26 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/116_9.26 head/tools/regression/usr.bin/sed/regress.multitest.out/9.27 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/117_9.27 head/tools/regression/usr.bin/sed/regress.multitest.out/9.28 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/118_9.28 head/tools/regression/usr.bin/sed/regress.multitest.out/9.29 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/119_9.29 head/tools/regression/usr.bin/sed/regress.multitest.out/9.3 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/93_9.3 head/tools/regression/usr.bin/sed/regress.multitest.out/9.30 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/120_9.30 head/tools/regression/usr.bin/sed/regress.multitest.out/9.31 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/121_9.31 head/tools/regression/usr.bin/sed/regress.multitest.out/9.4 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/94_9.4 head/tools/regression/usr.bin/sed/regress.multitest.out/9.5 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/95_9.5 head/tools/regression/usr.bin/sed/regress.multitest.out/9.6 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/96_9.6 head/tools/regression/usr.bin/sed/regress.multitest.out/9.7 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/97_9.7 head/tools/regression/usr.bin/sed/regress.multitest.out/9.8 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/98_9.8 head/tools/regression/usr.bin/sed/regress.multitest.out/9.9 (props changed) - copied unchanged from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/99_9.9 Deleted: head/tools/regression/usr.bin/sed/regress.multitest.out/100_9.10 head/tools/regression/usr.bin/sed/regress.multitest.out/101_9.11 head/tools/regression/usr.bin/sed/regress.multitest.out/102_9.12 head/tools/regression/usr.bin/sed/regress.multitest.out/103_9.13 head/tools/regression/usr.bin/sed/regress.multitest.out/104_9.14 head/tools/regression/usr.bin/sed/regress.multitest.out/105_9.15 head/tools/regression/usr.bin/sed/regress.multitest.out/106_9.16 head/tools/regression/usr.bin/sed/regress.multitest.out/107_9.17 head/tools/regression/usr.bin/sed/regress.multitest.out/108_9.18 head/tools/regression/usr.bin/sed/regress.multitest.out/109_9.19 head/tools/regression/usr.bin/sed/regress.multitest.out/10_1.9 head/tools/regression/usr.bin/sed/regress.multitest.out/110_9.20 head/tools/regression/usr.bin/sed/regress.multitest.out/111_9.21 head/tools/regression/usr.bin/sed/regress.multitest.out/112_9.22 head/tools/regression/usr.bin/sed/regress.multitest.out/113_9.23 head/tools/regression/usr.bin/sed/regress.multitest.out/114_9.24 head/tools/regression/usr.bin/sed/regress.multitest.out/115_9.25 head/tools/regression/usr.bin/sed/regress.multitest.out/116_9.26 head/tools/regression/usr.bin/sed/regress.multitest.out/117_9.27 head/tools/regression/usr.bin/sed/regress.multitest.out/118_9.28 head/tools/regression/usr.bin/sed/regress.multitest.out/119_9.29 head/tools/regression/usr.bin/sed/regress.multitest.out/11_1.10 head/tools/regression/usr.bin/sed/regress.multitest.out/120_9.30 head/tools/regression/usr.bin/sed/regress.multitest.out/121_9.31 head/tools/regression/usr.bin/sed/regress.multitest.out/12_1.11 head/tools/regression/usr.bin/sed/regress.multitest.out/13_1.12 head/tools/regression/usr.bin/sed/regress.multitest.out/14_1.13 head/tools/regression/usr.bin/sed/regress.multitest.out/15_1.14 head/tools/regression/usr.bin/sed/regress.multitest.out/16_1.15 head/tools/regression/usr.bin/sed/regress.multitest.out/17_1.16 head/tools/regression/usr.bin/sed/regress.multitest.out/18_1.17 head/tools/regression/usr.bin/sed/regress.multitest.out/19_1.18 head/tools/regression/usr.bin/sed/regress.multitest.out/1_1.1 head/tools/regression/usr.bin/sed/regress.multitest.out/20_2.1 head/tools/regression/usr.bin/sed/regress.multitest.out/21_2.2 head/tools/regression/usr.bin/sed/regress.multitest.out/22_2.3 head/tools/regression/usr.bin/sed/regress.multitest.out/23_2.4 head/tools/regression/usr.bin/sed/regress.multitest.out/24_2.5 head/tools/regression/usr.bin/sed/regress.multitest.out/25_2.6 head/tools/regression/usr.bin/sed/regress.multitest.out/26_2.7 head/tools/regression/usr.bin/sed/regress.multitest.out/27_2.8 head/tools/regression/usr.bin/sed/regress.multitest.out/28_2.9 head/tools/regression/usr.bin/sed/regress.multitest.out/29_2.10 head/tools/regression/usr.bin/sed/regress.multitest.out/2_1.2 head/tools/regression/usr.bin/sed/regress.multitest.out/30_2.11 head/tools/regression/usr.bin/sed/regress.multitest.out/31_2.12 head/tools/regression/usr.bin/sed/regress.multitest.out/32_2.13 head/tools/regression/usr.bin/sed/regress.multitest.out/33_2.14 head/tools/regression/usr.bin/sed/regress.multitest.out/34_2.15 head/tools/regression/usr.bin/sed/regress.multitest.out/35_2.16 head/tools/regression/usr.bin/sed/regress.multitest.out/36_2.17 head/tools/regression/usr.bin/sed/regress.multitest.out/37_2.18 head/tools/regression/usr.bin/sed/regress.multitest.out/38_2.19 head/tools/regression/usr.bin/sed/regress.multitest.out/39_2.20 head/tools/regression/usr.bin/sed/regress.multitest.out/3_1.3 head/tools/regression/usr.bin/sed/regress.multitest.out/40_2.21 head/tools/regression/usr.bin/sed/regress.multitest.out/40_3.1 head/tools/regression/usr.bin/sed/regress.multitest.out/41_2.22 head/tools/regression/usr.bin/sed/regress.multitest.out/41_3.2 head/tools/regression/usr.bin/sed/regress.multitest.out/42_3.3 head/tools/regression/usr.bin/sed/regress.multitest.out/43_3.4 head/tools/regression/usr.bin/sed/regress.multitest.out/44_4.1 head/tools/regression/usr.bin/sed/regress.multitest.out/45_4.2 head/tools/regression/usr.bin/sed/regress.multitest.out/46_4.3 head/tools/regression/usr.bin/sed/regress.multitest.out/47_4.4 head/tools/regression/usr.bin/sed/regress.multitest.out/48_4.5 head/tools/regression/usr.bin/sed/regress.multitest.out/49_4.6 head/tools/regression/usr.bin/sed/regress.multitest.out/4_1.4 head/tools/regression/usr.bin/sed/regress.multitest.out/50_4.7 head/tools/regression/usr.bin/sed/regress.multitest.out/51_4.8 head/tools/regression/usr.bin/sed/regress.multitest.out/52_5.1 head/tools/regression/usr.bin/sed/regress.multitest.out/53_5.2 head/tools/regression/usr.bin/sed/regress.multitest.out/54_5.3 head/tools/regression/usr.bin/sed/regress.multitest.out/55_5.4 head/tools/regression/usr.bin/sed/regress.multitest.out/56_5.5 head/tools/regression/usr.bin/sed/regress.multitest.out/57_5.6 head/tools/regression/usr.bin/sed/regress.multitest.out/58_5.7 head/tools/regression/usr.bin/sed/regress.multitest.out/59_5.8 head/tools/regression/usr.bin/sed/regress.multitest.out/5_1.4.1 head/tools/regression/usr.bin/sed/regress.multitest.out/60_6.1 head/tools/regression/usr.bin/sed/regress.multitest.out/61_6.2 head/tools/regression/usr.bin/sed/regress.multitest.out/62_6.3 head/tools/regression/usr.bin/sed/regress.multitest.out/63_6.4 head/tools/regression/usr.bin/sed/regress.multitest.out/64_6.5 head/tools/regression/usr.bin/sed/regress.multitest.out/65_6.6 head/tools/regression/usr.bin/sed/regress.multitest.out/66_7.1 head/tools/regression/usr.bin/sed/regress.multitest.out/67_7.2 head/tools/regression/usr.bin/sed/regress.multitest.out/68_7.3 head/tools/regression/usr.bin/sed/regress.multitest.out/69_7.4 head/tools/regression/usr.bin/sed/regress.multitest.out/6_1.5 head/tools/regression/usr.bin/sed/regress.multitest.out/70_7.5 head/tools/regression/usr.bin/sed/regress.multitest.out/71_7.6 head/tools/regression/usr.bin/sed/regress.multitest.out/72_7.7 head/tools/regression/usr.bin/sed/regress.multitest.out/73_7.8 head/tools/regression/usr.bin/sed/regress.multitest.out/74_8.1 head/tools/regression/usr.bin/sed/regress.multitest.out/75_8.2 head/tools/regression/usr.bin/sed/regress.multitest.out/76_8.3 head/tools/regression/usr.bin/sed/regress.multitest.out/77_8.4 head/tools/regression/usr.bin/sed/regress.multitest.out/78_8.5 head/tools/regression/usr.bin/sed/regress.multitest.out/79_8.6 head/tools/regression/usr.bin/sed/regress.multitest.out/7_1.6 head/tools/regression/usr.bin/sed/regress.multitest.out/80_8.7 head/tools/regression/usr.bin/sed/regress.multitest.out/81_8.8 head/tools/regression/usr.bin/sed/regress.multitest.out/82_8.9 head/tools/regression/usr.bin/sed/regress.multitest.out/83_8.10 head/tools/regression/usr.bin/sed/regress.multitest.out/84_8.11 head/tools/regression/usr.bin/sed/regress.multitest.out/85_8.12 head/tools/regression/usr.bin/sed/regress.multitest.out/86_8.13 head/tools/regression/usr.bin/sed/regress.multitest.out/87_8.14 head/tools/regression/usr.bin/sed/regress.multitest.out/88_8.15 head/tools/regression/usr.bin/sed/regress.multitest.out/89_8.16 head/tools/regression/usr.bin/sed/regress.multitest.out/8_1.7 head/tools/regression/usr.bin/sed/regress.multitest.out/90_8.17 head/tools/regression/usr.bin/sed/regress.multitest.out/91_9.1 head/tools/regression/usr.bin/sed/regress.multitest.out/92_9.2 head/tools/regression/usr.bin/sed/regress.multitest.out/93_9.3 head/tools/regression/usr.bin/sed/regress.multitest.out/94_9.4 head/tools/regression/usr.bin/sed/regress.multitest.out/95_9.5 head/tools/regression/usr.bin/sed/regress.multitest.out/96_9.6 head/tools/regression/usr.bin/sed/regress.multitest.out/97_9.7 head/tools/regression/usr.bin/sed/regress.multitest.out/98_9.8 head/tools/regression/usr.bin/sed/regress.multitest.out/99_9.9 head/tools/regression/usr.bin/sed/regress.multitest.out/9_1.8 Modified: head/tools/regression/usr.bin/sed/multitest.t Modified: head/tools/regression/usr.bin/sed/multitest.t ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 13:28:29 2009 (r197351) +++ head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 13:39:44 2009 (r197352) @@ -37,11 +37,9 @@ # # The directory regress.test.out contains the expected test results # -# These are the regression tests created during the development of the -# BSD sed. The reference file naming scheme used in this script can't -# handle gracefully the insertion of new tests between existing ones. -# Therefore, either use the new m4-based regress.t framework, or add -# tests after the last existing test. +# These are the regression tests mostly created during the development +# of the BSD sed. Each test should have a unique mark name, which is +# used for naming the corresponding file in regress.multitest.out. main() { @@ -88,11 +86,11 @@ result() else TODO='' fi - if ! [ -r $REGRESS/${MARK}_${TESTNAME} ] ; then - echo "Seeding $REGRESS/${MARK}_${TESTNAME} with current result" 1>&2 - cp current.out $REGRESS/${MARK}_${TESTNAME} + if ! [ -r $REGRESS/${TESTNAME} ] ; then + echo "Seeding $REGRESS/${TESTNAME} with current result" 1>&2 + cp current.out $REGRESS/${TESTNAME} fi - if diff -c $REGRESS/${MARK}_${TESTNAME} current.out ; then + if diff -c $REGRESS/${TESTNAME} current.out ; then echo "ok $MARK $TESTNAME # $TODO$COMMENT" else echo "not ok $MARK $TESTNAME # $TODO$COMMENT" Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.1 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/1_1.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.1 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/1_1.1) @@ -0,0 +1,28 @@ +e1_l1_1 +e1_l1_1 +e1_l1_2 +e1_l1_2 +e1_l1_3 +e1_l1_3 +e1_l1_4 +e1_l1_4 +e1_l1_5 +e1_l1_5 +e1_l1_6 +e1_l1_6 +e1_l1_7 +e1_l1_7 +e1_l1_8 +e1_l1_8 +e1_l1_9 +e1_l1_9 +e1_l1_10 +e1_l1_10 +e1_l1_11 +e1_l1_11 +e1_l1_12 +e1_l1_12 +e1_l1_13 +e1_l1_13 +e1_l1_14 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.10 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/11_1.10) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.10 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/11_1.10) @@ -0,0 +1,14 @@ +s1_l1_1 +s1_l1_2 +s1_l1_3 +s1_l1_4 +s1_l1_5 +s1_l1_6 +s1_l1_7 +s1_l1_8 +s1_l1_9 +s1_l1_10 +s1_l1_11 +s1_l1_12 +s1_l1_13 +s1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.11 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/12_1.11) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.11 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/12_1.11) @@ -0,0 +1,14 @@ +e1_l1_1 +e1_l1_2 +e1_l1_3 +e1_l1_4 +e1_l1_5 +e1_l1_6 +e1_l1_7 +e1_l1_8 +e1_l1_9 +e1_l1_10 +e1_l1_11 +e1_l1_12 +e1_l1_13 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.12 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/13_1.12) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.12 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/13_1.12) @@ -0,0 +1,14 @@ +e1_l1_1 +e1_l1_2 +e1_l1_3 +e1_l1_4 +e1_l1_5 +e1_l1_6 +e1_l1_7 +e1_l1_8 +e1_l1_9 +e1_l1_10 +e1_l1_11 +e1_l1_12 +e1_l1_13 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.13 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/14_1.13) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.13 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/14_1.13) @@ -0,0 +1,42 @@ +e1_l1_1 +e2_e1_l1_1 +e2_e1_l1_1 +e1_l1_2 +e2_e1_l1_2 +e2_e1_l1_2 +e1_l1_3 +e2_e1_l1_3 +e2_e1_l1_3 +e1_l1_4 +e2_e1_l1_4 +e2_e1_l1_4 +e1_l1_5 +e2_e1_l1_5 +e2_e1_l1_5 +e1_l1_6 +e2_e1_l1_6 +e2_e1_l1_6 +e1_l1_7 +e2_e1_l1_7 +e2_e1_l1_7 +e1_l1_8 +e2_e1_l1_8 +e2_e1_l1_8 +e1_l1_9 +e2_e1_l1_9 +e2_e1_l1_9 +e1_l1_10 +e2_e1_l1_10 +e2_e1_l1_10 +e1_l1_11 +e2_e1_l1_11 +e2_e1_l1_11 +e1_l1_12 +e2_e1_l1_12 +e2_e1_l1_12 +e1_l1_13 +e2_e1_l1_13 +e2_e1_l1_13 +e1_l1_14 +e2_e1_l1_14 +e2_e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.14 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/15_1.14) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.14 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/15_1.14) @@ -0,0 +1,42 @@ +s1_l1_1 +s2_s1_l1_1 +s2_s1_l1_1 +s1_l1_2 +s2_s1_l1_2 +s2_s1_l1_2 +s1_l1_3 +s2_s1_l1_3 +s2_s1_l1_3 +s1_l1_4 +s2_s1_l1_4 +s2_s1_l1_4 +s1_l1_5 +s2_s1_l1_5 +s2_s1_l1_5 +s1_l1_6 +s2_s1_l1_6 +s2_s1_l1_6 +s1_l1_7 +s2_s1_l1_7 +s2_s1_l1_7 +s1_l1_8 +s2_s1_l1_8 +s2_s1_l1_8 +s1_l1_9 +s2_s1_l1_9 +s2_s1_l1_9 +s1_l1_10 +s2_s1_l1_10 +s2_s1_l1_10 +s1_l1_11 +s2_s1_l1_11 +s2_s1_l1_11 +s1_l1_12 +s2_s1_l1_12 +s2_s1_l1_12 +s1_l1_13 +s2_s1_l1_13 +s2_s1_l1_13 +s1_l1_14 +s2_s1_l1_14 +s2_s1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.15 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/16_1.15) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.15 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/16_1.15) @@ -0,0 +1,42 @@ +e1_l1_1 +s1_e1_l1_1 +s1_e1_l1_1 +e1_l1_2 +s1_e1_l1_2 +s1_e1_l1_2 +e1_l1_3 +s1_e1_l1_3 +s1_e1_l1_3 +e1_l1_4 +s1_e1_l1_4 +s1_e1_l1_4 +e1_l1_5 +s1_e1_l1_5 +s1_e1_l1_5 +e1_l1_6 +s1_e1_l1_6 +s1_e1_l1_6 +e1_l1_7 +s1_e1_l1_7 +s1_e1_l1_7 +e1_l1_8 +s1_e1_l1_8 +s1_e1_l1_8 +e1_l1_9 +s1_e1_l1_9 +s1_e1_l1_9 +e1_l1_10 +s1_e1_l1_10 +s1_e1_l1_10 +e1_l1_11 +s1_e1_l1_11 +s1_e1_l1_11 +e1_l1_12 +s1_e1_l1_12 +s1_e1_l1_12 +e1_l1_13 +s1_e1_l1_13 +s1_e1_l1_13 +e1_l1_14 +s1_e1_l1_14 +s1_e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.16 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/17_1.16) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.16 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/17_1.16) @@ -0,0 +1,56 @@ +e1_l1_1 +e1_l1_1 +e1_l1_2 +e1_l1_2 +e1_l1_3 +e1_l1_3 +e1_l1_4 +e1_l1_4 +e1_l1_5 +e1_l1_5 +e1_l1_6 +e1_l1_6 +e1_l1_7 +e1_l1_7 +e1_l1_8 +e1_l1_8 +e1_l1_9 +e1_l1_9 +e1_l1_10 +e1_l1_10 +e1_l1_11 +e1_l1_11 +e1_l1_12 +e1_l1_12 +e1_l1_13 +e1_l1_13 +e1_l1_14 +e1_l1_14 +e1_l1_1 +e1_l1_1 +e1_l1_2 +e1_l1_2 +e1_l1_3 +e1_l1_3 +e1_l1_4 +e1_l1_4 +e1_l1_5 +e1_l1_5 +e1_l1_6 +e1_l1_6 +e1_l1_7 +e1_l1_7 +e1_l1_8 +e1_l1_8 +e1_l1_9 +e1_l1_9 +e1_l1_10 +e1_l1_10 +e1_l1_11 +e1_l1_11 +e1_l1_12 +e1_l1_12 +e1_l1_13 +e1_l1_13 +e1_l1_14 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.17 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/18_1.17) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.17 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/18_1.17) @@ -0,0 +1,28 @@ +l1_1 +l1_1 +l1_2 +l1_2 +l1_3 +l1_3 +l1_4 +l1_4 +l1_5 +l1_5 +l1_6 +l1_6 +l1_7 +l1_7 +l1_8 +l1_8 +l1_9 +l1_9 +l1_10 +l1_10 +l1_11 +l1_11 +l1_12 +l1_12 +l1_13 +l1_13 +l1_14 +l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.18 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/19_1.18) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.18 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/19_1.18) @@ -0,0 +1,14 @@ +l1_1 +l1_2 +l1_3 +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +l1_13 +l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.2 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/2_1.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.2 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/2_1.2) @@ -0,0 +1,14 @@ +e1_l1_1 +e1_l1_2 +e1_l1_3 +e1_l1_4 +e1_l1_5 +e1_l1_6 +e1_l1_7 +e1_l1_8 +e1_l1_9 +e1_l1_10 +e1_l1_11 +e1_l1_12 +e1_l1_13 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.3 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/3_1.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.3 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/3_1.3) @@ -0,0 +1,28 @@ +e1_l1_1 +e1_l1_1 +e1_l1_2 +e1_l1_2 +e1_l1_3 +e1_l1_3 +e1_l1_4 +e1_l1_4 +e1_l1_5 +e1_l1_5 +e1_l1_6 +e1_l1_6 +e1_l1_7 +e1_l1_7 +e1_l1_8 +e1_l1_8 +e1_l1_9 +e1_l1_9 +e1_l1_10 +e1_l1_10 +e1_l1_11 +e1_l1_11 +e1_l1_12 +e1_l1_12 +e1_l1_13 +e1_l1_13 +e1_l1_14 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.4 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/4_1.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.4 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/4_1.4) @@ -0,0 +1,14 @@ +e1_l1_1 +e1_l1_2 +e1_l1_3 +e1_l1_4 +e1_l1_5 +e1_l1_6 +e1_l1_7 +e1_l1_8 +e1_l1_9 +e1_l1_10 +e1_l1_11 +e1_l1_12 +e1_l1_13 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.4.1 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/5_1.4.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.4.1 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/5_1.4.1) @@ -0,0 +1,14 @@ +l1_1 +l1_2 +l1_3 +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +l1_13 +l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.5 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/6_1.5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.5 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/6_1.5) @@ -0,0 +1,28 @@ +s1_l1_1 +s1_l1_1 +s1_l1_2 +s1_l1_2 +s1_l1_3 +s1_l1_3 +s1_l1_4 +s1_l1_4 +s1_l1_5 +s1_l1_5 +s1_l1_6 +s1_l1_6 +s1_l1_7 +s1_l1_7 +s1_l1_8 +s1_l1_8 +s1_l1_9 +s1_l1_9 +s1_l1_10 +s1_l1_10 +s1_l1_11 +s1_l1_11 +s1_l1_12 +s1_l1_12 +s1_l1_13 +s1_l1_13 +s1_l1_14 +s1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.6 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/7_1.6) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.6 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/7_1.6) @@ -0,0 +1,28 @@ +s1_l1_1 +s1_l1_1 +s1_l1_2 +s1_l1_2 +s1_l1_3 +s1_l1_3 +s1_l1_4 +s1_l1_4 +s1_l1_5 +s1_l1_5 +s1_l1_6 +s1_l1_6 +s1_l1_7 +s1_l1_7 +s1_l1_8 +s1_l1_8 +s1_l1_9 +s1_l1_9 +s1_l1_10 +s1_l1_10 +s1_l1_11 +s1_l1_11 +s1_l1_12 +s1_l1_12 +s1_l1_13 +s1_l1_13 +s1_l1_14 +s1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.7 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/8_1.7) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.7 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/8_1.7) @@ -0,0 +1,28 @@ +e1_l1_1 +e1_l1_1 +e1_l1_2 +e1_l1_2 +e1_l1_3 +e1_l1_3 +e1_l1_4 +e1_l1_4 +e1_l1_5 +e1_l1_5 +e1_l1_6 +e1_l1_6 +e1_l1_7 +e1_l1_7 +e1_l1_8 +e1_l1_8 +e1_l1_9 +e1_l1_9 +e1_l1_10 +e1_l1_10 +e1_l1_11 +e1_l1_11 +e1_l1_12 +e1_l1_12 +e1_l1_13 +e1_l1_13 +e1_l1_14 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.8 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/9_1.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.8 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/9_1.8) @@ -0,0 +1,28 @@ +e1_l1_1 +e1_l1_1 +e1_l1_2 +e1_l1_2 +e1_l1_3 +e1_l1_3 +e1_l1_4 +e1_l1_4 +e1_l1_5 +e1_l1_5 +e1_l1_6 +e1_l1_6 +e1_l1_7 +e1_l1_7 +e1_l1_8 +e1_l1_8 +e1_l1_9 +e1_l1_9 +e1_l1_10 +e1_l1_10 +e1_l1_11 +e1_l1_11 +e1_l1_12 +e1_l1_12 +e1_l1_13 +e1_l1_13 +e1_l1_14 +e1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/1.9 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/10_1.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/1.9 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/10_1.9) @@ -0,0 +1,14 @@ +s1_l1_1 +s1_l1_2 +s1_l1_3 +s1_l1_4 +s1_l1_5 +s1_l1_6 +s1_l1_7 +s1_l1_8 +s1_l1_9 +s1_l1_10 +s1_l1_11 +s1_l1_12 +s1_l1_13 +s1_l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.1 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/20_2.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.1 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/20_2.1) @@ -0,0 +1 @@ +l1_4 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.10 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/29_2.10) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.10 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/29_2.10) @@ -0,0 +1 @@ +l1_7 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.11 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/30_2.11) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.11 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/30_2.11) @@ -0,0 +1 @@ +l1_7 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.12 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/31_2.12) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.12 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/31_2.12) @@ -0,0 +1,4 @@ +l1_1 +l1_2 +l1_3 +l1_4 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.13 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/32_2.13) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.13 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/32_2.13) @@ -0,0 +1,23 @@ +l1_1 +l1_2 +l1_3 +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +l1_13 +l1_14 +l2_1 +l2_2 +l2_3 +l2_4 +l2_5 +l2_6 +l2_7 +l2_8 +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.14 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/33_2.14) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.14 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/33_2.14) @@ -0,0 +1,23 @@ +l1_1 +l1_2 +l1_3 +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +l1_13 +l1_14 +l2_1 +l2_2 +l2_3 +l2_4 +l2_5 +l2_6 +l2_7 +l2_8 +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.15 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/34_2.15) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.15 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/34_2.15) @@ -0,0 +1,20 @@ +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +l1_13 +l1_14 +l2_1 +l2_2 +l2_3 +l2_4 +l2_5 +l2_6 +l2_7 +l2_8 +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.16 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/35_2.16) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.16 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/35_2.16) @@ -0,0 +1,17 @@ +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +l1_13 +l1_14 +l2_1 +l2_2 +l2_3 +l2_4 +l2_5 +l2_6 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.17 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/36_2.17) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.17 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/36_2.17) @@ -0,0 +1,17 @@ +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_14 +l2_1 +l2_2 +l2_3 +l2_4 +l2_5 +l2_6 +l2_7 +l2_8 +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.18 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/37_2.18) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.18 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/37_2.18) @@ -0,0 +1,7 @@ +l2_3 +l2_4 +l2_5 +l2_6 +l2_7 +l2_8 +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.19 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/38_2.19) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.19 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/38_2.19) @@ -0,0 +1 @@ +l1_12 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.2 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/21_2.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.2 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/21_2.2) @@ -0,0 +1 @@ +l2_6 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.20 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/39_2.20) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.20 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/39_2.20) @@ -0,0 +1 @@ +l1_7 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.21 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/40_2.21) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.21 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/40_2.21) @@ -0,0 +1,5 @@ +l1_13 +l1_14 +l2_1 +l2_2 +l2_3 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.22 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/41_2.22) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.22 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/41_2.22) @@ -0,0 +1,3 @@ +l1_6 +l1_7 +l1_8 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.3 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/22_2.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.3 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/22_2.3) @@ -0,0 +1 @@ +l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.4 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/23_2.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.4 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/23_2.4) @@ -0,0 +1 @@ +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.5 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/24_2.5) ============================================================================== Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.6 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/25_2.6) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.6 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/25_2.6) @@ -0,0 +1 @@ +l2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.7 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/26_2.7) ============================================================================== Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.8 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/27_2.8) ============================================================================== Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/2.9 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/28_2.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/2.9 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/28_2.9) @@ -0,0 +1 @@ +l1_7 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/3.1 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/40_3.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/3.1 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/40_3.1) @@ -0,0 +1,14 @@ +l1_1 +l1_2 +l1_3 +^l1T4$ +^l1T5$ +^l1T6$ +^l1T7$ +^l1T8$ +^l1T9$ +^l1T10$ +^l1T11$ +^l1T12$ +l1_13 +l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/3.2 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/41_3.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/3.2 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/41_3.2) @@ -0,0 +1,14 @@ +l1_1 +l1_2 +l1_3 +^l1_4 +^l1_5 +^l1_6$ +^l1_7$ +^l1T8$ +^l1_9$ +^l1_10$ +^l1_11 +^l1_12 +l1_13 +l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/3.3 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/42_3.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/3.3 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/42_3.3) @@ -0,0 +1,14 @@ +^l1T1$ +^l1T2$ +^l1T3$ +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +^l1T13$ +^l1T14$ Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/3.4 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/43_3.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/3.4 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/43_3.4) @@ -0,0 +1,14 @@ +^l1_1 +^l1_2 +^l1_3 +l1_4 +l1_5 +l1_6 +l1_7 +l1_8 +l1_9 +l1_10 +l1_11 +l1_12 +^l1_13 +^l1_14 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/4.1 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/44_4.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/4.1 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/44_4.1) @@ -0,0 +1,47 @@ +before_il1_1 +after_ibefore_il1_1 +before_il1_2 +after_ibefore_il1_2 +before_il1_3 +after_ibefore_il1_3 +before_il1_4 +after_ibefore_il1_4 +before_il1_5 +after_ibefore_il1_5 +before_il1_6 +after_ibefore_il1_6 +before_il1_7 +after_ibefore_il1_7 +before_il1_8 +after_ibefore_il1_8 +before_il1_9 +after_ibefore_il1_9 +before_il1_10 +after_ibefore_il1_10 +before_il1_11 +after_ibefore_il1_11 +before_il1_12 +after_ibefore_il1_12 +before_il1_13 +after_ibefore_il1_13 +before_il1_14 +after_ibefore_il1_14 +before_il2_1 +after_ibefore_il2_1 +before_il2_2 +after_ibefore_il2_2 +before_il2_3 +after_ibefore_il2_3 +before_il2_4 +after_ibefore_il2_4 +before_il2_5 +after_ibefore_il2_5 +before_il2_6 +inserted +after_ibefore_il2_6 +before_il2_7 +after_ibefore_il2_7 +before_il2_8 +after_ibefore_il2_8 +before_il2_9 +after_ibefore_il2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/4.2 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/45_4.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/4.2 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/45_4.2) @@ -0,0 +1,54 @@ +before_al1_1 +after_abefore_al1_1 +before_al1_2 +after_abefore_al1_2 +before_al1_3 +after_abefore_al1_3 +before_al1_4 +after_abefore_al1_4 +before_a5-12l1_5 +after_abefore_a5-12l1_5 +appended +before_a5-12l1_6 +after_abefore_a5-12l1_6 +appended +before_a5-12l1_7 +after_abefore_a5-12l1_7 +appended +before_a5-12l1_8 +after_abefore_a5-12l1_8 +appended +before_a5-12l1_9 +after_abefore_a5-12l1_9 +appended +before_a5-12l1_10 +after_abefore_a5-12l1_10 +appended +before_a5-12l1_11 +after_abefore_a5-12l1_11 +appended +before_a5-12l1_12 +after_abefore_a5-12l1_12 +appended +before_al1_13 +after_abefore_al1_13 +before_al1_14 +after_abefore_al1_14 +before_al2_1 +after_abefore_al2_1 +before_al2_2 +after_abefore_al2_2 +before_al2_3 +after_abefore_al2_3 +before_al2_4 +after_abefore_al2_4 +before_al2_5 +after_abefore_al2_5 +before_al2_6 +after_abefore_al2_6 +before_al2_7 +after_abefore_al2_7 +before_al2_8 +after_abefore_al2_8 +before_al2_9 +after_abefore_al2_9 Copied: head/tools/regression/usr.bin/sed/regress.multitest.out/4.3 (from r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/46_4.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/4.3 Sun Sep 20 13:39:44 2009 (r197352, copy of r197349, head/tools/regression/usr.bin/sed/regress.multitest.out/46_4.3) @@ -0,0 +1,56 @@ +^l1_1 +^l1_1$ +appended +^l1_2 +^l1_2$ +appended +^l1_3 +^l1_3$ +appended +^l1_4 +^l1_4$ +appended +^l1_5 +^l1_5$ +appended +^l1_6 +^l1_6$ +appended +^l1_7 +^l1_7$ +appended +^l1_8 +appended +^l1_8 +l1_9$ +^l1_10 +appended +^l1_10 +l1_11$ +^l1_12 +^l1_12$ +appended +^l1_13 +^l1_13$ +appended +^l1_14 +^l1_14$ +appended +^l2_1 +^l2_1$ +^l2_2 +^l2_2$ +^l2_3 +^l2_3$ +^l2_4 +^l2_4$ +^l2_5 +^l2_5$ +^l2_6 +^l2_6$ +^l2_7 +^l2_7$ +^l2_8 +^l2_8$ +^l2_9 +^l2_9$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 13:47:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E22106566B; Sun, 20 Sep 2009 13:47:56 +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 0610C8FC0C; Sun, 20 Sep 2009 13:47:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KDltto058379; Sun, 20 Sep 2009 13:47:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KDltC5058378; Sun, 20 Sep 2009 13:47:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201347.n8KDltC5058378@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 13:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197353 - stable/7/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 13:47:56 -0000 Author: marius Date: Sun Sep 20 13:47:55 2009 New Revision: 197353 URL: http://svn.freebsd.org/changeset/base/197353 Log: Move mergeinfo for r194248 from article.sgml up to its directory. Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 13:49:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 957BA1065670; Sun, 20 Sep 2009 13:49:10 +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 4DE6D8FC1F; Sun, 20 Sep 2009 13:49:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KDnA1l058440; Sun, 20 Sep 2009 13:49:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KDnAVo058437; Sun, 20 Sep 2009 13:49:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201349.n8KDnAVo058437@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 13:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197354 - in stable/6/sys: . conf contrib/pf dev/cxgb sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 13:49:10 -0000 Author: marius Date: Sun Sep 20 13:49:10 2009 New Revision: 197354 URL: http://svn.freebsd.org/changeset/base/197354 Log: MFC: r190112 (partial) - As suggested by OpenSolaris use up-burst-sizes for determining the supported burst sizes. - Add support for 64-bit burst sizes (required for SBus GEM). - Take advantage of KOBJMETHOD_END. - Add missing const. Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/sparc64/sbus/sbus.c stable/6/sys/sparc64/sbus/sbusvar.h Modified: stable/6/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/6/sys/sparc64/sbus/sbus.c Sun Sep 20 13:47:55 2009 (r197353) +++ stable/6/sys/sparc64/sbus/sbus.c Sun Sep 20 13:49:10 2009 (r197354) @@ -212,7 +212,7 @@ static ofw_bus_get_name_t sbus_get_name; static ofw_bus_get_node_t sbus_get_node; static ofw_bus_get_type_t sbus_get_type; -static int sbus_inlist(const char *, const char **); +static int sbus_inlist(const char *, const char *const *); static struct sbus_devinfo * sbus_setup_dinfo(struct sbus_softc *sc, phandle_t node, char *name); static void sbus_destroy_dinfo(struct sbus_devinfo *dinfo); @@ -233,14 +233,14 @@ static device_method_t sbus_methods[] = DEVMETHOD(bus_print_child, sbus_print_child), DEVMETHOD(bus_probe_nomatch, sbus_probe_nomatch), DEVMETHOD(bus_read_ivar, sbus_read_ivar), - DEVMETHOD(bus_setup_intr, sbus_setup_intr), - DEVMETHOD(bus_teardown_intr, sbus_teardown_intr), DEVMETHOD(bus_alloc_resource, sbus_alloc_resource), DEVMETHOD(bus_activate_resource, sbus_activate_resource), DEVMETHOD(bus_deactivate_resource, sbus_deactivate_resource), DEVMETHOD(bus_release_resource, sbus_release_resource), - DEVMETHOD(bus_get_resource_list, sbus_get_resource_list), + DEVMETHOD(bus_setup_intr, sbus_setup_intr), + DEVMETHOD(bus_teardown_intr, sbus_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, sbus_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_compat, sbus_get_compat), @@ -249,7 +249,7 @@ static device_method_t sbus_methods[] = DEVMETHOD(ofw_bus_get_node, sbus_get_node), DEVMETHOD(ofw_bus_get_type, sbus_get_type), - { 0, 0 } + KOBJMETHOD_END }; static driver_t sbus_driver = { @@ -266,14 +266,14 @@ MODULE_VERSION(sbus, 1); #define OFW_SBUS_TYPE "sbus" #define OFW_SBUS_NAME "sbus" -static const char *sbus_order_first[] = { +static const char *const sbus_order_first[] = { "auxio", "dma", NULL }; static int -sbus_inlist(const char *name, const char **list) +sbus_inlist(const char *name, const char *const *list) { int i; @@ -388,11 +388,12 @@ sbus_attach(device_t dev) /* * Get the SBus burst transfer size if burst transfers are supported. - * XXX: is the default correct? */ - if (OF_getprop(node, "burst-sizes", &sc->sc_burst, + if (OF_getprop(node, "up-burst-sizes", &sc->sc_burst, sizeof(sc->sc_burst)) == -1 || sc->sc_burst == 0) - sc->sc_burst = SBUS_BURST_DEF; + sc->sc_burst = + (SBUS_BURST64_DEF << SBUS_BURST64_SHIFT) | SBUS_BURST_DEF; + /* initalise the IOMMU */ @@ -849,8 +850,8 @@ sbus_activate_resource(device_t bus, dev } if (type == SYS_RES_MEMORY) { /* - * Need to memory-map the device space, as some drivers depend - * on the virtual address being set and useable. + * Need to memory-map the device space, as some drivers + * depend on the virtual address being set and usable. */ error = sparc64_bus_mem_map(rman_get_bustag(r), rman_get_bushandle(r), rman_get_size(r), 0, 0, &p); Modified: stable/6/sys/sparc64/sbus/sbusvar.h ============================================================================== --- stable/6/sys/sparc64/sbus/sbusvar.h Sun Sep 20 13:47:55 2009 (r197353) +++ stable/6/sys/sparc64/sbus/sbusvar.h Sun Sep 20 13:49:10 2009 (r197354) @@ -77,7 +77,7 @@ */ #ifndef _SPARC64_SBUS_SBUSVAR_H_ -#define _SPARC64_SBUS_SBUSVAR_H_ +#define _SPARC64_SBUS_SBUSVAR_H_ /* * Macros for probe order @@ -88,18 +88,24 @@ /* * PROM-reported DMA burst sizes for the SBus */ -#define SBUS_BURST_1 0x1 -#define SBUS_BURST_2 0x2 -#define SBUS_BURST_4 0x4 -#define SBUS_BURST_8 0x8 -#define SBUS_BURST_16 0x10 -#define SBUS_BURST_32 0x20 -#define SBUS_BURST_64 0x40 +#define SBUS_BURST_1 (1 << 0) +#define SBUS_BURST_2 (1 << 1) +#define SBUS_BURST_4 (1 << 2) +#define SBUS_BURST_8 (1 << 3) +#define SBUS_BURST_16 (1 << 4) +#define SBUS_BURST_32 (1 << 5) +#define SBUS_BURST_64 (1 << 6) +#define SBUS_BURST_MASK ((1 << SBUS_BURST_SIZE) - 1) +#define SBUS_BURST_SIZE 16 +#define SBUS_BURST64_MASK (SBUS_BURST_MASK << SBUS_BURST64_SHIFT) +#define SBUS_BURST64_SHIFT 16 /* Used if no burst sizes are specified for the bus. */ #define SBUS_BURST_DEF \ (SBUS_BURST_1 | SBUS_BURST_2 | SBUS_BURST_4 | SBUS_BURST_8 | \ - SBUS_BURST_16) + SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64) +#define SBUS_BURST64_DEF \ + (SBUS_BURST_8 | SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64) enum sbus_device_ivars { SBUS_IVAR_BURSTSZ, @@ -111,7 +117,7 @@ enum sbus_device_ivars { /* * Simplified accessors for sbus devices */ -#define SBUS_ACCESSOR(var, ivar, type) \ +#define SBUS_ACCESSOR(var, ivar, type) \ __BUS_ACCESSOR(sbus, var, SBUS, ivar, type) SBUS_ACCESSOR(burstsz, BURSTSZ, int) From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 13:54:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA6C91065672; Sun, 20 Sep 2009 13:54:27 +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 A66BF8FC12; Sun, 20 Sep 2009 13:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KDsROi058586; Sun, 20 Sep 2009 13:54:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KDsRsT058579; Sun, 20 Sep 2009 13:54:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201354.n8KDsRsT058579@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 13:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197355 - in stable/6/sys: . conf contrib/pf dev/cxgb dev/gem modules/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 13:54:27 -0000 Author: marius Date: Sun Sep 20 13:54:27 2009 New Revision: 197355 URL: http://svn.freebsd.org/changeset/base/197355 Log: MFC: r194763, r194886 - Initialize the ifnet structure, especially if_dname, before probing the PHYs as some PHY drivers use it (but probably shouldn't). How gem(4) has worked with brgphy(4) on powerpc without this so far is unclear to me. - Call ether_ifdetach(9) before stopping the controller and the callouts. The consensus is that the latter is now safe to do and should also solve the problem of active BPF listeners clearing promiscuous mode can result in the tick callout being restarted which in turn will trigger a panic once it's actually gone. - Introduce a dying flag which is set during detach and checked in gem_ioctl() in order to prevent active BPF listeners to clear promiscuous mode which may lead to the tick callout being restarted which will trigger a panic once it's actually gone. - In gem_stop() reset rather than just disable the transmitter and receiver in order to ensure we're not unloading DMA maps still in use by the hardware. [1] - The blanking time is specified in PCI clocks so we should use twice the value when operating at 66MHz. - Spell some 2 as ETHER_ALIGN and a 19 as GEM_STATUS_TX_COMPLETION_SHFT to make the actual intentions clear. - As we don't unload the peak attempts counter ignore its overflow interrupts. - Remove a stale setting of a variable to GEM_TD_INTERRUPT_ME which isn't used afterwards. - For optimum performance increment the TX kick register in multiples of 4 if possible as suggested by the documentation. - Partially revert r164931; drivers should only clear the watchdog timer if all outstanding TX descriptors are done. - Fix some debugging strings. - Add a missing BUS_DMASYNC_POSTWRITE in gem_rint(). - As the error paths in the interrupt handler are generally unlikely predict them as false. - Add support for the SBus version of the GEM controller. [2] - Add some lock assertions. - Improve some comments. - Fix some more or less cosmetic issues in the code of the PCI front-end. - Change some softc members to be unsigned where more appropriate and remove unused ones. Obtained from: NetBSD (partially) [2], OpenBSD [1] Added: stable/6/sys/dev/gem/if_gem_sbus.c - copied unchanged from r194763, head/sys/dev/gem/if_gem_sbus.c Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/conf/files stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/gem/if_gem.c stable/6/sys/dev/gem/if_gem_pci.c stable/6/sys/dev/gem/if_gemreg.h stable/6/sys/dev/gem/if_gemvar.h stable/6/sys/modules/gem/Makefile Modified: stable/6/sys/conf/files ============================================================================== --- stable/6/sys/conf/files Sun Sep 20 13:49:10 2009 (r197354) +++ stable/6/sys/conf/files Sun Sep 20 13:54:27 2009 (r197355) @@ -629,6 +629,7 @@ dev/firewire/sbp_targ.c optional sbp_ta dev/fxp/if_fxp.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci +dev/gem/if_gem_sbus.c optional gem sbus dev/harp/if_harp.c optional harp pci dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci @@ -2042,4 +2043,4 @@ xdr/xdr_array.c optional nfslockd xdr/xdr_mbuf.c optional nfslockd xdr/xdr_mem.c optional nfslockd xdr/xdr_reference.c optional nfslockd -xdr/xdr_sizeof.c optional nfslockd \ No newline at end of file +xdr/xdr_sizeof.c optional nfslockd Modified: stable/6/sys/dev/gem/if_gem.c ============================================================================== --- stable/6/sys/dev/gem/if_gem.c Sun Sep 20 13:49:10 2009 (r197354) +++ stable/6/sys/dev/gem/if_gem.c Sun Sep 20 13:54:27 2009 (r197355) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); CTASSERT(powerof2(GEM_NRXDESC) && GEM_NRXDESC >= 32 && GEM_NRXDESC <= 8192); CTASSERT(powerof2(GEM_NTXDESC) && GEM_NTXDESC >= 32 && GEM_NTXDESC <= 8192); -#define TRIES 10000 +#define GEM_TRIES 10000 /* * The hardware supports basic TCP/UDP checksum offloading. However, @@ -120,7 +120,7 @@ static void gem_rint(struct gem_softc *s #ifdef GEM_RINT_TIMEOUT static void gem_rint_timeout(void *arg); #endif -static __inline void gem_rxcksum(struct mbuf *m, uint64_t flags); +static inline void gem_rxcksum(struct mbuf *m, uint64_t flags); static void gem_rxdrain(struct gem_softc *sc); static void gem_setladrf(struct gem_softc *sc); static void gem_start(struct ifnet *ifp); @@ -128,6 +128,7 @@ static void gem_start_locked(struct ifne static void gem_stop(struct ifnet *ifp, int disable); static void gem_tick(void *arg); static void gem_tint(struct gem_softc *sc); +static inline void gem_txkick(struct gem_softc *sc); static int gem_watchdog(struct gem_softc *sc); devclass_t gem_devclass; @@ -152,9 +153,24 @@ gem_attach(struct gem_softc *sc) int error, i; uint32_t v; + if (bootverbose) + device_printf(sc->sc_dev, "flags=0x%x\n", sc->sc_flags); + + /* Set up ifnet structure. */ ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) return (ENOSPC); + sc->sc_csum_features = GEM_CSUM_FEATURES; + ifp->if_softc = sc; + if_initname(ifp, device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = gem_start; + ifp->if_ioctl = gem_ioctl; + ifp->if_init = gem_init; + IFQ_SET_MAXLEN(&ifp->if_snd, GEM_TXQUEUELEN); + ifp->if_snd.ifq_drv_maxlen = GEM_TXQUEUELEN; + IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); #ifdef GEM_RINT_TIMEOUT @@ -162,27 +178,26 @@ gem_attach(struct gem_softc *sc) #endif /* Make sure the chip is stopped. */ - ifp->if_softc = sc; gem_reset(sc); error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->sc_pdmatag); - if (error) + if (error != 0) goto fail_ifnet; error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_rdmatag); - if (error) + if (error != 0) goto fail_ptag; error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * GEM_NTXSEGS, GEM_NTXSEGS, MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_tdmatag); - if (error) + if (error != 0) goto fail_rtag; error = bus_dma_tag_create(sc->sc_pdmatag, PAGE_SIZE, 0, @@ -190,7 +205,7 @@ gem_attach(struct gem_softc *sc) sizeof(struct gem_control_data), 1, sizeof(struct gem_control_data), 0, NULL, NULL, &sc->sc_cdmatag); - if (error) + if (error != 0) goto fail_ttag; /* @@ -200,7 +215,7 @@ gem_attach(struct gem_softc *sc) if ((error = bus_dmamem_alloc(sc->sc_cdmatag, (void **)&sc->sc_control_data, BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &sc->sc_cddmamap))) { + &sc->sc_cddmamap)) != 0) { device_printf(sc->sc_dev, "unable to allocate control data, error = %d\n", error); goto fail_ctag; @@ -339,19 +354,6 @@ gem_attach(struct gem_softc *sc) device_printf(sc->sc_dev, "%ukB RX FIFO, %ukB TX FIFO\n", sc->sc_rxfifosize / 1024, v / 16); - sc->sc_csum_features = GEM_CSUM_FEATURES; - /* Initialize ifnet structure. */ - ifp->if_softc = sc; - if_initname(ifp, device_get_name(sc->sc_dev), - device_get_unit(sc->sc_dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_start = gem_start; - ifp->if_ioctl = gem_ioctl; - ifp->if_init = gem_init; - IFQ_SET_MAXLEN(&ifp->if_snd, GEM_TXQUEUELEN); - ifp->if_snd.ifq_drv_maxlen = GEM_TXQUEUELEN; - IFQ_SET_READY(&ifp->if_snd); - /* Attach the interface. */ ether_ifattach(ifp, sc->sc_enaddr); @@ -402,6 +404,7 @@ gem_detach(struct gem_softc *sc) struct ifnet *ifp = sc->sc_ifp; int i; + ether_ifdetach(ifp); GEM_LOCK(sc); gem_stop(ifp, 1); GEM_UNLOCK(sc); @@ -409,7 +412,6 @@ gem_detach(struct gem_softc *sc) #ifdef GEM_RINT_TIMEOUT callout_drain(&sc->sc_rx_ch); #endif - ether_ifdetach(ifp); if_free(ifp); device_delete_child(sc->sc_dev, sc->sc_miibus); @@ -457,7 +459,7 @@ gem_resume(struct gem_softc *sc) GEM_UNLOCK(sc); } -static __inline void +static inline void gem_rxcksum(struct mbuf *m, uint64_t flags) { struct ether_header *eh; @@ -536,12 +538,11 @@ static void gem_tick(void *arg) { struct gem_softc *sc = arg; - struct ifnet *ifp; + struct ifnet *ifp = sc->sc_ifp; uint32_t v; GEM_LOCK_ASSERT(sc, MA_OWNED); - ifp = sc->sc_ifp; /* * Unload collision and error counters. */ @@ -585,7 +586,7 @@ gem_bitwait(struct gem_softc *sc, u_int int i; uint32_t reg; - for (i = TRIES; i--; DELAY(100)) { + for (i = GEM_TRIES; i--; DELAY(100)) { reg = GEM_BANKN_READ_M(bank, 4, sc, r); if ((reg & clr) == 0 && (reg & set) == set) return (1); @@ -594,8 +595,7 @@ gem_bitwait(struct gem_softc *sc, u_int } static void -gem_reset(sc) - struct gem_softc *sc; +gem_reset(struct gem_softc *sc) { #ifdef GEM_DEBUG @@ -645,9 +645,8 @@ gem_stop(struct ifnet *ifp, int disable) callout_stop(&sc->sc_rx_ch); #endif - /* XXX should we reset these instead? */ - gem_disable_tx(sc); - gem_disable_rx(sc); + gem_reset_tx(sc); + gem_reset_rx(sc); /* * Release any queued transmit buffers. @@ -722,7 +721,7 @@ gem_reset_rxdma(struct gem_softc *sc) if (sc->sc_rxsoft[i].rxs_mbuf != NULL) GEM_UPDATE_RXDESC(sc, i); sc->sc_rxptr = 0; - GEM_CDSYNC(sc, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* NOTE: we use only 32-bit DMA addresses here. */ GEM_BANK1_WRITE_4(sc, GEM_RX_RING_PTR_HI, 0); @@ -733,9 +732,11 @@ gem_reset_rxdma(struct gem_softc *sc) ((ETHER_HDR_LEN + sizeof(struct ip)) << GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | - (2 << GEM_RX_CONFIG_FBOFF_SHFT)); + (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); + /* Adjust for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, - (6 << GEM_RX_BLANKING_TIME_SHIFT) | 6); + ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << + GEM_RX_BLANKING_TIME_SHIFT) | 6); GEM_BANK1_WRITE_4(sc, GEM_RX_PAUSE_THRESH, (3 * sc->sc_rxfifosize / 256) | ((sc->sc_rxfifosize / 256) << 12)); @@ -799,12 +800,13 @@ gem_disable_tx(struct gem_softc *sc) } static int -gem_meminit(sc) - struct gem_softc *sc; +gem_meminit(struct gem_softc *sc) { struct gem_rxsoft *rxs; int error, i; + GEM_LOCK_ASSERT(sc, MA_OWNED); + /* * Initialize the transmit descriptor ring. */ @@ -838,7 +840,8 @@ gem_meminit(sc) GEM_INIT_RXDESC(sc, i); } sc->sc_rxptr = 0; - GEM_CDSYNC(sc, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -939,6 +942,20 @@ gem_init_locked(struct gem_softc *sc) #endif /* step 8. Global Configuration & Interrupt Mask */ + + /* + * Set the internal arbitration to "infinite" bursts of the + * maximum length of 31 * 64 bytes so DMA transfers aren't + * split up in cache line size chunks. This greatly improves + * RX performance. + * Enable silicon bug workarounds for the Apple variants. + */ + GEM_BANK1_WRITE_4(sc, GEM_CONFIG, + GEM_CONFIG_TXDMA_LIMIT | GEM_CONFIG_RXDMA_LIMIT | + ((sc->sc_flags & GEM_PCI) != 0 ? GEM_CONFIG_BURST_INF : + GEM_CONFIG_BURST_64) | (GEM_IS_APPLE(sc) ? + GEM_CONFIG_RONPAULBIT | GEM_CONFIG_BUG2FIX : 0)); + GEM_BANK1_WRITE_4(sc, GEM_INTMASK, ~(GEM_INTR_TX_INTME | GEM_INTR_TX_EMPTY | GEM_INTR_RX_DONE | GEM_INTR_RX_NOBUF | GEM_INTR_RX_TAG_ERR | GEM_INTR_PERR | @@ -950,7 +967,8 @@ gem_init_locked(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_MASK, - GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP); + GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP | + GEM_MAC_TX_PEAK_EXP); #ifdef GEM_DEBUG GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_MASK, ~(GEM_MAC_PAUSED | GEM_MAC_PAUSE | GEM_MAC_RESUME)); @@ -962,7 +980,8 @@ gem_init_locked(struct gem_softc *sc) /* step 9. ETX Configuration: use mostly default values. */ /* Enable DMA. */ - v = gem_ringsize(GEM_NTXDESC /* XXX */); + v = gem_ringsize(GEM_NTXDESC); + /* Set TX FIFO threshold and enable DMA. */ v |= ((sc->sc_variant == GEM_SUN_ERI ? 0x100 : 0x4ff) << 10) & GEM_TX_CONFIG_TXFIFO_TH; GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, v | GEM_TX_CONFIG_TXDMA_EN); @@ -974,14 +993,16 @@ gem_init_locked(struct gem_softc *sc) /* RX TCP/UDP checksum offset */ v |= ((ETHER_HDR_LEN + sizeof(struct ip)) << GEM_RX_CONFIG_CXM_START_SHFT); - - /* Enable DMA. */ + /* Set RX FIFO threshold, set first byte offset and enable DMA. */ GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, v | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | - (2 << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); + (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | + GEM_RX_CONFIG_RXDMA_EN); + /* Adjust for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, - (6 << GEM_RX_BLANKING_TIME_SHIFT) | 6); + ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << + GEM_RX_BLANKING_TIME_SHIFT) | 6); /* * The following value is for an OFF Threshold of about 3/4 full @@ -1003,7 +1024,7 @@ gem_init_locked(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot configure RX MAC\n"); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); - /* step 13. TX_MAC Configuration Register */ + /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); @@ -1124,6 +1145,8 @@ gem_load_txmbuf(struct gem_softc *sc, st uint64_t cflags, flags; int error, nexttx, nsegs, offset, seg; + GEM_LOCK_ASSERT(sc, MA_OWNED); + /* Get a work queue entry. */ if ((txs = STAILQ_FIRST(&sc->sc_txfreeq)) == NULL) { /* Ran out of descriptors. */ @@ -1230,7 +1253,6 @@ gem_load_txmbuf(struct gem_softc *sc, st #endif if (++sc->sc_txwin > GEM_NTXSEGS * 2 / 3) { sc->sc_txwin = 0; - flags |= GEM_TD_INTERRUPT_ME; sc->sc_txdescs[txs->txs_firstdesc].gd_flags |= GEM_DMA_WRITE(sc, GEM_TD_INTERRUPT_ME | GEM_TD_START_OF_PACKET); @@ -1262,6 +1284,8 @@ gem_init_regs(struct gem_softc *sc) { const u_char *laddr = IFP2ENADDR(sc->sc_ifp); + GEM_LOCK_ASSERT(sc, MA_OWNED); + /* These registers are not cleared on reset. */ if ((sc->sc_flags & GEM_INITED) == 0) { /* magic values */ @@ -1269,16 +1293,19 @@ gem_init_regs(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_IPG1, 8); GEM_BANK1_WRITE_4(sc, GEM_MAC_IPG2, 4); + /* min frame length */ GEM_BANK1_WRITE_4(sc, GEM_MAC_MAC_MIN_FRAME, ETHER_MIN_LEN); - /* max frame and max burst size */ + /* max frame length and max burst size */ GEM_BANK1_WRITE_4(sc, GEM_MAC_MAC_MAX_FRAME, (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) | (0x2000 << 16)); + /* more magic values */ GEM_BANK1_WRITE_4(sc, GEM_MAC_PREAMBLE_LEN, 0x7); GEM_BANK1_WRITE_4(sc, GEM_MAC_JAM_SIZE, 0x4); GEM_BANK1_WRITE_4(sc, GEM_MAC_ATTEMPT_LIMIT, 0x10); - /* dunno... */ GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_TYPE, 0x8088); + + /* random number seed */ GEM_BANK1_WRITE_4(sc, GEM_MAC_RANDOM_SEED, ((laddr[5] << 8) | laddr[4]) & 0x3ff); @@ -1296,7 +1323,6 @@ gem_init_regs(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR_FILTER0, 0); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR_FILTER1, 0); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR_FILTER2, 0); - GEM_BANK1_WRITE_4(sc, GEM_MAC_ADR_FLT_MASK1_2, 0); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADR_FLT_MASK0, 0); @@ -1319,18 +1345,6 @@ gem_init_regs(struct gem_softc *sc) /* Set XOFF PAUSE time. */ GEM_BANK1_WRITE_4(sc, GEM_MAC_SEND_PAUSE_CMD, 0x1BF0); - /* - * Set the internal arbitration to "infinite" bursts of the - * maximum length of 31 * 64 bytes so DMA transfers aren't - * split up in cache line size chunks. This greatly improves - * especially RX performance. - * Enable silicon bug workarounds for the Apple variants. - */ - GEM_BANK1_WRITE_4(sc, GEM_CONFIG, - GEM_CONFIG_TXDMA_LIMIT | GEM_CONFIG_RXDMA_LIMIT | - GEM_CONFIG_BURST_INF | (GEM_IS_APPLE(sc) ? - GEM_CONFIG_RONPAULBIT | GEM_CONFIG_BUG2FIX : 0)); - /* Set the station address. */ GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR0, (laddr[4] << 8) | laddr[5]); GEM_BANK1_WRITE_4(sc, GEM_MAC_ADDR1, (laddr[2] << 8) | laddr[3]); @@ -1350,12 +1364,32 @@ gem_start(struct ifnet *ifp) GEM_UNLOCK(sc); } +static inline void +gem_txkick(struct gem_softc *sc) +{ + + /* + * Update the TX kick register. This register has to point to the + * descriptor after the last valid one and for optimum performance + * should be incremented in multiples of 4 (the DMA engine fetches/ + * updates descriptors in batches of 4). + */ +#ifdef GEM_DEBUG + CTR3(KTR_GEM, "%s: %s: kicking TX %d", + device_get_name(sc->sc_dev), __func__, sc->sc_txnext); +#endif + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + GEM_BANK1_WRITE_4(sc, GEM_TX_KICK, sc->sc_txnext); +} + static void gem_start_locked(struct ifnet *ifp) { struct gem_softc *sc = ifp->if_softc; struct mbuf *m; - int ntx; + int kicked, ntx; + + GEM_LOCK_ASSERT(sc, MA_OWNED); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING || (sc->sc_flags & GEM_LINK) == 0) @@ -1367,6 +1401,7 @@ gem_start_locked(struct ifnet *ifp) sc->sc_txnext); #endif ntx = 0; + kicked = 0; for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->sc_txfree > 1;) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) @@ -1378,19 +1413,18 @@ gem_start_locked(struct ifnet *ifp) IFQ_DRV_PREPEND(&ifp->if_snd, m); break; } + if ((sc->sc_txnext % 4) == 0) { + gem_txkick(sc); + kicked = 1; + } else + kicked = 0; ntx++; - /* Kick the transmitter. */ -#ifdef GEM_DEBUG - CTR3(KTR_GEM, "%s: %s: kicking TX %d", - device_get_name(sc->sc_dev), __func__, sc->sc_txnext); -#endif - GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - GEM_BANK1_WRITE_4(sc, GEM_TX_KICK, sc->sc_txnext); - BPF_MTAP(ifp, m); } if (ntx > 0) { + if (kicked == 0) + gem_txkick(sc); #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: packets enqueued, OWN on %d", device_get_name(sc->sc_dev), sc->sc_txnext); @@ -1411,10 +1445,13 @@ gem_tint(struct gem_softc *sc) { struct ifnet *ifp = sc->sc_ifp; struct gem_txsoft *txs; - int txlast, progress; + int progress; + uint32_t txlast; #ifdef GEM_DEBUG int i; + GEM_LOCK_ASSERT(sc, MA_OWNED); + CTR2(KTR_GEM, "%s: %s", device_get_name(sc->sc_dev), __func__); #endif @@ -1425,7 +1462,6 @@ gem_tint(struct gem_softc *sc) progress = 0; GEM_CDSYNC(sc, BUS_DMASYNC_POSTREAD); while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) { - #ifdef GEM_DEBUG if ((ifp->if_flags & IFF_DEBUG) != 0) { printf(" txsoft %p transmit chain:\n", txs); @@ -1506,8 +1542,8 @@ gem_tint(struct gem_softc *sc) * and restart. */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sc->sc_wdog_timer = STAILQ_EMPTY(&sc->sc_txdirtyq) ? 0 : 5; - + if (STAILQ_EMPTY(&sc->sc_txdirtyq)) + sc->sc_wdog_timer = 0; gem_start_locked(ifp); } @@ -1524,6 +1560,7 @@ gem_rint_timeout(void *arg) struct gem_softc *sc = arg; GEM_LOCK_ASSERT(sc, MA_OWNED); + gem_rint(sc); } #endif @@ -1536,6 +1573,8 @@ gem_rint(struct gem_softc *sc) uint64_t rxstat; uint32_t rxcomp; + GEM_LOCK_ASSERT(sc, MA_OWNED); + #ifdef GEM_RINT_TIMEOUT callout_stop(&sc->sc_rx_ch); #endif @@ -1548,12 +1587,11 @@ gem_rint(struct gem_softc *sc) * how long the following loop can execute. */ rxcomp = GEM_BANK1_READ_4(sc, GEM_RX_COMPLETION); - #ifdef GEM_DEBUG - CTR3(KTR_GEM, "%s: sc->rxptr %d, complete %d", + CTR3(KTR_GEM, "%s: sc->sc_rxptr %d, complete %d", __func__, sc->sc_rxptr, rxcomp); #endif - GEM_CDSYNC(sc, BUS_DMASYNC_POSTREAD); + GEM_CDSYNC(sc, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); for (; sc->sc_rxptr != rxcomp;) { m = sc->sc_rxsoft[sc->sc_rxptr].rxs_mbuf; rxstat = GEM_DMA_READ(sc, @@ -1612,9 +1650,9 @@ gem_rint(struct gem_softc *sc) /* * Update the RX kick register. This register has to point * to the descriptor after the last valid one (before the - * current batch) and must be incremented in multiples of - * 4 (because the DMA engine fetches/updates descriptors - * in batches of 4). + * current batch) and for optimum performance should be + * incremented in multiples of 4 (the DMA engine fetches/ + * updates descriptors in batches of 4). */ sc->sc_rxptr = GEM_NEXTRX(sc->sc_rxptr); if ((sc->sc_rxptr % 4) == 0) { @@ -1632,7 +1670,7 @@ gem_rint(struct gem_softc *sc) } ifp->if_ipackets++; - m->m_data += 2; /* We're already off by two */ + m->m_data += ETHER_ALIGN; /* first byte offset */ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = GEM_RD_BUFLEN(rxstat); @@ -1646,7 +1684,7 @@ gem_rint(struct gem_softc *sc) } #ifdef GEM_DEBUG - CTR3(KTR_GEM, "%s: done sc->rxptr %d, complete %d", __func__, + CTR3(KTR_GEM, "%s: done sc->sc_rxptr %d, complete %d", __func__, sc->sc_rxptr, GEM_BANK1_READ_4(sc, GEM_RX_COMPLETION)); #endif } @@ -1659,6 +1697,8 @@ gem_add_rxbuf(struct gem_softc *sc, int bus_dma_segment_t segs[1]; int error, nsegs; + GEM_LOCK_ASSERT(sc, MA_OWNED); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); @@ -1707,7 +1747,15 @@ gem_eint(struct gem_softc *sc, u_int sta return; } - device_printf(sc->sc_dev, "%s: status=%x\n", __func__, status); + device_printf(sc->sc_dev, "%s: status 0x%x", __func__, status); + if ((status & GEM_INTR_BERR) != 0) { + if ((sc->sc_flags & GEM_PCI) != 0) + printf(", PCI bus error 0x%x\n", + GEM_BANK1_READ_4(sc, GEM_PCI_ERROR_STATUS)); + else + printf(", SBus error 0x%x\n", + GEM_BANK1_READ_4(sc, GEM_SBUS_STATUS)); + } } void @@ -1721,8 +1769,8 @@ gem_intr(void *v) #ifdef GEM_DEBUG CTR4(KTR_GEM, "%s: %s: cplt %x, status %x", - device_get_name(sc->sc_dev), __func__, (status >> 19), - (u_int)status); + device_get_name(sc->sc_dev), __func__, + (status >> GEM_STATUS_TX_COMPLETION_SHFT), (u_int)status); /* * PCS interrupts must be cleared, otherwise no traffic is passed! @@ -1752,7 +1800,7 @@ gem_intr(void *v) device_printf(sc->sc_dev, "%s: MIF interrupt\n", __func__); #endif - if ((status & + if (__predict_false(status & (GEM_INTR_RX_TAG_ERR | GEM_INTR_PERR | GEM_INTR_BERR)) != 0) gem_eint(sc, status); @@ -1762,17 +1810,20 @@ gem_intr(void *v) if ((status & (GEM_INTR_TX_EMPTY | GEM_INTR_TX_INTME)) != 0) gem_tint(sc); - if (status & GEM_INTR_TX_MAC) { + if (__predict_false((status & GEM_INTR_TX_MAC) != 0)) { status2 = GEM_BANK1_READ_4(sc, GEM_MAC_TX_STATUS); if ((status2 & - ~(GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP)) != 0) + ~(GEM_MAC_TX_XMIT_DONE | GEM_MAC_TX_DEFER_EXP | + GEM_MAC_TX_PEAK_EXP)) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); if ((status2 & - (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) + (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) { + sc->sc_ifp->if_oerrors++; gem_init_locked(sc); + } } - if (status & GEM_INTR_RX_MAC) { + if (__predict_false((status & GEM_INTR_RX_MAC) != 0)) { status2 = GEM_BANK1_READ_4(sc, GEM_MAC_RX_STATUS); /* * At least with GEM_SUN_GEM and some GEM_SUN_ERI @@ -1993,6 +2044,8 @@ gem_mii_statchg(device_t dev) sc = device_get_softc(dev); + GEM_LOCK_ASSERT(sc, MA_OWNED); + #ifdef GEM_DEBUG if ((sc->sc_ifp->if_flags & IFF_DEBUG) != 0) device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", @@ -2072,7 +2125,7 @@ gem_mii_statchg(device_t dev) if ((GEM_BANK1_READ_4(sc, GEM_MIF_CONFIG) & GEM_MIF_CONFIG_PHY_SEL) != 0) { /* External MII needs echo disable if half duplex. */ - if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & + if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) == 0) v |= GEM_MAC_XIF_ECHO_DISABL; } else Modified: stable/6/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/6/sys/dev/gem/if_gem_pci.c Sun Sep 20 13:49:10 2009 (r197354) +++ stable/6/sys/dev/gem/if_gem_pci.c Sun Sep 20 13:54:27 2009 (r197355) @@ -89,7 +89,7 @@ static device_method_t gem_pci_methods[] DEVMETHOD(miibus_writereg, gem_mii_writereg), DEVMETHOD(miibus_statchg, gem_mii_statchg), - { 0, 0 } + KOBJMETHOD_END }; static driver_t gem_pci_driver = { @@ -106,7 +106,7 @@ static const struct gem_pci_dev { uint32_t gpd_devid; int gpd_variant; const char *gpd_desc; -} gem_pci_devlist[] = { +} const gem_pci_devlist[] = { { 0x1101108e, GEM_SUN_ERI, "Sun ERI 10/100 Ethernet" }, { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet" }, { 0x0021106b, GEM_APPLE_GMAC, "Apple UniNorth GMAC Ethernet" }, @@ -194,13 +194,18 @@ gem_pci_attach(device_t dev) GEM_PCI_BANK2_OFFSET, GEM_PCI_BANK2_SIZE, &sc->sc_bh[GEM_BS_BANK2]); + /* Determine whether we're running at 66MHz. */ + if ((GEM_BANK2_READ_4(sc, GEM_PCI_BIF_CONFIG) & + GEM_PCI_BIF_CNF_M66EN) != 0) + sc->sc_flags |= GEM_PCI66; + #if defined(__powerpc__) || defined(__sparc64__) OF_getetheraddr(dev, sc->sc_enaddr); #else /* * Dig out VPD (vital product data) and read NA (network address). - * The VPD of GEM resides in the PCI Expansion ROM (PCI FCode) and - * can't be accessed via the PCI capability pointer. + * The VPD resides in the PCI Expansion ROM (PCI FCode) and can't + * be accessed via the PCI capability pointer. * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and later) * chapter 2 describes the data structure. */ @@ -219,22 +224,21 @@ gem_pci_attach(device_t dev) #define PCI_VPDRES_BYTE0 0x00 #define PCI_VPDRES_ISLARGE(x) ((x) & 0x80) #define PCI_VPDRES_LARGE_NAME(x) ((x) & 0x7f) -#define PCI_VPDRES_TYPE_VPD 0x10 /* large */ #define PCI_VPDRES_LARGE_LEN_LSB 0x01 #define PCI_VPDRES_LARGE_LEN_MSB 0x02 -#define PCI_VPDRES_LARGE_DATA 0x03 -#define PCI_VPD_SIZE 0x03 +#define PCI_VPDRES_LARGE_SIZE 0x03 +#define PCI_VPDRES_TYPE_VPD 0x10 /* large */ #define PCI_VPD_KEY0 0x00 #define PCI_VPD_KEY1 0x01 #define PCI_VPD_LEN 0x02 -#define PCI_VPD_DATA 0x03 +#define PCI_VPD_SIZE 0x03 #define GEM_ROM_READ_1(sc, offs) \ - GEM_BANK1_READ_1((sc), GEM_PCI_ROM_OFFSET + (offs)) + GEM_BANK1_READ_1((sc), GEM_PCI_ROM_OFFSET + (offs)) #define GEM_ROM_READ_2(sc, offs) \ - GEM_BANK1_READ_2((sc), GEM_PCI_ROM_OFFSET + (offs)) + GEM_BANK1_READ_2((sc), GEM_PCI_ROM_OFFSET + (offs)) #define GEM_ROM_READ_4(sc, offs) \ - GEM_BANK1_READ_4((sc), GEM_PCI_ROM_OFFSET + (offs)) + GEM_BANK1_READ_4((sc), GEM_PCI_ROM_OFFSET + (offs)) /* Read PCI Expansion ROM header. */ if (GEM_ROM_READ_2(sc, PCI_ROMHDR_SIG) != PCI_ROMHDR_SIG_MAGIC || @@ -267,23 +271,23 @@ gem_pci_attach(device_t dev) j + PCI_VPDRES_BYTE0)) == 0 || PCI_VPDRES_LARGE_NAME(GEM_ROM_READ_1(sc, j + PCI_VPDRES_BYTE0)) != PCI_VPDRES_TYPE_VPD || - (GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_LEN_LSB) << 8 | + ((GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_LEN_LSB) << 8) | GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_LEN_MSB)) != PCI_VPD_SIZE + ETHER_ADDR_LEN || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_KEY0) != + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_KEY0) != 0x4e /* N */ || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_KEY1) != + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_KEY1) != 0x41 /* A */ || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_LEN) != + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_LEN) != ETHER_ADDR_LEN || - GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_DATA + PCI_VPD_DATA + + GEM_ROM_READ_1(sc, j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_SIZE + ETHER_ADDR_LEN) != 0x79) { device_printf(dev, "unexpected PCI VPD\n"); goto fail; } bus_space_read_region_1(sc->sc_bt[GEM_BS_BANK1], sc->sc_bh[GEM_BS_BANK1], - GEM_PCI_ROM_OFFSET + j + PCI_VPDRES_LARGE_DATA + PCI_VPD_DATA, + GEM_PCI_ROM_OFFSET + j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_SIZE, sc->sc_enaddr, ETHER_ADDR_LEN); #endif @@ -322,19 +326,15 @@ gem_pci_detach(device_t dev) static int gem_pci_suspend(device_t dev) { - struct gem_softc *sc; - sc = device_get_softc(dev); - gem_suspend(sc); + gem_suspend(device_get_softc(dev)); return (0); } static int gem_pci_resume(device_t dev) { - struct gem_softc *sc; - sc = device_get_softc(dev); - gem_resume(sc); + gem_resume(device_get_softc(dev)); return (0); } Copied: stable/6/sys/dev/gem/if_gem_sbus.c (from r194763, head/sys/dev/gem/if_gem_sbus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/sys/dev/gem/if_gem_sbus.c Sun Sep 20 13:54:27 2009 (r197355, copy of r194763, head/sys/dev/gem/if_gem_sbus.c) @@ -0,0 +1,210 @@ +/*- + * Copyright (C) 2001 Eduardo Horvath. + * Copyright (c) 2007 Marius Strobl + * 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. + * + * from: NetBSD: if_gem_pci.c,v 1.7 2001/10/18 15:09:15 thorpej Exp + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * SBus bindings for Sun GEM Ethernet controllers + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include + +#include +#include + +#include "miibus_if.h" + +static device_probe_t gem_sbus_probe; +static device_attach_t gem_sbus_attach; +static device_detach_t gem_sbus_detach; +static device_suspend_t gem_sbus_suspend; +static device_resume_t gem_sbus_resume; + +static device_method_t gem_sbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gem_sbus_probe), + DEVMETHOD(device_attach, gem_sbus_attach), + DEVMETHOD(device_detach, gem_sbus_detach), + DEVMETHOD(device_suspend, gem_sbus_suspend), + DEVMETHOD(device_resume, gem_sbus_resume), + /* Use the suspend handler here, it is all that is required. */ + DEVMETHOD(device_shutdown, gem_sbus_suspend), + + /* bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* MII interface */ + DEVMETHOD(miibus_readreg, gem_mii_readreg), + DEVMETHOD(miibus_writereg, gem_mii_writereg), + DEVMETHOD(miibus_statchg, gem_mii_statchg), + + KOBJMETHOD_END +}; + +static driver_t gem_sbus_driver = { + "gem", + gem_sbus_methods, + sizeof(struct gem_softc) +}; + +DRIVER_MODULE(gem, sbus, gem_sbus_driver, gem_devclass, 0, 0); +MODULE_DEPEND(gem, sbus, 1, 1, 1); +MODULE_DEPEND(gem, ether, 1, 1, 1); + +static int +gem_sbus_probe(device_t dev) +{ + + if (strcmp(ofw_bus_get_name(dev), "network") == 0 && + ofw_bus_get_compat(dev) != NULL && + strcmp(ofw_bus_get_compat(dev), "SUNW,sbus-gem") == 0) { + device_set_desc(dev, "Sun GEM Gigabit Ethernet"); + return (0); + } + + return (ENXIO); +} + +static struct resource_spec gem_sbus_res_spec[] = { + { SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE }, /* GEM_RES_INTR */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* GEM_RES_BANK1 */ + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* GEM_RES_BANK2 */ + { -1, 0 } +}; + +static int +gem_sbus_attach(device_t dev) +{ + struct gem_softc *sc; + int burst; + uint32_t val; + + sc = device_get_softc(dev); + sc->sc_variant = GEM_SUN_GEM; + sc->sc_dev = dev; + + if (bus_alloc_resources(dev, gem_sbus_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); + return (ENXIO); + } + + GEM_LOCK_INIT(sc, device_get_nameunit(dev)); + + OF_getetheraddr(dev, sc->sc_enaddr); + + burst = sbus_get_burstsz(dev); + val = GEM_SBUS_CFG_PARITY; + if ((burst & SBUS_BURST64_MASK) != 0) { + val |= GEM_SBUS_CFG_64BIT; + burst >>= SBUS_BURST64_SHIFT; + } + if ((burst & SBUS_BURST_64) != 0) + val |= GEM_SBUS_CFG_BURST_64; + else if ((burst & SBUS_BURST_32) != 0) + val |= GEM_SBUS_CFG_BURST_32; + else { + device_printf(dev, "unsupported burst size\n"); + goto fail; + } + /* Reset the SBus interface only. */ + (void)GEM_BANK2_READ_4(sc, GEM_SBUS_BIF_RESET); + DELAY(100); + GEM_BANK2_WRITE_4(sc, GEM_SBUS_CONFIG, val); + + if (gem_attach(sc) != 0) { + device_printf(dev, "could not be attached\n"); + goto fail; + } + + if (bus_setup_intr(dev, sc->sc_res[GEM_RES_INTR], INTR_TYPE_NET | + INTR_MPSAFE, NULL, gem_intr, sc, &sc->sc_ih) != 0) { + device_printf(dev, "failed to set up interrupt\n"); + gem_detach(sc); + goto fail; + } + return (0); + + fail: + GEM_LOCK_DESTROY(sc); + bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); + return (ENXIO); +} + +static int +gem_sbus_detach(device_t dev) +{ + struct gem_softc *sc; + + sc = device_get_softc(dev); + bus_teardown_intr(dev, sc->sc_res[GEM_RES_INTR], sc->sc_ih); + gem_detach(sc); + GEM_LOCK_DESTROY(sc); + bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); + return (0); +} + +static int +gem_sbus_suspend(device_t dev) +{ + + gem_suspend(device_get_softc(dev)); + return (0); +} + +static int +gem_sbus_resume(device_t dev) +{ + + gem_resume(device_get_softc(dev)); + return (0); +} Modified: stable/6/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/6/sys/dev/gem/if_gemreg.h Sun Sep 20 13:49:10 2009 (r197354) +++ stable/6/sys/dev/gem/if_gemreg.h Sun Sep 20 13:54:27 2009 (r197355) @@ -32,7 +32,7 @@ #ifndef _IF_GEMREG_H #define _IF_GEMREG_H *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 14:11:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA86D106566B; Sun, 20 Sep 2009 14:11:33 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8BAD8FC15; Sun, 20 Sep 2009 14:11:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KEBX0k058932; Sun, 20 Sep 2009 14:11:33 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KEBXnn058929; Sun, 20 Sep 2009 14:11:33 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909201411.n8KEBXnn058929@svn.freebsd.org> From: Diomidis Spinellis Date: Sun, 20 Sep 2009 14:11: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: r197356 - in head: tools/regression/usr.bin/sed usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 14:11:33 -0000 Author: dds Date: Sun Sep 20 14:11:33 2009 New Revision: 197356 URL: http://svn.freebsd.org/changeset/base/197356 Log: Allow [ to be used as a delimiter. Pointed by: Marius Strobl Obtained from: Apple Modified: head/tools/regression/usr.bin/sed/multitest.t head/usr.bin/sed/compile.c Modified: head/tools/regression/usr.bin/sed/multitest.t ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 13:54:27 2009 (r197355) +++ head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 14:11:33 2009 (r197356) @@ -432,6 +432,15 @@ u2/g' lines1 # POSIX does not say that this should work, # but it does for GNU, BSD, and SunOS mark '8.17' ; $SED -e 's/[/]/Q/' lines1 + + COMMENT='[ as an s delimiter and its escapes' + mark '8.18' ; $SED -e 's[_[X[' lines1 + # This is a matter of interpretation + # POSIX 1003.1, 2004 says "Within the BRE and the replacement, + # the BRE delimiter itself can be used as a *literal* character + # if it is preceded by a backslash + mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X[' + mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[[' } test_error() Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Sun Sep 20 13:54:27 2009 (r197355) +++ head/usr.bin/sed/compile.c Sun Sep 20 14:11:33 2009 (r197356) @@ -387,7 +387,7 @@ compile_delimited(char *p, char *d) errx(1, "%lu: %s: newline can not be used as a string delimiter", linenum, fname); while (*p) { - if (*p == '[') { + if (*p == '[' && *p != c) { if ((d = compile_ccl(&p, d)) == NULL) errx(1, "%lu: %s: unbalanced brackets ([])", linenum, fname); continue; From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 14:20:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35464106566C; Sun, 20 Sep 2009 14:20:01 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23A5D8FC3A; Sun, 20 Sep 2009 14:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KEK14g059102; Sun, 20 Sep 2009 14:20:01 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KEK18r059100; Sun, 20 Sep 2009 14:20:01 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909201420.n8KEK18r059100@svn.freebsd.org> From: Diomidis Spinellis Date: Sun, 20 Sep 2009 14:20: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: r197357 - head/tools/regression/usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 14:20:01 -0000 Author: dds Date: Sun Sep 20 14:20:00 2009 New Revision: 197357 URL: http://svn.freebsd.org/changeset/base/197357 Log: Describe how other systems treat this case. Modified: head/tools/regression/usr.bin/sed/multitest.t Modified: head/tools/regression/usr.bin/sed/multitest.t ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 14:11:33 2009 (r197356) +++ head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 14:20:00 2009 (r197357) @@ -438,7 +438,11 @@ u2/g' lines1 # This is a matter of interpretation # POSIX 1003.1, 2004 says "Within the BRE and the replacement, # the BRE delimiter itself can be used as a *literal* character - # if it is preceded by a backslash + # if it is preceded by a backslash" + # SunOS 5.1 /usr/bin/sed and Mac OS X follow the literal POSIX + # interpretation. + # GNU sed version 4.1.5 treats \[ as the beginning of a character + # set specification (both with --posix and without). mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X[' mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[[' } From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 14:26:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 128001065670; Sun, 20 Sep 2009 14:26:18 +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 DB4298FC16; Sun, 20 Sep 2009 14:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KEQHAl059280; Sun, 20 Sep 2009 14:26:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KEQHUC059278; Sun, 20 Sep 2009 14:26:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201426.n8KEQHUC059278@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 14:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197358 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 14:26:18 -0000 Author: marius Date: Sun Sep 20 14:26:17 2009 New Revision: 197358 URL: http://svn.freebsd.org/changeset/base/197358 Log: MFC: r194764 - Update regarding the support for SBus GEM added in r194763 (MFC'ed in r197349). - Improve the description a bit and add a reference to vlan(4). Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/gem.4 Modified: stable/7/share/man/man4/gem.4 ============================================================================== --- stable/7/share/man/man4/gem.4 Sun Sep 20 14:20:00 2009 (r197357) +++ stable/7/share/man/man4/gem.4 Sun Sep 20 14:26:17 2009 (r197358) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2009 +.Dd June 14, 2009 .Dt GEM 4 .Os .Sh NAME @@ -57,9 +57,16 @@ if_gem_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the GMac Ethernet hardware found mostly in +driver provides support for the GMAC Ethernet hardware found mostly in the last Apple PowerBooks G3s and most G4-based Apple hardware, as -well as many Sun UltraSPARCs. +well as Sun UltraSPARC machines. +.Pp +All controllers supported by the +.Nm +driver have TCP checksum offload capability for both receive and transmit, +support for the reception and transmission of extended frames for +.Xr vlan 4 +and a 512-bit multicast hash filter. .Sh HARDWARE .Pp Chips supported by the @@ -84,6 +91,9 @@ driver at this time: .It Sun Gigabit Ethernet PCI 2.0/3.0 (GBE/P) (part no.\& 501-4373) +.It +Sun Gigabit Ethernet SBus 2.0/3.0 (GBE/S) +(part no.\& 501-4375) .El .Sh NOTES On sparc64 the @@ -108,15 +118,11 @@ the system's default MAC address. Supported interfaces having their own MAC address include the on-board Sun ERI 10/100 Mbps on boards equipped with more than one Ethernet interface and the Sun Gigabit Ethernet 2.0/3.0 GBE add-on cards. -.Sh CAVEATS -Currently the -.Nm -driver fails to attach to Sun Gigabit Ethernet SBus 2.0/3.0 (GBE/S) cards, -as no SBus front-end has been written so far. .Sh SEE ALSO .Xr altq 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr vlan 4 , .Xr eeprom 8 , .Xr ifconfig 8 .Sh HISTORY @@ -132,9 +138,19 @@ version to include it was .An -nosplit The .Nm -driver was written by +driver was written for +.Nx +by .An Eduardo Horvath .Aq eeh@NetBSD.org . +It was ported to +.Fx +by +.An Thomas Moestl +.Aq tmm@FreeBSD.org +and later on improved by +.An Marius Strobl +.Aq marus@FreeBSD.org . The man page was written by .An Thomas Klausner .Aq wiz@NetBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 14:26:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279AE10656A4; Sun, 20 Sep 2009 14:26:27 +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 7F1FA8FC08; Sun, 20 Sep 2009 14:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KEQQtK059319; Sun, 20 Sep 2009 14:26:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KEQQNm059317; Sun, 20 Sep 2009 14:26:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201426.n8KEQQNm059317@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 14:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197359 - stable/6/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 14:26:27 -0000 Author: marius Date: Sun Sep 20 14:26:26 2009 New Revision: 197359 URL: http://svn.freebsd.org/changeset/base/197359 Log: MFC: r194764 - Update regarding the support for SBus GEM added in r194763 (MFC'ed in r197355). - Improve the description a bit and add a reference to vlan(4). Modified: stable/6/share/man/man4/ (props changed) stable/6/share/man/man4/gem.4 Modified: stable/6/share/man/man4/gem.4 ============================================================================== --- stable/6/share/man/man4/gem.4 Sun Sep 20 14:26:17 2009 (r197358) +++ stable/6/share/man/man4/gem.4 Sun Sep 20 14:26:26 2009 (r197359) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2009 +.Dd June 14, 2009 .Dt GEM 4 .Os .Sh NAME @@ -57,9 +57,16 @@ if_gem_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the GMac Ethernet hardware found mostly in +driver provides support for the GMAC Ethernet hardware found mostly in the last Apple PowerBooks G3s and most G4-based Apple hardware, as -well as many Sun UltraSPARCs. +well as Sun UltraSPARC machines. +.Pp +All controllers supported by the +.Nm +driver have TCP checksum offload capability for both receive and transmit, +support for the reception and transmission of extended frames for +.Xr vlan 4 +and a 512-bit multicast hash filter. .Sh HARDWARE .Pp Chips supported by the @@ -84,6 +91,9 @@ driver at this time: .It Sun Gigabit Ethernet PCI 2.0/3.0 (GBE/P) (part no.\& 501-4373) +.It +Sun Gigabit Ethernet SBus 2.0/3.0 (GBE/S) +(part no.\& 501-4375) .El .Sh NOTES On sparc64 the @@ -108,15 +118,11 @@ the system's default MAC address. Supported interfaces having their own MAC address include the on-board Sun ERI 10/100 Mbps on boards equipped with more than one Ethernet interface and the Sun Gigabit Ethernet 2.0/3.0 GBE add-on cards. -.Sh CAVEATS -Currently the -.Nm -driver fails to attach to Sun Gigabit Ethernet SBus 2.0/3.0 (GBE/S) cards, -as no SBus front-end has been written so far. .Sh SEE ALSO .Xr altq 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr vlan 4 , .Xr eeprom 8 , .Xr ifconfig 8 .Sh HISTORY @@ -132,9 +138,19 @@ version to include it was .An -nosplit The .Nm -driver was written by +driver was written for +.Nx +by .An Eduardo Horvath .Aq eeh@NetBSD.org . +It was ported to +.Fx +by +.An Thomas Moestl +.Aq tmm@FreeBSD.org +and later on improved by +.An Marius Strobl +.Aq marus@FreeBSD.org . The man page was written by .An Thomas Klausner .Aq wiz@NetBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 15:04:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDDDA106568F; Sun, 20 Sep 2009 15:04:50 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC14B8FC13; Sun, 20 Sep 2009 15:04:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KF4oHq060141; Sun, 20 Sep 2009 15:04:50 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KF4ouQ060137; Sun, 20 Sep 2009 15:04:50 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909201504.n8KF4ouQ060137@svn.freebsd.org> From: Diomidis Spinellis Date: Sun, 20 Sep 2009 15:04: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: r197360 - head/tools/regression/usr.bin/sed/regress.multitest.out X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 15:04:51 -0000 Author: dds Date: Sun Sep 20 15:04:50 2009 New Revision: 197360 URL: http://svn.freebsd.org/changeset/base/197360 Log: Add correct test results. Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.18 (contents, props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.19 (contents, props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.20 (contents, props changed) Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.18 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.18 Sun Sep 20 15:04:50 2009 (r197360) @@ -0,0 +1,14 @@ +l1X1 +l1X2 +l1X3 +l1X4 +l1X5 +l1X6 +l1X7 +l1X8 +l1X9 +l1X10 +l1X11 +l1X12 +l1X13 +l1X14 Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.19 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.19 Sun Sep 20 15:04:50 2009 (r197360) @@ -0,0 +1,14 @@ +X_1 +X_2 +X_3 +X_4 +X_5 +X_6 +X_7 +X_8 +X_9 +X_10 +X_11 +X_12 +X_13 +X_14 Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.20 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.20 Sun Sep 20 15:04:50 2009 (r197360) @@ -0,0 +1,14 @@ +X[_1 +X[_2 +X[_3 +X[_4 +X[_5 +X[_6 +X[_7 +X[_8 +X[_9 +X[_10 +X[_11 +X[_12 +X[_13 +X[_14 From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 15:17:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3CE1065672; Sun, 20 Sep 2009 15:17:41 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 496C48FC17; Sun, 20 Sep 2009 15:17:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KFHfnW060403; Sun, 20 Sep 2009 15:17:41 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KFHfbN060399; Sun, 20 Sep 2009 15:17:41 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909201517.n8KFHfbN060399@svn.freebsd.org> From: Diomidis Spinellis Date: Sun, 20 Sep 2009 15:17: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: r197361 - in head: tools/regression/usr.bin/sed tools/regression/usr.bin/sed/regress.multitest.out usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 15:17:41 -0000 Author: dds Date: Sun Sep 20 15:17:40 2009 New Revision: 197361 URL: http://svn.freebsd.org/changeset/base/197361 Log: Follow POSIX (IEEE Std 1003.1, 2004 Edition) in the implementation of the y (translate) command. "If a backslash character is immediately followed by a backslash character in string1 or string2, the two backslash characters shall be counted as a single literal backslash character" Pointed by: Marius Strobl Obtained from: Mac OS X Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.21 (contents, props changed) Modified: head/tools/regression/usr.bin/sed/multitest.t head/usr.bin/sed/compile.c Modified: head/tools/regression/usr.bin/sed/multitest.t ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 15:04:50 2009 (r197360) +++ head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 15:17:40 2009 (r197361) @@ -445,6 +445,10 @@ u2/g' lines1 # set specification (both with --posix and without). mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X[' mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[[' + COMMENT='\ in y command' + mark '8.21' + echo 'a\b(c' | + $SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' } test_error() Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.21 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.21 Sun Sep 20 15:17:40 2009 (r197361) @@ -0,0 +1 @@ +a-b-c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Sun Sep 20 15:04:50 2009 (r197360) +++ head/usr.bin/sed/compile.c Sun Sep 20 15:17:40 2009 (r197361) @@ -66,7 +66,7 @@ static struct labhash { static char *compile_addr(char *, struct s_addr *); static char *compile_ccl(char **, char *); -static char *compile_delimited(char *, char *); +static char *compile_delimited(char *, char *, int); static char *compile_flags(char *, struct s_subst *); static regex_t *compile_re(char *, int); static char *compile_subst(char *, struct s_subst *); @@ -320,7 +320,7 @@ nonsel: /* Now parse the command */ linenum, fname); if ((cmd->u.s = calloc(1, sizeof(struct s_subst))) == NULL) err(1, "malloc"); - p = compile_delimited(p, re); + p = compile_delimited(p, re, 0); if (p == NULL) errx(1, "%lu: %s: unterminated substitute pattern", linenum, fname); @@ -373,7 +373,7 @@ nonsel: /* Now parse the command */ * with the processed string. */ static char * -compile_delimited(char *p, char *d) +compile_delimited(char *p, char *d, int is_tr) { char c; @@ -399,9 +399,12 @@ compile_delimited(char *p, char *d) *d++ = '\n'; p += 2; continue; - } else if (*p == '\\' && p[1] == '\\') - *d++ = *p++; - else if (*p == c) { + } else if (*p == '\\' && p[1] == '\\') { + if (is_tr) + p++; + else + *d++ = *p++; + } else if (*p == c) { *d = '\0'; return (p + 1); } @@ -654,11 +657,11 @@ compile_tr(char *p, struct s_tr **py) errx(1, "%lu: %s: transform pattern can not be delimited by newline or backslash", linenum, fname); - p = compile_delimited(p, old); + p = compile_delimited(p, old, 1); if (p == NULL) errx(1, "%lu: %s: unterminated transform source string", linenum, fname); - p = compile_delimited(p - 1, new); + p = compile_delimited(p - 1, new, 1); if (p == NULL) errx(1, "%lu: %s: unterminated transform target string", linenum, fname); @@ -781,7 +784,7 @@ compile_addr(char *p, struct s_addr *a) ++p; /* FALLTHROUGH */ case '/': /* Context address */ - p = compile_delimited(p, re); + p = compile_delimited(p, re, 0); if (p == NULL) errx(1, "%lu: %s: unterminated regular expression", linenum, fname); /* Check for case insensitive regexp flag */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 15:45:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 269F9106566C; Sun, 20 Sep 2009 15:45:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id EC16C8FC0A; Sun, 20 Sep 2009 15:45:56 +0000 (UTC) Received: from Macintosh-4.local (no-reverse.redstone-isp.net [212.44.18.222] (may be forged)) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n8KFjn37048619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Sep 2009 08:45:53 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4AB64E2C.4080800@freebsd.org> Date: Sun, 20 Sep 2009 16:45:48 +0100 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Konstantin Belousov References: <200909201240.n8KCeubH056620@svn.freebsd.org> In-Reply-To: <200909201240.n8KCeubH056620@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197348 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 15:45:57 -0000 Konstantin Belousov wrote: > Author: kib > Date: Sun Sep 20 12:40:56 2009 > New Revision: 197348 > URL: http://svn.freebsd.org/changeset/base/197348 > > Log: > Old (a.out) rtld attempts to mmap zero-length region, e.g. when bss > of the linked object is zero-length. More old code assumes that mmap > of zero length returns success. > > For a.out and pre-8 ELF binaries, allow the mmap of zero length. > > Reported by: tegge > Reviewed by: tegge, alc, jhb > MFC after: 3 days > > Modified: > head/sys/vm/vm_mmap.c > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Sun Sep 20 12:24:55 2009 (r197347) > +++ head/sys/vm/vm_mmap.c Sun Sep 20 12:40:56 2009 (r197348) > @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -229,7 +230,8 @@ mmap(td, uap) > > fp = NULL; > /* make sure mapping fits into numeric range etc */ > - if (uap->len == 0 || > + if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && > + curproc->p_osrel >= 800104) || > ((flags & MAP_ANON) && uap->fd != -1)) > return (EINVAL); > > > This hack needs a comment. Sam From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 15:47:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F587106566C; Sun, 20 Sep 2009 15:47:32 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3738B8FC0A; Sun, 20 Sep 2009 15:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KFlW2b060958; Sun, 20 Sep 2009 15:47:32 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KFlW8W060953; Sun, 20 Sep 2009 15:47:32 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909201547.n8KFlW8W060953@svn.freebsd.org> From: Diomidis Spinellis Date: Sun, 20 Sep 2009 15:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197362 - in head: tools/regression/usr.bin/sed tools/regression/usr.bin/sed/regress.multitest.out usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 15:47:33 -0000 Author: dds Date: Sun Sep 20 15:47:31 2009 New Revision: 197362 URL: http://svn.freebsd.org/changeset/base/197362 Log: IEEE Std 1003.1, 2004 Edition states: "The escape sequence '\n' shall match a embedded in the pattern space." It is unclear whether this also applies to a \n embedded in a character class. Disable the existing handling of \n in a character class following Mac OS X, GNU sed version 4.1.5 with --posix, and SunOS 5.10 /usr/bin/sed. Pointed by: Marius Strobl Obtained from: Mac OS X Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.22 (contents, props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.23 (contents, props changed) Modified: head/tools/regression/usr.bin/sed/multitest.t head/usr.bin/sed/compile.c Modified: head/tools/regression/usr.bin/sed/multitest.t ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 15:17:40 2009 (r197361) +++ head/tools/regression/usr.bin/sed/multitest.t Sun Sep 20 15:47:31 2009 (r197362) @@ -449,6 +449,9 @@ u2/g' lines1 mark '8.21' echo 'a\b(c' | $SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' + COMMENT='\n in a character class and a BRE' + mark '8.22' ; (echo 1; echo 2) | $SED -n '1{;N;s/[\n]/X/;p;}' + mark '8.23' ; (echo 1; echo 2) | $SED -n '1{;N;s/\n/X/;p;}' } test_error() Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.22 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.22 Sun Sep 20 15:47:31 2009 (r197362) @@ -0,0 +1,2 @@ +1 +2 Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.23 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.23 Sun Sep 20 15:47:31 2009 (r197362) @@ -0,0 +1 @@ +1X2 Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Sun Sep 20 15:17:40 2009 (r197361) +++ head/usr.bin/sed/compile.c Sun Sep 20 15:47:31 2009 (r197362) @@ -432,8 +432,7 @@ compile_ccl(char **sp, char *t) for (c = *s; (*t = *s) != ']' || c != d; s++, t++) if ((c = *s) == '\0') return NULL; - } else if (*s == '\\' && s[1] == 'n') - *t = '\n', s++; + } return (*s == ']') ? *sp = ++s, ++t : NULL; } From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 16:47:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345291065670; Sun, 20 Sep 2009 16:47:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 236178FC20; Sun, 20 Sep 2009 16:47:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KGlu8F062362; Sun, 20 Sep 2009 16:47:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KGluO0062360; Sun, 20 Sep 2009 16:47:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200909201647.n8KGluO0062360@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Sep 2009 16:47: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: r197363 - head/usr.bin/find X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 16:47:57 -0000 Author: jilles Date: Sun Sep 20 16:47:56 2009 New Revision: 197363 URL: http://svn.freebsd.org/changeset/base/197363 Log: Update find(1) man page for -L/-delete interaction. It is a bit unfortunate that the example to delete broken symlinks now uses rm(1), but allowing this with -delete would require fixing fts(3) to not imply FTS_NOCHDIR if FTS_LOGICAL is given (or hacks in the -delete option). PR: bin/90687 MFC after: 2 weeks Modified: head/usr.bin/find/find.1 Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Sun Sep 20 15:47:31 2009 (r197362) +++ head/usr.bin/find/find.1 Sun Sep 20 16:47:56 2009 (r197363) @@ -312,6 +312,7 @@ character in its pathname relative to .Dq Pa \&. for security reasons. Depth-first traversal processing is implied by this option. +Following symlinks is incompatible with this option. .It Ic -depth Always true; same as the @@ -920,7 +921,7 @@ recent than the current time minus one m Use the .Xr echo 1 command to print out a list of all the files. -.It Li "find -L /usr/ports/packages -type l -delete" +.It Li "find -L /usr/ports/packages -type l -exec rm -- {} +" Delete all broken symbolic links in .Pa /usr/ports/packages . .It Li "find /usr/src -name CVS -prune -o -depth +6 -print" From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 17:22:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5554C1065672; Sun, 20 Sep 2009 17:22:20 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44E148FC12; Sun, 20 Sep 2009 17:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KHMJWk063166; Sun, 20 Sep 2009 17:22:19 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KHMJ3S063164; Sun, 20 Sep 2009 17:22:19 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909201722.n8KHMJ3S063164@svn.freebsd.org> From: Qing Li Date: Sun, 20 Sep 2009 17:22: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: r197364 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 17:22:20 -0000 Author: qingli Date: Sun Sep 20 17:22:19 2009 New Revision: 197364 URL: http://svn.freebsd.org/changeset/base/197364 Log: A wrong variable is used when setting up the interface address route, which broke source address selection in some code paths. Submitted by: noted by bz Reviewed by: hrs MFC after: immediately Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Sep 20 16:47:56 2009 (r197363) +++ head/sys/net/if.c Sun Sep 20 17:22:19 2009 (r197364) @@ -1432,9 +1432,9 @@ ifa_add_loopback_route(struct ifaddr *if if (error == 0 && rt != NULL) { RT_LOCK(rt); ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; + ifa->ifa_ifp->if_type; ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - rt->rt_ifp->if_index; + ifa->ifa_ifp->if_index; RT_REMREF(rt); RT_UNLOCK(rt); } else if (error != 0) From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 17:46:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17018106566B; Sun, 20 Sep 2009 17:46:57 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04BE38FC26; Sun, 20 Sep 2009 17:46:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KHkuqR063700; Sun, 20 Sep 2009 17:46:56 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KHkuJM063698; Sun, 20 Sep 2009 17:46:56 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909201746.n8KHkuJM063698@svn.freebsd.org> From: Qing Li Date: Sun, 20 Sep 2009 17:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197365 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 17:46:57 -0000 Author: qingli Date: Sun Sep 20 17:46:56 2009 New Revision: 197365 URL: http://svn.freebsd.org/changeset/base/197365 Log: MFC r197364 A wrong variable is used when setting up the interface address route, which broke source address selection in some code paths. Submitted by: noted by bz Reviewed by: hrs Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/if.c Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Sun Sep 20 17:22:19 2009 (r197364) +++ stable/8/sys/net/if.c Sun Sep 20 17:46:56 2009 (r197365) @@ -1432,9 +1432,9 @@ ifa_add_loopback_route(struct ifaddr *if if (error == 0 && rt != NULL) { RT_LOCK(rt); ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; + ifa->ifa_ifp->if_type; ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - rt->rt_ifp->if_index; + ifa->ifa_ifp->if_index; RT_REMREF(rt); RT_UNLOCK(rt); } else if (error != 0) From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 18:53:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43096106566B; Sun, 20 Sep 2009 18:53:41 +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 308178FC0C; Sun, 20 Sep 2009 18:53:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KIrejW064999; Sun, 20 Sep 2009 18:53:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KIreu6064995; Sun, 20 Sep 2009 18:53:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201853.n8KIreu6064995@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 18:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197366 - in stable/7/sys: . contrib/pf sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 18:53:41 -0000 Author: marius Date: Sun Sep 20 18:53:40 2009 New Revision: 197366 URL: http://svn.freebsd.org/changeset/base/197366 Log: MFC: r195149 (partial) - Work around the broken loader behavior of not demapping no longer used kernel TLB slots when unloading the kernel or modules, which results in havoc when loading a kernel and modules which take up less TLB slots afterwards as the unused but locked ones aren't accounted for in virtual_avail. Eventually this should be fixed in the loader which isn't straight forward though and the kernel should be robust against this anyway. [1] - Remove the no longer used global msgbuf_phys. - Remove the redundant ekva parameter of pmap_bootstrap_alloc(). - Correct some outdated function names in ktr(9) invocations. Requested by: jhb [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/sparc64/include/pmap.h stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/pmap.c Modified: stable/7/sys/sparc64/include/pmap.h ============================================================================== --- stable/7/sys/sparc64/include/pmap.h Sun Sep 20 17:46:56 2009 (r197365) +++ stable/7/sys/sparc64/include/pmap.h Sun Sep 20 18:53:40 2009 (r197366) @@ -80,7 +80,7 @@ struct pmap { #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_set_memattr(m, ma) (void)0 -void pmap_bootstrap(vm_offset_t ekva); +void pmap_bootstrap(void); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kenter(vm_offset_t va, vm_page_t m); void pmap_kremove(vm_offset_t); @@ -106,8 +106,6 @@ extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; -extern vm_paddr_t msgbuf_phys; - #ifdef PMAP_STATS SYSCTL_DECL(_debug_pmap_stats); Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Sun Sep 20 17:46:56 2009 (r197365) +++ stable/7/sys/sparc64/sparc64/machdep.c Sun Sep 20 18:53:40 2009 (r197366) @@ -242,6 +242,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l char *env; struct pcpu *pc; vm_offset_t end; + vm_offset_t va; caddr_t kmdp; phandle_t child; phandle_t root; @@ -360,19 +361,28 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Panic if there is no metadata. Most likely the kernel was booted * directly, instead of through loader(8). */ - if (mdp == NULL || kmdp == NULL) { - printf("sparc64_init: no loader metadata.\n" + if (mdp == NULL || kmdp == NULL || end == 0 || + kernel_tlb_slots == 0 || kernel_tlbs == NULL) { + printf("sparc64_init: missing loader metadata.\n" "This probably means you are not using loader(8).\n"); panic("sparc64_init"); } /* - * Sanity check the kernel end, which is important. - */ - if (end == 0) { - printf("sparc64_init: warning, kernel end not specified.\n" - "Attempting to continue anyway.\n"); - end = (vm_offset_t)_end; + * Work around the broken loader behavior of not demapping no + * longer used kernel TLB slots when unloading the kernel or + * modules. + */ + for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; + va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { + printf("demapping unused kernel TLB slot (va %#lx - %#lx)\n", + va, va + PAGE_SIZE_4M - 1); + stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, + ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, + ASI_IMMU_DEMAP, 0); + flush(KERNBASE); + kernel_tlb_slots--; } /* @@ -421,7 +431,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Initialize virtual memory and calculate physmem. */ - pmap_bootstrap(end); + pmap_bootstrap(); /* * Initialize tunables. Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Sun Sep 20 17:46:56 2009 (r197365) +++ stable/7/sys/sparc64/sparc64/pmap.c Sun Sep 20 18:53:40 2009 (r197366) @@ -119,10 +119,9 @@ __FBSDID("$FreeBSD$"); extern struct mtx sched_lock; /* - * Virtual and physical address of message buffer + * Virtual address of message buffer */ struct msgbuf *msgbufp; -vm_paddr_t msgbuf_phys; /* * Map of physical memory reagions @@ -277,7 +276,7 @@ om_cmp(const void *a, const void *b) * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(vm_offset_t ekva) +pmap_bootstrap(void) { struct pmap *pm; struct tte *tp; @@ -365,8 +364,8 @@ pmap_bootstrap(vm_offset_t ekva) /* * Allocate and map the message buffer. */ - msgbuf_phys = pmap_bootstrap_alloc(MSGBUF_SIZE); - msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(msgbuf_phys); + pa = pmap_bootstrap_alloc(MSGBUF_SIZE); + msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa); /* * Patch the virtual address and the tsb mask into the trap table. @@ -415,10 +414,11 @@ pmap_bootstrap(vm_offset_t ekva) } /* - * Set the start and end of KVA. The kernel is loaded at the first - * available 4MB super page, so round up to the end of the page. + * Set the start and end of KVA. The kernel is loaded starting + * at the first available 4MB super page, so we advance to the + * end of the last one used for it. */ - virtual_avail = roundup2(ekva, PAGE_SIZE_4M); + virtual_avail = KERNBASE + kernel_tlb_slots * PAGE_SIZE_4M; virtual_end = vm_max_kernel_address; kernel_vm_end = vm_max_kernel_address; @@ -438,8 +438,7 @@ pmap_bootstrap(vm_offset_t ekva) * coloured properly, since we're allocating from phys_avail so the * memory won't have an associated vm_page_t. */ - pa = pmap_bootstrap_alloc(roundup(KSTACK_PAGES, DCACHE_COLORS) * - PAGE_SIZE); + pa = pmap_bootstrap_alloc(KSTACK_PAGES * PAGE_SIZE); kstack0_phys = pa; virtual_avail += roundup(KSTACK_GUARD_PAGES, DCACHE_COLORS) * PAGE_SIZE; @@ -582,7 +581,7 @@ pmap_bootstrap_alloc(vm_size_t size) vm_paddr_t pa; int i; - size = round_page(size); + size = roundup(size, PAGE_SIZE * DCACHE_COLORS); for (i = 0; phys_avail[i + 1] != 0; i += 2) { if (phys_avail[i + 1] - phys_avail[i] < size) continue; @@ -942,7 +941,7 @@ pmap_kremove_flags(vm_offset_t va) struct tte *tp; tp = tsb_kvtotte(va); - CTR3(KTR_PMAP, "pmap_kremove: va=%#lx tp=%p data=%#lx", va, tp, + CTR3(KTR_PMAP, "pmap_kremove_flags: va=%#lx tp=%p data=%#lx", va, tp, tp->tte_data); TTE_ZERO(tp); } @@ -1345,7 +1344,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t } CTR6(KTR_PMAP, - "pmap_enter: ctx=%p m=%p va=%#lx pa=%#lx prot=%#x wired=%d", + "pmap_enter_locked: ctx=%p m=%p va=%#lx pa=%#lx prot=%#x wired=%d", pm->pm_context[curcpu], m, va, pa, prot, wired); /* @@ -1353,7 +1352,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t * changed, must be protection or wiring change. */ if ((tp = tsb_tte_lookup(pm, va)) != NULL && TTE_GET_PA(tp) == pa) { - CTR0(KTR_PMAP, "pmap_enter: update"); + CTR0(KTR_PMAP, "pmap_enter_locked: update"); PMAP_STATS_INC(pmap_nenter_update); /* @@ -1410,12 +1409,12 @@ pmap_enter_locked(pmap_t pm, vm_offset_t * phsyical address, delete the old mapping. */ if (tp != NULL) { - CTR0(KTR_PMAP, "pmap_enter: replace"); + CTR0(KTR_PMAP, "pmap_enter_locked: replace"); PMAP_STATS_INC(pmap_nenter_replace); pmap_remove_tte(pm, NULL, tp, va); tlb_page_demap(pm, va); } else { - CTR0(KTR_PMAP, "pmap_enter: new"); + CTR0(KTR_PMAP, "pmap_enter_locked: new"); PMAP_STATS_INC(pmap_nenter_new); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 18:59:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 788231065672; Sun, 20 Sep 2009 18:59:30 +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 66C6C8FC1D; Sun, 20 Sep 2009 18:59:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KIxUPO065158; Sun, 20 Sep 2009 18:59:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KIxUq2065155; Sun, 20 Sep 2009 18:59:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201859.n8KIxUq2065155@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 18:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197367 - in stable/7/sys: . contrib/pf dev/pci sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 18:59:30 -0000 Author: marius Date: Sun Sep 20 18:59:30 2009 New Revision: 197367 URL: http://svn.freebsd.org/changeset/base/197367 Log: MFC: r195808 Add a MD __PCI_BAR_ZERO_VALID which denotes that BARs containing 0 actually specify valid bases that should be treated just as normal. The PCI specifications have no indication that 0 would be a magic value indicating a disabled BAR as commonly used on at least amd64 and i386 but not sparc64. It's unclear what to do in pci_delete_resource() instead of writing 0 to a BAR though as there's no (other) way do disable individual BARs so its decoding is left enabled in case of __PCI_BAR_ZERO_VALID for now. Approved by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pci.c stable/7/sys/sparc64/include/param.h Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Sun Sep 20 18:53:40 2009 (r197366) +++ stable/7/sys/dev/pci/pci.c Sun Sep 20 18:59:30 2009 (r197367) @@ -2337,7 +2337,7 @@ pci_add_map(device_t bus, device_t dev, { pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, maprange, mapsize, type; + int barlen, basezero, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2350,6 +2350,11 @@ pci_add_map(device_t bus, device_t dev, type = SYS_RES_IOPORT; mapsize = pci_mapsize(testval); base = pci_mapbase(map); +#ifdef __PCI_BAR_ZERO_VALID + basezero = 0; +#else + basezero = base == 0; +#endif maprange = pci_maprange(map); barlen = maprange == 64 ? 2 : 1; @@ -2378,17 +2383,17 @@ pci_add_map(device_t bus, device_t dev, } /* - * If base is 0, then we have problems. It is best to ignore - * such entries for the moment. These will be allocated later if - * the driver specifically requests them. However, some - * removable busses look better when all resources are allocated, - * so allow '0' to be overriden. + * If base is 0, then we have problems if this architecture does + * not allow that. It is best to ignore such entries for the + * moment. These will be allocated later if the driver specifically + * requests them. However, some removable busses look better when + * all resources are allocated, so allow '0' to be overriden. * * Similarly treat maps whose values is the same as the test value * read back. These maps have had all f's written to them by the * BIOS in an attempt to disable the resources. */ - if (!force && (base == 0 || map == testval)) + if (!force && (basezero || map == testval)) return (barlen); if ((u_long)base != base) { device_printf(bus, @@ -2425,7 +2430,7 @@ pci_add_map(device_t bus, device_t dev, } count = 1 << mapsize; - if (base == 0 || base == pci_mapbase(testval)) { + if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ end = ~0ULL; } else { @@ -3669,6 +3674,7 @@ pci_delete_resource(device_t dev, device return; } +#ifndef __PCI_BAR_ZERO_VALID /* * If this is a BAR, clear the BAR so it stops * decoding before releasing the resource. @@ -3679,6 +3685,7 @@ pci_delete_resource(device_t dev, device pci_write_bar(child, rid, 0); break; } +#endif bus_release_resource(dev, type, rid, rle->res); } resource_list_delete(rl, type, rid); Modified: stable/7/sys/sparc64/include/param.h ============================================================================== --- stable/7/sys/sparc64/include/param.h Sun Sep 20 18:53:40 2009 (r197366) +++ stable/7/sys/sparc64/include/param.h Sun Sep 20 18:59:30 2009 (r197367) @@ -48,6 +48,8 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __PCI_BAR_ZERO_VALID + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 19:14:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BECDC106566C; Sun, 20 Sep 2009 19:14:34 +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 AE3008FC0A; Sun, 20 Sep 2009 19:14:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KJEY3J065473; Sun, 20 Sep 2009 19:14:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KJEYrh065471; Sun, 20 Sep 2009 19:14:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201914.n8KJEYrh065471@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 19:14: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: r197368 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 19:14:34 -0000 Author: marius Date: Sun Sep 20 19:14:34 2009 New Revision: 197368 URL: http://svn.freebsd.org/changeset/base/197368 Log: - Update the list of known-working machines based on feedback for 7.2. - Update the V440 entry regarding added support for the on-board NICs in 8.0. Approved by: blackend MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Sep 20 18:59:30 2009 (r197367) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Sep 20 19:14:34 2009 (r197368) @@ -503,6 +503,10 @@ + &sun.blade; 2500 + + + &sun.fire; 280R @@ -511,7 +515,12 @@ - &sun.fire; V440 (except for the on-board NICs) + &sun.fire; V250 + + + + &sun.fire; V440 (support for the on-board NICs first + appeared in 8.0-RELEASE) From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 19:26:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F23E0106566B; Sun, 20 Sep 2009 19:26:04 +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 E119C8FC08; Sun, 20 Sep 2009 19:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KJQ47h065714; Sun, 20 Sep 2009 19:26:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KJQ4Qf065712; Sun, 20 Sep 2009 19:26:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201926.n8KJQ4Qf065712@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 19:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197369 - stable/6/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 19:26:05 -0000 Author: marius Date: Sun Sep 20 19:26:04 2009 New Revision: 197369 URL: http://svn.freebsd.org/changeset/base/197369 Log: Re-apply adaption to stable/6 which somehow managed to escape r197355. Modified: stable/6/sys/dev/gem/if_gem_sbus.c Modified: stable/6/sys/dev/gem/if_gem_sbus.c ============================================================================== --- stable/6/sys/dev/gem/if_gem_sbus.c Sun Sep 20 19:14:34 2009 (r197368) +++ stable/6/sys/dev/gem/if_gem_sbus.c Sun Sep 20 19:26:04 2009 (r197369) @@ -167,7 +167,7 @@ gem_sbus_attach(device_t dev) } if (bus_setup_intr(dev, sc->sc_res[GEM_RES_INTR], INTR_TYPE_NET | - INTR_MPSAFE, NULL, gem_intr, sc, &sc->sc_ih) != 0) { + INTR_MPSAFE, gem_intr, sc, &sc->sc_ih) != 0) { device_printf(dev, "failed to set up interrupt\n"); gem_detach(sc); goto fail; From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 19:32:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BBDE106566B; Sun, 20 Sep 2009 19:32:11 +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 28BBD8FC13; Sun, 20 Sep 2009 19:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KJWBre065891; Sun, 20 Sep 2009 19:32:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KJWBZu065887; Sun, 20 Sep 2009 19:32:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909201932.n8KJWBZu065887@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Sep 2009 19:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197370 - in stable/6/sys: . conf contrib/pf dev/cxgb sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 19:32:11 -0000 Author: marius Date: Sun Sep 20 19:32:10 2009 New Revision: 197370 URL: http://svn.freebsd.org/changeset/base/197370 Log: MFC: r195149 (partial) - Work around the broken loader behavior of not demapping no longer used kernel TLB slots when unloading the kernel or modules, which results in havoc when loading a kernel and modules which take up less TLB slots afterwards as the unused but locked ones aren't accounted for in virtual_avail. Eventually this should be fixed in the loader which isn't straight forward though and the kernel should be robust against this anyway. [1] - Remove the no longer used global msgbuf_phys. - Remove the redundant ekva parameter of pmap_bootstrap_alloc(). - Correct some outdated function names in ktr(9) invocations. Requested by: jhb [1] Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/sparc64/include/pmap.h stable/6/sys/sparc64/sparc64/machdep.c stable/6/sys/sparc64/sparc64/pmap.c Modified: stable/6/sys/sparc64/include/pmap.h ============================================================================== --- stable/6/sys/sparc64/include/pmap.h Sun Sep 20 19:26:04 2009 (r197369) +++ stable/6/sys/sparc64/include/pmap.h Sun Sep 20 19:32:10 2009 (r197370) @@ -77,7 +77,7 @@ struct pmap { #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) -void pmap_bootstrap(vm_offset_t ekva); +void pmap_bootstrap(void); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kenter(vm_offset_t va, vm_page_t m); void pmap_kremove(vm_offset_t); @@ -105,8 +105,6 @@ extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; -extern vm_paddr_t msgbuf_phys; - #ifdef PMAP_STATS SYSCTL_DECL(_debug_pmap_stats); Modified: stable/6/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/6/sys/sparc64/sparc64/machdep.c Sun Sep 20 19:26:04 2009 (r197369) +++ stable/6/sys/sparc64/sparc64/machdep.c Sun Sep 20 19:32:10 2009 (r197370) @@ -275,6 +275,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l char *env; struct pcpu *pc; vm_offset_t end; + vm_offset_t va; caddr_t kmdp; phandle_t child; phandle_t root; @@ -338,19 +339,28 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Panic if there is no metadata. Most likely the kernel was booted * directly, instead of through loader(8). */ - if (mdp == NULL || kmdp == NULL) { - printf("sparc64_init: no loader metadata.\n" + if (mdp == NULL || kmdp == NULL || end == 0 || + kernel_tlb_slots == 0 || kernel_tlbs == NULL) { + printf("sparc64_init: missing loader metadata.\n" "This probably means you are not using loader(8).\n"); panic("sparc64_init"); } /* - * Sanity check the kernel end, which is important. - */ - if (end == 0) { - printf("sparc64_init: warning, kernel end not specified.\n" - "Attempting to continue anyway.\n"); - end = (vm_offset_t)_end; + * Work around the broken loader behavior of not demapping no + * longer used kernel TLB slots when unloading the kernel or + * modules. + */ + for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; + va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { + printf("demapping unused kernel TLB slot (va %#lx - %#lx)\n", + va, va + PAGE_SIZE_4M - 1); + stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, + ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, + ASI_IMMU_DEMAP, 0); + flush(KERNBASE); + kernel_tlb_slots--; } cache_init(child); @@ -371,7 +381,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Initialize virtual memory and calculate physmem. */ - pmap_bootstrap(end); + pmap_bootstrap(); /* * Initialize tunables. Modified: stable/6/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/6/sys/sparc64/sparc64/pmap.c Sun Sep 20 19:26:04 2009 (r197369) +++ stable/6/sys/sparc64/sparc64/pmap.c Sun Sep 20 19:32:10 2009 (r197370) @@ -111,10 +111,9 @@ __FBSDID("$FreeBSD$"); #endif /* - * Virtual and physical address of message buffer + * Virtual address of message buffer */ struct msgbuf *msgbufp; -vm_paddr_t msgbuf_phys; int pmap_pagedaemon_waken; @@ -271,7 +270,7 @@ om_cmp(const void *a, const void *b) * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(vm_offset_t ekva) +pmap_bootstrap(void) { struct pmap *pm; struct tte *tp; @@ -349,8 +348,8 @@ pmap_bootstrap(vm_offset_t ekva) /* * Allocate and map the message buffer. */ - msgbuf_phys = pmap_bootstrap_alloc(MSGBUF_SIZE); - msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(msgbuf_phys); + pa = pmap_bootstrap_alloc(MSGBUF_SIZE); + msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa); /* * Patch the virtual address and the tsb mask into the trap table. @@ -399,10 +398,11 @@ pmap_bootstrap(vm_offset_t ekva) } /* - * Set the start and end of KVA. The kernel is loaded at the first - * available 4MB super page, so round up to the end of the page. + * Set the start and end of KVA. The kernel is loaded starting + * at the first available 4MB super page, so we advance to the + * end of the last one used for it. */ - virtual_avail = roundup2(ekva, PAGE_SIZE_4M); + virtual_avail = KERNBASE + kernel_tlb_slots * PAGE_SIZE_4M; virtual_end = vm_max_kernel_address; kernel_vm_end = vm_max_kernel_address; @@ -422,8 +422,7 @@ pmap_bootstrap(vm_offset_t ekva) * coloured properly, since we're allocating from phys_avail so the * memory won't have an associated vm_page_t. */ - pa = pmap_bootstrap_alloc(roundup(KSTACK_PAGES, DCACHE_COLORS) * - PAGE_SIZE); + pa = pmap_bootstrap_alloc(KSTACK_PAGES * PAGE_SIZE); kstack0_phys = pa; virtual_avail += roundup(KSTACK_GUARD_PAGES, DCACHE_COLORS) * PAGE_SIZE; @@ -560,7 +559,7 @@ pmap_bootstrap_alloc(vm_size_t size) vm_paddr_t pa; int i; - size = round_page(size); + size = roundup(size, PAGE_SIZE * DCACHE_COLORS); for (i = 0; phys_avail[i + 1] != 0; i += 2) { if (phys_avail[i + 1] - phys_avail[i] < size) continue; @@ -928,7 +927,7 @@ pmap_kremove_flags(vm_offset_t va) struct tte *tp; tp = tsb_kvtotte(va); - CTR3(KTR_PMAP, "pmap_kremove: va=%#lx tp=%p data=%#lx", va, tp, + CTR3(KTR_PMAP, "pmap_kremove_flags: va=%#lx tp=%p data=%#lx", va, tp, tp->tte_data); TTE_ZERO(tp); } @@ -1330,7 +1329,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t } CTR6(KTR_PMAP, - "pmap_enter: ctx=%p m=%p va=%#lx pa=%#lx prot=%#x wired=%d", + "pmap_enter_locked: ctx=%p m=%p va=%#lx pa=%#lx prot=%#x wired=%d", pm->pm_context[curcpu], m, va, pa, prot, wired); /* @@ -1338,7 +1337,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t * changed, must be protection or wiring change. */ if ((tp = tsb_tte_lookup(pm, va)) != NULL && TTE_GET_PA(tp) == pa) { - CTR0(KTR_PMAP, "pmap_enter: update"); + CTR0(KTR_PMAP, "pmap_enter_locked: update"); PMAP_STATS_INC(pmap_nenter_update); /* @@ -1394,12 +1393,12 @@ pmap_enter_locked(pmap_t pm, vm_offset_t * phsyical address, delete the old mapping. */ if (tp != NULL) { - CTR0(KTR_PMAP, "pmap_enter: replace"); + CTR0(KTR_PMAP, "pmap_enter_locked: replace"); PMAP_STATS_INC(pmap_nenter_replace); pmap_remove_tte(pm, NULL, tp, va); tlb_page_demap(pm, va); } else { - CTR0(KTR_PMAP, "pmap_enter: new"); + CTR0(KTR_PMAP, "pmap_enter_locked: new"); PMAP_STATS_INC(pmap_nenter_new); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 21:23:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D758106566B; Sun, 20 Sep 2009 21:23:50 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id BCCD08FC0C; Sun, 20 Sep 2009 21:23:49 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAIs6tkqDaFvG/2dsb2JhbADNGYQbBQ X-IronPort-AV: E=Sophos;i="4.44,419,1249272000"; d="scan'208";a="48720839" Received: from amazon.cs.uoguelph.ca ([131.104.91.198]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 20 Sep 2009 17:23:35 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by amazon.cs.uoguelph.ca (Postfix) with ESMTP id 7652A210109; Sun, 20 Sep 2009 17:23:35 -0400 (EDT) X-Virus-Scanned: amavisd-new at amazon.cs.uoguelph.ca Received: from amazon.cs.uoguelph.ca ([127.0.0.1]) by localhost (amazon.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u+ozRAKi-EO2; Sun, 20 Sep 2009 17:23:34 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by amazon.cs.uoguelph.ca (Postfix) with ESMTP id A6372210108; Sun, 20 Sep 2009 17:23:34 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8KLTAr24139; Sun, 20 Sep 2009 17:29:11 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Sun, 20 Sep 2009 17:29:10 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: "M. Warner Losh" In-Reply-To: <20090919.230053.58383965.imp@bsdimp.com> Message-ID: References: <4AB35086.90502@FreeBSD.org> <4AB495DD.1010006@FreeBSD.org> <20090919.230053.58383965.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, rmacklem@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 21:23:50 -0000 On Sat, 19 Sep 2009, M. Warner Losh wrote: > : > : Hmm, it might actually be nice to be able to change those at some point > : as well. I have looked at this in the past and it is quite deeply > : buried in libc. :-/ > > What's the benefit for forcing a tcp connection for the portmapper > RPCs? They just happen once at startup... > Someone mentioned an issue w.r.t. umount using UDP, which was basically a slow timeout when a server didn't handle the UDP call, such as when it was down. I'd guess that a TCP attempt would fail more quickly than a UDP attempt when the server doesn't have rpcbind/portmapper running. (Not so sure when the server has crashed, but I'm guessing that the TCP connection attempt fails more quickly than the N retries over UDP?) And what about going through NAT gateways? (I'm not familiar with how typical NAT gateways are set up, but do they all forward UDP ok?) I suspect others would know more about the tradeoffs? rick From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 21:42:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB7F8106566C; Sun, 20 Sep 2009 21:42:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA6F18FC13; Sun, 20 Sep 2009 21:42:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KLgc9G068320; Sun, 20 Sep 2009 21:42:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8KLgc0i068318; Sun, 20 Sep 2009 21:42:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200909202142.n8KLgc0i068318@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Sep 2009 21:42: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: r197371 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 21:42:38 -0000 Author: jilles Date: Sun Sep 20 21:42:38 2009 New Revision: 197371 URL: http://svn.freebsd.org/changeset/base/197371 Log: Mention that NUL characters are not allowed in sh(1) input. I do not consider this a bug because POSIX permits it and argument strings and environment variables cannot contain '\0' anyway. PR: bin/25542 MFC after: 2 weeks Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Sep 20 19:32:10 2009 (r197370) +++ head/bin/sh/sh.1 Sun Sep 20 21:42:38 2009 (r197371) @@ -375,6 +375,10 @@ introduces a comment if used at the begi The word starting with .Ql # and the rest of the line are ignored. +.Pp +.Tn ASCII +.Dv NUL +characters (character code 0) are not allowed in shell input. .Ss Quoting Quoting is used to remove the special meaning of certain characters or words to the shell, such as operators, whitespace, keywords, From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 21:53:51 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C6491065676; Sun, 20 Sep 2009 21:53:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D6BF98FC12; Sun, 20 Sep 2009 21:53:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8KLq0v3067218; Sun, 20 Sep 2009 15:52:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Sep 2009 15:53:47 -0600 (MDT) Message-Id: <20090920.155347.-675685342.imp@bsdimp.com> To: rmacklem@uoguelph.ca From: "M. Warner Losh" In-Reply-To: References: <4AB495DD.1010006@FreeBSD.org> <20090919.230053.58383965.imp@bsdimp.com> 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, rmacklem@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 21:53:51 -0000 In message: Rick Macklem writes: : : : On Sat, 19 Sep 2009, M. Warner Losh wrote: : : > : : > : Hmm, it might actually be nice to be able to change those at some point : > : as well. I have looked at this in the past and it is quite deeply : > : buried in libc. :-/ : > : > What's the benefit for forcing a tcp connection for the portmapper : > RPCs? They just happen once at startup... : > : Someone mentioned an issue w.r.t. umount using UDP, which was basically : a slow timeout when a server didn't handle the UDP call, such as when : it was down. I'd guess that a TCP attempt would fail more quickly than : a UDP attempt when the server doesn't have rpcbind/portmapper running. : (Not so sure when the server has crashed, but I'm guessing that the TCP : connection attempt fails more quickly than the N retries over UDP?) A server down would have the same timeout issues as a UDP timeout. : And what about going through NAT gateways? (I'm not familiar with how : typical NAT gateways are set up, but do they all forward UDP ok?) : : I suspect others would know more about the tradeoffs? rick I think Sam hit the nail on the head: Its more firewall friendly to be able to do it... Warner From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 22:49:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45EA6106566B; Sun, 20 Sep 2009 22:49:31 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 95E9E8FC12; Sun, 20 Sep 2009 22:49:30 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHdOtkqDaFvH/2dsb2JhbADNJoQbBYFY X-IronPort-AV: E=Sophos;i="4.44,420,1249272000"; d="scan'208";a="48725481" Received: from danube.cs.uoguelph.ca ([131.104.91.199]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 20 Sep 2009 18:49:29 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by danube.cs.uoguelph.ca (Postfix) with ESMTP id C06F810844CB; Sun, 20 Sep 2009 18:49:29 -0400 (EDT) X-Virus-Scanned: amavisd-new at danube.cs.uoguelph.ca Received: from danube.cs.uoguelph.ca ([127.0.0.1]) by localhost (danube.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Gs+7tgfPr53; Sun, 20 Sep 2009 18:49:28 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by danube.cs.uoguelph.ca (Postfix) with ESMTP id A83A9108442B; Sun, 20 Sep 2009 18:49:28 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8KMt5Y11297; Sun, 20 Sep 2009 18:55:05 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Sun, 20 Sep 2009 18:55:05 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: "M. Warner Losh" In-Reply-To: <20090920.155347.-675685342.imp@bsdimp.com> Message-ID: References: <4AB495DD.1010006@FreeBSD.org> <20090919.230053.58383965.imp@bsdimp.com> <20090920.155347.-675685342.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, rmacklem@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 22:49:31 -0000 On Sun, 20 Sep 2009, M. Warner Losh wrote: > In message: > Rick Macklem writes: > : > : > : On Sat, 19 Sep 2009, M. Warner Losh wrote: > : > : > : > : > : Hmm, it might actually be nice to be able to change those at some point > : > : as well. I have looked at this in the past and it is quite deeply > : > : buried in libc. :-/ > : > > : > What's the benefit for forcing a tcp connection for the portmapper > : > RPCs? They just happen once at startup... > : > Just fyi, I just looked at what the "competition" does and was a bit surprised at what I found: Linux (not really current system): - starts out talking to Portmapper over TCP and gets a dump of the other machine's portmap list, then switches to UDP to get the port#s for Mount and NFS, even if "tcp" was specified on the mount. - Uses UDP for both Mount and NFS by default, but switches to using TCP for both when "tcp" is specified. (As noted, this was a rather old Linux system, so I wouldn't be surprised if this has changed/is different for other distros.) Solaris10: - Always uses UDP for Portmapper and Mount, no matter what is specified on the mount command. - Uses TCP for NFS by default of UDP if "proto=udp" is specified as a mount option. I was surprised that Solaris10 did this. I've also noticed that the "mntudp" option doesn't do what the man page says it does. The man page indicates that it forces the use of UDP for Mount, even when TCP is used for NFS (like Solaris10 does by default). However, the current mount_nfs.c switches to UDP for both Mount and NFS when "mntudp" is specified. (It was changed to that behaviour by r180435. It would be nice to have it so that a default mount without "udp" nor "tcp" specified doesn't create the unusable mount point for a server that is UDP only, as reported by the email to freebsd-stable on Sep. 11 with subject "NFS issues on 8.0-BETA4. r197298 did that, but made it "less Solaris10 compatible". I tend to like being Solaris compatible, but I'm not sure if that makes sense for this? rick From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 01:38:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A1F2106568F; Mon, 21 Sep 2009 01:38:23 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 392518FC0C; Mon, 21 Sep 2009 01:38:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L1cNvt072729; Mon, 21 Sep 2009 01:38:23 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L1cNb1072725; Mon, 21 Sep 2009 01:38:23 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200909210138.n8L1cNb1072725@svn.freebsd.org> From: Matt Jacob Date: Mon, 21 Sep 2009 01:38: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: r197372 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 01:38:23 -0000 Author: mjacob Date: Mon Sep 21 01:38:22 2009 New Revision: 197372 URL: http://svn.freebsd.org/changeset/base/197372 Log: Remove file unused in freebsd. Deleted: head/sys/dev/isp/isp_tpublic.h Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_stds.h head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Sep 20 21:42:38 2009 (r197371) +++ head/sys/dev/isp/isp.c Mon Sep 21 01:38:22 2009 (r197372) @@ -1547,24 +1547,18 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_maxfrmlen = DEFAULT_FRAMESIZE(isp); - if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || - icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { - isp_prt(isp, ISP_LOGERR, - "bad frame length (%d) from NVRAM- using %d", - DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); + if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { + isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM- using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN; } icbp->icb_maxalloc = fcp->isp_maxalloc; if (icbp->icb_maxalloc < 1) { - isp_prt(isp, ISP_LOGERR, - "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); + isp_prt(isp, ISP_LOGERR, "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); icbp->icb_maxalloc = 16; } icbp->icb_execthrottle = DEFAULT_EXEC_THROTTLE(isp); if (icbp->icb_execthrottle < 1) { - isp_prt(isp, ISP_LOGERR, - "bad execution throttle of %d- using %d", - DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); + isp_prt(isp, ISP_LOGERR, "bad execution throttle of %d- using %d", DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); icbp->icb_execthrottle = ICB_DFLT_THROTTLE; } icbp->icb_retry_delay = fcp->isp_retry_delay; @@ -1658,18 +1652,18 @@ isp_fibre_init(ispsoftc_t *isp) /* * For 22XX > 2.1.26 && 23XX, set some options. - * XXX: Probably okay for newer 2100 f/w too. */ if (ISP_FW_NEWER_THAN(isp, 2, 26, 0)) { - /* - * Turn on LIP F8 async event (1) - * Turn on generate AE 8013 on all LIP Resets (2) - * Disable LIP F7 switching (8) - */ MBSINIT(&mbs, MBOX_SET_FIRMWARE_OPTIONS, MBLOGALL, 0); - mbs.param[1] = 0xb; + mbs.param[1] = IFCOPT1_DISF7SWTCH|IFCOPT1_LIPASYNC|IFCOPT1_LIPF8; mbs.param[2] = 0; mbs.param[3] = 0; + if (ISP_FW_NEWER_THAN(isp, 3, 16, 0)) { + mbs.param[1] |= IFCOPT1_EQFQASYNC|IFCOPT1_CTIO_RETRY; + if (fcp->role & ISP_ROLE_TARGET) { + mbs.param[3] = IFCOPT3_NOPRLI; + } + } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return; @@ -2093,8 +2087,7 @@ isp_mark_portdb(ispsoftc_t *isp, int cha * or via FABRIC LOGIN/FABRIC LOGOUT for other cards. */ static int -isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, - int flags, int gs) +isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags, int gs) { mbreg_t mbs; uint8_t q[QENTRY_LEN]; @@ -2771,15 +2764,21 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) /* * Make sure we're okay for doing this right now. */ - if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", fcp->isp_loopstate); + if (fcp->isp_loopstate != LOOP_PDB_RCVD && + fcp->isp_loopstate != LOOP_FSCAN_DONE && + fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", + fcp->isp_loopstate); return (-1); } - if (fcp->isp_topo == TOPO_FL_PORT || fcp->isp_topo == TOPO_NL_PORT || fcp->isp_topo == TOPO_N_PORT) { + if (fcp->isp_topo == TOPO_FL_PORT || + fcp->isp_topo == TOPO_NL_PORT || + fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_loop failed"); + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2788,13 +2787,15 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_fabric failed"); + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, + "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2823,7 +2824,11 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); if (lp->autologin == 0) { - (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 0); + (void) isp_plogx(isp, chan, lp->handle, + lp->portid, + PLOGX_FLG_CMD_LOGO | + PLOGX_FLG_IMPLICIT | + PLOGX_FLG_FREE_NPHDL, 0); } else { lp->autologin = 0; } @@ -3069,7 +3074,8 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || + lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3587,7 +3593,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || + lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3824,7 +3831,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && + fcp->portdb[dbidx].port_wwn == wwpn) { break; } } Modified: head/sys/dev/isp/isp_stds.h ============================================================================== --- head/sys/dev/isp/isp_stds.h Sun Sep 20 21:42:38 2009 (r197371) +++ head/sys/dev/isp/isp_stds.h Mon Sep 21 01:38:22 2009 (r197372) @@ -147,6 +147,7 @@ typedef struct { #define FCP_SNSLEN_VALID 0x02 #define FCP_RSPLEN_VALID 0x01 +#define FCP_MAX_RSPLEN 0x08 /* * FCP Response Code Definitions * Source: NCITS T10, Project 1144D, Revision 08 (aka FCP2r08) @@ -159,6 +160,8 @@ typedef struct { #define FCP_RSPNS_EROFS 3 #define FCP_RSPNS_TMF_REJECT 4 #define FCP_RSPNS_TMF_FAILED 5 +#define FCP_RSPNS_TMF_SUCCEEDED 8 +#define FCP_RSPNS_TMF_INCORRECT_LUN 9 /* unconverted miscellany */ Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Sun Sep 20 21:42:38 2009 (r197371) +++ head/sys/dev/isp/ispmbox.h Mon Sep 21 01:38:22 2009 (r197372) @@ -245,12 +245,38 @@ #define ASYNC_RCV_ERR 0x8048 /* + * Firmware Options. There are a lot of them. + * + * IFCOPTN - ISP Fibre Channel Option Word N + */ +#define IFCOPT1_EQFQASYNC (1 << 13) /* enable QFULL notification */ +#define IFCOPT1_EAABSRCVD (1 << 12) +#define IFCOPT1_RJTASYNC (1 << 11) /* enable 8018 notification */ +#define IFCOPT1_ENAPURE (1 << 10) +#define IFCOPT1_ENA8017 (1 << 7) +#define IFCOPT1_DISGPIO67 (1 << 6) +#define IFCOPT1_LIPLOSSIMM (1 << 5) +#define IFCOPT1_DISF7SWTCH (1 << 4) +#define IFCOPT1_CTIO_RETRY (1 << 3) +#define IFCOPT1_LIPASYNC (1 << 1) +#define IFCOPT1_LIPF8 (1 << 0) + +#define IFCOPT2_LOOPBACK (1 << 1) +#define IFCOPT2_ATIO3_ONLY (1 << 0) + +#define IFCOPT3_NOPRLI (1 << 4) /* disable automatic sending of PRLI on local loops */ +#define IFCOPT3_RNDASYNC (1 << 1) +/* * 2.01.31 2200 Only. Need Bit 13 in Mailbox 1 for Set Firmware Options * mailbox command to enable this. */ #define ASYNC_QFULL_SENT 0x8049 /* + * Needs to be enabled + */ +#define ASYNC_AUTO_PLOGI_RJT 0x8018 +/* * 24XX only */ #define ASYNC_RJT_SENT 0x8049 From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 01:41:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2055A1065676; Mon, 21 Sep 2009 01:41:20 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 104E88FC15; Mon, 21 Sep 2009 01:41:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L1fJIu072825; Mon, 21 Sep 2009 01:41:19 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L1fJac072821; Mon, 21 Sep 2009 01:41:19 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200909210141.n8L1fJac072821@svn.freebsd.org> From: Matt Jacob Date: Mon, 21 Sep 2009 01:41: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: r197373 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 01:41:20 -0000 Author: mjacob Date: Mon Sep 21 01:41:19 2009 New Revision: 197373 URL: http://svn.freebsd.org/changeset/base/197373 Log: (semiforced commit to add comment missed in last delta) Add a maximum response length for FCP RSPNS IUs. Clarify some of the FC option words for setting parameters and try and disable automatic PRLI when in target mode- this should correct some cases of N-port topologies with 23XX cards where we put out an illegal PRLI (in target mode only we're not supposed to put out a PRLI). Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_stds.h head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Sep 21 01:38:22 2009 (r197372) +++ head/sys/dev/isp/isp.c Mon Sep 21 01:41:19 2009 (r197373) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); /* * General defines */ - #define MBOX_DELAY_COUNT 1000000 / 100 #define ISP_MARK_PORTDB(a, b, c) \ isp_prt(isp, ISP_LOGSANCFG, \ Modified: head/sys/dev/isp/isp_stds.h ============================================================================== --- head/sys/dev/isp/isp_stds.h Mon Sep 21 01:38:22 2009 (r197372) +++ head/sys/dev/isp/isp_stds.h Mon Sep 21 01:41:19 2009 (r197373) @@ -31,7 +31,6 @@ */ #ifndef _ISP_STDS_H #define _ISP_STDS_H - /* * FC Frame Header * Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Mon Sep 21 01:38:22 2009 (r197372) +++ head/sys/dev/isp/ispmbox.h Mon Sep 21 01:41:19 2009 (r197373) @@ -26,6 +26,7 @@ * SUCH DAMAGE. * */ + /* * Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters. */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 02:46:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5B41065694; Mon, 21 Sep 2009 02:46:21 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 8A11A8FC19; Mon, 21 Sep 2009 02:46:20 +0000 (UTC) Received: from inchoate.gsoft.com.au (inchoate.gsoft.com.au [203.31.81.30]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id n8L2k9cB032127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 21 Sep 2009 12:16:09 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: svn-src-all@freebsd.org Date: Mon, 21 Sep 2009 12:15:58 +0930 User-Agent: KMail/1.9.10 References: <4AB35086.90502@FreeBSD.org> <20090919.230053.58383965.imp@bsdimp.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3766416.kTYsddXpYt"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200909211216.07249.doconnor@gsoft.com.au> X-Spam-Score: -3.622 () ALL_TRUSTED,AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: Rick Macklem , jhb@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, rmacklem@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 02:46:21 -0000 --nextPart3766416.kTYsddXpYt Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 21 Sep 2009, Rick Macklem wrote: > And what about going through NAT gateways? (I'm not familiar with how > typical NAT gateways are set up, but do they all forward UDP ok?) The thought of doing NFS over the internet boggles my mind :) However all consumer grade routers will NAT UDP properly otherwise=20 people wouldn't be able to play games. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart3766416.kTYsddXpYt Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iD8DBQBKtujv5ZPcIHs/zowRAjAQAKCJXeb6R5zCMsPYJ8G09ipGnGcqOgCeJTE2 /LKEWcGNk6n5aTYB+irrxXI= =uBHK -----END PGP SIGNATURE----- --nextPart3766416.kTYsddXpYt-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 04:02:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CE7E106566C; Mon, 21 Sep 2009 04:02:37 +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 C174A8FC25; Mon, 21 Sep 2009 04:02:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8L41uUZ070296; Sun, 20 Sep 2009 22:01:59 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Sep 2009 22:03:43 -0600 (MDT) Message-Id: <20090920.220343.-737556392.imp@bsdimp.com> To: doconnor@gsoft.com.au From: "M. Warner Losh" In-Reply-To: <200909211216.07249.doconnor@gsoft.com.au> References: <20090919.230053.58383965.imp@bsdimp.com> <200909211216.07249.doconnor@gsoft.com.au> 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: rmacklem@uoguelph.ca, jhb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, rmacklem@freebsd.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 04:02:37 -0000 In message: <200909211216.07249.doconnor@gsoft.com.au> "Daniel O'Connor" writes: : On Mon, 21 Sep 2009, Rick Macklem wrote: : > And what about going through NAT gateways? (I'm not familiar with how : > typical NAT gateways are set up, but do they all forward UDP ok?) : : The thought of doing NFS over the internet boggles my mind :) One of the early net meltdowns was caused by this, no? : However all consumer grade routers will NAT UDP properly otherwise : people wouldn't be able to play games. The issue most likely is one of internal firewalls, not external... Warner From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 04:04:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56019106566B; Mon, 21 Sep 2009 04:04:03 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 463078FC12; Mon, 21 Sep 2009 04:04:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L443Ok075660; Mon, 21 Sep 2009 04:04:03 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L443KB075659; Mon, 21 Sep 2009 04:04:03 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909210404.n8L443KB075659@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 21 Sep 2009 04:04: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: r197374 - head/lib/libdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 04:04:03 -0000 Author: nyan Date: Mon Sep 21 04:04:02 2009 New Revision: 197374 URL: http://svn.freebsd.org/changeset/base/197374 Log: Disable a check on a disk size because it's too strict. This change is to avoid using incorrect geometry. It seems that this is the same problem in g_part_bsd_read()@g_part_bsd.c. Reviewed by: rink MFC after: 3 days Modified: head/lib/libdisk/change.c Modified: head/lib/libdisk/change.c ============================================================================== --- head/lib/libdisk/change.c Mon Sep 21 01:41:19 2009 (r197373) +++ head/lib/libdisk/change.c Mon Sep 21 04:04:02 2009 (r197374) @@ -47,9 +47,11 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_sect > 63) sane = 0; #endif +#if 0 /* Disable a check on a disk size. It's too strict. */ if (disk->bios_cyl * disk->bios_hd * disk->bios_sect != disk->chunks->size) sane = 0; +#endif if (sane) return; From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 04:46:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2D4106566C; Mon, 21 Sep 2009 04:46:25 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id D3AC58FC21; Mon, 21 Sep 2009 04:46:24 +0000 (UTC) Received: from inchoate.gsoft.com.au (inchoate.gsoft.com.au [203.31.81.30]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id n8L4kHQD036162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 21 Sep 2009 14:16:17 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: "M. Warner Losh" Date: Mon, 21 Sep 2009 14:16:02 +0930 User-Agent: KMail/1.9.10 References: <20090919.230053.58383965.imp@bsdimp.com> <200909211216.07249.doconnor@gsoft.com.au> <20090920.220343.-737556392.imp@bsdimp.com> In-Reply-To: <20090920.220343.-737556392.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1698371.Ygi6avxiP1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200909211416.11654.doconnor@gsoft.com.au> X-Spam-Score: -3.622 () ALL_TRUSTED,AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: rmacklem@uoguelph.ca, jhb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, rmacklem@freebsd.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 04:46:25 -0000 --nextPart1698371.Ygi6avxiP1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 21 Sep 2009, M. Warner Losh wrote: > In message: <200909211216.07249.doconnor@gsoft.com.au> > > "Daniel O'Connor" writes: > : On Mon, 21 Sep 2009, Rick Macklem wrote: > : > And what about going through NAT gateways? (I'm not familiar with > : > how typical NAT gateways are set up, but do they all forward UDP > : > ok?) > : > : The thought of doing NFS over the internet boggles my mind :) > > One of the early net meltdowns was caused by this, no? Before my time ;) > : However all consumer grade routers will NAT UDP properly otherwise > : people wouldn't be able to play games. > > The issue most likely is one of internal firewalls, not external... Well I wondered if that was what the OP meant but then why would you=20 need NAT? Of course that doesn't mean there isn't some crazy internal=20 setup that would send sane people running for the hills in horror. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart1698371.Ygi6avxiP1 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iD8DBQBKtwUT5ZPcIHs/zowRAqvmAJoCdaZZCpdPFZxxvRTl5gMAOS80MgCggO8w yo3RbhFD6y+qtHAaRJ4GIco= =sI4a -----END PGP SIGNATURE----- --nextPart1698371.Ygi6avxiP1-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 06:47:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ADAD106566C; Mon, 21 Sep 2009 06:47:01 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AB578FC12; Mon, 21 Sep 2009 06:47:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L6l0Af078849; Mon, 21 Sep 2009 06:47:00 GMT (envelope-from blackend@svn.freebsd.org) Received: (from blackend@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L6l0ZW078848; Mon, 21 Sep 2009 06:47:00 GMT (envelope-from blackend@svn.freebsd.org) Message-Id: <200909210647.n8L6l0ZW078848@svn.freebsd.org> From: Marc Fonvieille Date: Mon, 21 Sep 2009 06:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197378 - in stable/8/release: . doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 06:47:01 -0000 Author: blackend (doc committer) Date: Mon Sep 21 06:47:00 2009 New Revision: 197378 URL: http://svn.freebsd.org/changeset/base/197378 Log: Add missing mergeinfo for MFC of r196588. Pointy Hat: blackend Approved by: re (kib) Modified: stable/8/release/ (props changed) stable/8/release/doc/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 07:05:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51BEA106566C; Mon, 21 Sep 2009 07:05:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB918FC0A; Mon, 21 Sep 2009 07:05:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L75mqc079219; Mon, 21 Sep 2009 07:05:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L75mYP079212; Mon, 21 Sep 2009 07:05:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210705.n8L75mYP079212@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 07:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197379 - in head/sys: amd64/conf conf dev/fb i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 07:05:49 -0000 Author: delphij Date: Mon Sep 21 07:05:48 2009 New Revision: 197379 URL: http://svn.freebsd.org/changeset/base/197379 Log: Enable s3pci on amd64 which works on top of VESA, and allow static building it into kernel on i386 and amd64. Submitted by: swell.k at gmail.com Modified: head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/fb/s3_pci.c head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Sep 21 06:47:00 2009 (r197378) +++ head/sys/amd64/conf/NOTES Mon Sep 21 07:05:48 2009 (r197379) @@ -219,6 +219,9 @@ options VGA_WIDTH90 # support 90 colum # Debugging. options VGA_DEBUG +# Linear framebuffer driver for S3 VESA 1.2 cards. Works on top of VESA. +device s3pci + # 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create # the /dev/3dfx0 device to work with glide implementations. This should get # linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Sep 21 06:47:00 2009 (r197378) +++ head/sys/conf/files.amd64 Mon Sep 21 07:05:48 2009 (r197379) @@ -170,6 +170,7 @@ dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb | vga +dev/fb/s3_pci.c optional s3pci dev/fb/vesa.c optional vga vesa x86emu dev/fb/vga.c optional vga dev/ichwd/ichwd.c optional ichwd Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Sep 21 06:47:00 2009 (r197378) +++ head/sys/conf/files.i386 Mon Sep 21 07:05:48 2009 (r197379) @@ -157,6 +157,7 @@ dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb | vga +dev/fb/s3_pci.c optional s3pci dev/fb/vesa.c optional vga vesa x86emu dev/fb/vga.c optional vga dev/fdc/fdc.c optional fdc Modified: head/sys/dev/fb/s3_pci.c ============================================================================== --- head/sys/dev/fb/s3_pci.c Mon Sep 21 06:47:00 2009 (r197378) +++ head/sys/dev/fb/s3_pci.c Mon Sep 21 07:05:48 2009 (r197379) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Sep 21 06:47:00 2009 (r197378) +++ head/sys/i386/conf/NOTES Mon Sep 21 07:05:48 2009 (r197379) @@ -444,6 +444,9 @@ options VGA_WIDTH90 # support 90 colum # Debugging. options VGA_DEBUG +# Linear framebuffer driver for S3 VESA 1.2 cards. Works on top of VESA. +device s3pci + # 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create # the /dev/3dfx0 device to work with glide implementations. This should get # linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Sep 21 06:47:00 2009 (r197378) +++ head/sys/modules/Makefile Mon Sep 21 07:05:48 2009 (r197379) @@ -528,6 +528,7 @@ _padlock= padlock .endif _pccard= pccard _rdma= rdma +_s3= s3 _safe= safe _scsi_low= scsi_low _smbfs= smbfs From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 07:08:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0466A106566B; Mon, 21 Sep 2009 07:08:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E55F18FC1E; Mon, 21 Sep 2009 07:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L78KRY079299; Mon, 21 Sep 2009 07:08:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L78K7o079293; Mon, 21 Sep 2009 07:08:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210708.n8L78K7o079293@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 07:08: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: r197380 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 07:08:22 -0000 Author: delphij Date: Mon Sep 21 07:08:20 2009 New Revision: 197380 URL: http://svn.freebsd.org/changeset/base/197380 Log: Automatically depend on x86emu when vesa or dpms is being built into kernel. With this change the user no longer need to remember building this option. Submitted by: swell.k at gmail.com Modified: head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Sep 21 07:05:48 2009 (r197379) +++ head/sys/amd64/conf/NOTES Mon Sep 21 07:08:20 2009 (r197380) @@ -154,7 +154,7 @@ options AGP_DEBUG ##################################################################### # HARDWARE DEVICE CONFIGURATION -# To include support for VGA VESA video modes (depends on X86EMU) +# To include support for VGA VESA video modes options VESA # Turn on extra debugging checks and output for VESA support. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 21 07:05:48 2009 (r197379) +++ head/sys/conf/files Mon Sep 21 07:08:20 2009 (r197380) @@ -841,6 +841,35 @@ dev/drm/mga_irq.c optional mgadrm dev/drm/mga_state.c optional mgadrm \ compile-with "${NORMAL_C} -finline-limit=13500" dev/drm/mga_warp.c optional mgadrm +dev/drm/nouveau_dma.c optional nouveaudrm +dev/drm/nouveau_drv.c optional nouveaudrm +dev/drm/nouveau_fence.c optional nouveaudrm +dev/drm/nouveau_fifo.c optional nouveaudrm +dev/drm/nouveau_irq.c optional nouveaudrm +dev/drm/nouveau_mem.c optional nouveaudrm +dev/drm/nouveau_notifier.c optional nouveaudrm +dev/drm/nouveau_object.c optional nouveaudrm +dev/drm/nouveau_sgdma.c optional nouveaudrm +dev/drm/nouveau_state.c optional nouveaudrm +dev/drm/nouveau_swmthd.c optional nouveaudrm +dev/drm/nv04_fb.c optional nouveaudrm +dev/drm/nv04_fifo.c optional nouveaudrm +dev/drm/nv04_graph.c optional nouveaudrm +dev/drm/nv04_instmem.c optional nouveaudrm +dev/drm/nv04_mc.c optional nouveaudrm +dev/drm/nv04_timer.c optional nouveaudrm +dev/drm/nv10_fb.c optional nouveaudrm +dev/drm/nv10_fifo.c optional nouveaudrm +dev/drm/nv10_graph.c optional nouveaudrm +dev/drm/nv20_graph.c optional nouveaudrm +dev/drm/nv40_fb.c optional nouveaudrm +dev/drm/nv40_fifo.c optional nouveaudrm +dev/drm/nv40_graph.c optional nouveaudrm +dev/drm/nv40_mc.c optional nouveaudrm +dev/drm/nv50_fifo.c optional nouveaudrm +dev/drm/nv50_graph.c optional nouveaudrm +dev/drm/nv50_instmem.c optional nouveaudrm +dev/drm/nv50_mc.c optional nouveaudrm dev/drm/r128_cce.c optional r128drm dev/drm/r128_drv.c optional r128drm dev/drm/r128_irq.c optional r128drm @@ -2828,6 +2857,6 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci dev/xen/xenpci/machine_reboot.c optional xenpci -contrib/x86emu/x86emu.c optional x86emu -contrib/x86emu/x86emu_util.c optional x86emu +contrib/x86emu/x86emu.c optional x86emu | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86emu | dpms | vesa Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Sep 21 07:05:48 2009 (r197379) +++ head/sys/conf/files.amd64 Mon Sep 21 07:08:20 2009 (r197380) @@ -162,7 +162,7 @@ dev/atkbdc/atkbdc_subr.c optional atkbdc dev/atkbdc/psm.c optional psm atkbdc dev/coretemp/coretemp.c optional coretemp dev/cpuctl/cpuctl.c optional cpuctl -dev/dpms/dpms.c optional dpms x86emu +dev/dpms/dpms.c optional dpms # There are no systems with isa slots, so all ed isa entries should go.. dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa @@ -171,7 +171,7 @@ dev/ed/if_ed_hpp.c optional ed isa ed_h dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb | vga dev/fb/s3_pci.c optional s3pci -dev/fb/vesa.c optional vga vesa x86emu +dev/fb/vesa.c optional vga vesa dev/fb/vga.c optional vga dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis @@ -220,7 +220,7 @@ dev/sio/sio_puc.c optional sio puc dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc -dev/syscons/scvesactl.c optional sc vga vesa x86emu +dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_amd64.c optional uart Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Sep 21 07:05:48 2009 (r197379) +++ head/sys/conf/files.i386 Mon Sep 21 07:08:20 2009 (r197380) @@ -150,7 +150,7 @@ dev/ctau/if_ct.c optional ctau dev/cx/csigma.c optional cx dev/cx/cxddk.c optional cx dev/cx/if_cx.c optional cx -dev/dpms/dpms.c optional dpms x86emu +dev/dpms/dpms.c optional dpms dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa @@ -158,7 +158,7 @@ dev/ed/if_ed_hpp.c optional ed isa ed_h dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb | vga dev/fb/s3_pci.c optional s3pci -dev/fb/vesa.c optional vga vesa x86emu +dev/fb/vesa.c optional vga vesa dev/fb/vga.c optional vga dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc @@ -220,7 +220,7 @@ dev/sio/sio_puc.c optional sio puc dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc -dev/syscons/scvesactl.c optional sc vga vesa x86emu +dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_i386.c optional uart Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Sep 21 07:05:48 2009 (r197379) +++ head/sys/i386/conf/NOTES Mon Sep 21 07:08:20 2009 (r197380) @@ -353,7 +353,7 @@ options AGP_DEBUG ##################################################################### # HARDWARE DEVICE CONFIGURATION -# To include support for VGA VESA video modes (depends on X86EMU) +# To include support for VGA VESA video modes options VESA # Turn on extra debugging checks and output for VESA support. From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 07:13:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3A1106568F; Mon, 21 Sep 2009 07:13:14 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDDD8FC28; Mon, 21 Sep 2009 07:13:12 +0000 (UTC) Received: by ewy4 with SMTP id 4so2172754ewy.36 for ; Mon, 21 Sep 2009 00:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=nAX9Cx+MKx5Cv50Zli2FHiQgPSkP5qDDyjvRnLTeOLE=; b=U5Bo5Qljm9gvLAWvGIagwP8BbdrRH+SPK8Ti1Pm2LwwHYZo9R1SuVx5F9/vM92HElO Dyre6W6Yadv3m+SFeEQ7J8aScaArVFDNnWuhipHq4+fPGdSV4hnIkE20LTn/MJ5VTvYl s+1pJzhMY+h+sjhXJQL9hV8TwrKiuspAwCyYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=jYM6begjhecjz5722jaEmId3Joj/pvfdOitYZ0KZZq+P9VVmMUiBdJphmDxVLfO2j4 JU0JsX1r3Tf3qW+jJ3rMaGgnPoIVaXozzN9Y8vvEWSHP1oJaweDWB51JRsSAvyYHfJ1z sfj9Ubal+A3sOSPPzrTvS6ty6W+QE2jThOD8s= Received: by 10.210.9.7 with SMTP id 7mr5250244ebi.5.1253517192323; Mon, 21 Sep 2009 00:13:12 -0700 (PDT) Received: from localhost (95-24-211-3.broadband.corbina.ru [95.24.211.3]) by mx.google.com with ESMTPS id 28sm1456426eye.30.2009.09.21.00.13.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Sep 2009 00:13:10 -0700 (PDT) From: Anonymous To: Xin LI References: <200909210708.n8L78K7o079293@svn.freebsd.org> Date: Mon, 21 Sep 2009 11:13:07 +0400 In-Reply-To: <200909210708.n8L78K7o079293@svn.freebsd.org> (Xin LI's message of "Mon, 21 Sep 2009 07:08:20 +0000 (UTC)") Message-ID: <868wg8n530.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197380 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 07:13:14 -0000 Xin LI writes: > Author: delphij > Date: Mon Sep 21 07:08:20 2009 > New Revision: 197380 > URL: http://svn.freebsd.org/changeset/base/197380 > > Log: > Automatically depend on x86emu when vesa or dpms is being built into > kernel. With this change the user no longer need to remember building > this option. > > Submitted by: swell.k at gmail.com > > Modified: > head/sys/amd64/conf/NOTES > head/sys/conf/files > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/i386/conf/NOTES > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Mon Sep 21 07:05:48 2009 (r197379) > +++ head/sys/conf/files Mon Sep 21 07:08:20 2009 (r197380) > @@ -841,6 +841,35 @@ dev/drm/mga_irq.c optional mgadrm > dev/drm/mga_state.c optional mgadrm \ > compile-with "${NORMAL_C} -finline-limit=13500" > dev/drm/mga_warp.c optional mgadrm > +dev/drm/nouveau_dma.c optional nouveaudrm > +dev/drm/nouveau_drv.c optional nouveaudrm > +dev/drm/nouveau_fence.c optional nouveaudrm > +dev/drm/nouveau_fifo.c optional nouveaudrm > +dev/drm/nouveau_irq.c optional nouveaudrm > +dev/drm/nouveau_mem.c optional nouveaudrm > +dev/drm/nouveau_notifier.c optional nouveaudrm > +dev/drm/nouveau_object.c optional nouveaudrm > +dev/drm/nouveau_sgdma.c optional nouveaudrm > +dev/drm/nouveau_state.c optional nouveaudrm > +dev/drm/nouveau_swmthd.c optional nouveaudrm > +dev/drm/nv04_fb.c optional nouveaudrm > +dev/drm/nv04_fifo.c optional nouveaudrm > +dev/drm/nv04_graph.c optional nouveaudrm > +dev/drm/nv04_instmem.c optional nouveaudrm > +dev/drm/nv04_mc.c optional nouveaudrm > +dev/drm/nv04_timer.c optional nouveaudrm > +dev/drm/nv10_fb.c optional nouveaudrm > +dev/drm/nv10_fifo.c optional nouveaudrm > +dev/drm/nv10_graph.c optional nouveaudrm > +dev/drm/nv20_graph.c optional nouveaudrm > +dev/drm/nv40_fb.c optional nouveaudrm > +dev/drm/nv40_fifo.c optional nouveaudrm > +dev/drm/nv40_graph.c optional nouveaudrm > +dev/drm/nv40_mc.c optional nouveaudrm > +dev/drm/nv50_fifo.c optional nouveaudrm > +dev/drm/nv50_graph.c optional nouveaudrm > +dev/drm/nv50_instmem.c optional nouveaudrm > +dev/drm/nv50_mc.c optional nouveaudrm > dev/drm/r128_cce.c optional r128drm > dev/drm/r128_drv.c optional r128drm > dev/drm/r128_irq.c optional r128drm Above change (nouveaudrm) was not in my diff. Where did you pick that from? From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 07:38:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41D061065679; Mon, 21 Sep 2009 07:38:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30CA08FC0C; Mon, 21 Sep 2009 07:38:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L7cpgG079930; Mon, 21 Sep 2009 07:38:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L7cpwI079928; Mon, 21 Sep 2009 07:38:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210738.n8L7cpwI079928@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 07:38: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: r197381 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 07:38:51 -0000 Author: delphij Date: Mon Sep 21 07:38:50 2009 New Revision: 197381 URL: http://svn.freebsd.org/changeset/base/197381 Log: Revert part that should not be in my previous commit. Pointy hat to: delphij Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 21 07:08:20 2009 (r197380) +++ head/sys/conf/files Mon Sep 21 07:38:50 2009 (r197381) @@ -841,35 +841,6 @@ dev/drm/mga_irq.c optional mgadrm dev/drm/mga_state.c optional mgadrm \ compile-with "${NORMAL_C} -finline-limit=13500" dev/drm/mga_warp.c optional mgadrm -dev/drm/nouveau_dma.c optional nouveaudrm -dev/drm/nouveau_drv.c optional nouveaudrm -dev/drm/nouveau_fence.c optional nouveaudrm -dev/drm/nouveau_fifo.c optional nouveaudrm -dev/drm/nouveau_irq.c optional nouveaudrm -dev/drm/nouveau_mem.c optional nouveaudrm -dev/drm/nouveau_notifier.c optional nouveaudrm -dev/drm/nouveau_object.c optional nouveaudrm -dev/drm/nouveau_sgdma.c optional nouveaudrm -dev/drm/nouveau_state.c optional nouveaudrm -dev/drm/nouveau_swmthd.c optional nouveaudrm -dev/drm/nv04_fb.c optional nouveaudrm -dev/drm/nv04_fifo.c optional nouveaudrm -dev/drm/nv04_graph.c optional nouveaudrm -dev/drm/nv04_instmem.c optional nouveaudrm -dev/drm/nv04_mc.c optional nouveaudrm -dev/drm/nv04_timer.c optional nouveaudrm -dev/drm/nv10_fb.c optional nouveaudrm -dev/drm/nv10_fifo.c optional nouveaudrm -dev/drm/nv10_graph.c optional nouveaudrm -dev/drm/nv20_graph.c optional nouveaudrm -dev/drm/nv40_fb.c optional nouveaudrm -dev/drm/nv40_fifo.c optional nouveaudrm -dev/drm/nv40_graph.c optional nouveaudrm -dev/drm/nv40_mc.c optional nouveaudrm -dev/drm/nv50_fifo.c optional nouveaudrm -dev/drm/nv50_graph.c optional nouveaudrm -dev/drm/nv50_instmem.c optional nouveaudrm -dev/drm/nv50_mc.c optional nouveaudrm dev/drm/r128_cce.c optional r128drm dev/drm/r128_drv.c optional r128drm dev/drm/r128_irq.c optional r128drm From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 07:39:41 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ADCA106568B; Mon, 21 Sep 2009 07:39:41 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 027F68FC1E; Mon, 21 Sep 2009 07:39:41 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 301845C025; Mon, 21 Sep 2009 15:39:40 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id D9D8855CE0F7; Mon, 21 Sep 2009 15:39:39 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 6VCLv7ud4H5u; Mon, 21 Sep 2009 15:39:35 +0800 (CST) Received: from charlie.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 2B30055CE0F6; Mon, 21 Sep 2009 15:39:32 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=cgqLx3geXG7qSUgOXs3R43Y5DLq+xf7G2x0RMoAokjVZ6pdl/SoIEWjjNAwdytGoy oMnRBxKsxz/yQqTicDA0w== Message-ID: <4AB72DB2.5000509@delphij.net> Date: Mon, 21 Sep 2009 00:39:30 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Anonymous References: <200909210708.n8L78K7o079293@svn.freebsd.org> <868wg8n530.fsf@gmail.com> In-Reply-To: <868wg8n530.fsf@gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r197380 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 07:39:41 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Anonymous wrote: [...] > Above change (nouveaudrm) was not in my diff. > Where did you pick that from? Sorry, I have committed on the wrong tree. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkq3LbIACgkQi+vbBBjt66DYkwCgmZOq06Q7teZXnl4yWLoKNN/5 OSsAoJUvkFq8SUzekyuYyMxSHG3iBIh+ =DthE -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:17:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00010106566B; Mon, 21 Sep 2009 08:17:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0BB58FC14; Mon, 21 Sep 2009 08:17:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L8HvTL080712; Mon, 21 Sep 2009 08:17:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L8HvP3080703; Mon, 21 Sep 2009 08:17:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210817.n8L8HvP3080703@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 08:17: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: r197383 - in head/sys: conf contrib/x86emu dev/dpms dev/fb dev/x86bios modules modules/x86bios modules/x86emu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:17:58 -0000 Author: delphij Date: Mon Sep 21 08:17:57 2009 New Revision: 197383 URL: http://svn.freebsd.org/changeset/base/197383 Log: Collapase interrupt supporting functions to a new module, and switch from x86emu to this new module. This changeset also brings a fix for bugs introduced with the initial x86emu commit, which prevents the user from using some display mode or cause instant reboots during mode switch. Submitted by: paradox Added: head/sys/dev/x86bios/ head/sys/dev/x86bios/x86bios.c (contents, props changed) head/sys/dev/x86bios/x86bios.h (contents, props changed) head/sys/dev/x86bios/x86bios_alloc.c (contents, props changed) head/sys/modules/x86bios/ head/sys/modules/x86bios/Makefile (contents, props changed) Deleted: head/sys/modules/x86emu/Makefile Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/contrib/x86emu/x86emu.c head/sys/dev/dpms/dpms.c head/sys/dev/fb/vesa.c head/sys/modules/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Sep 21 07:50:57 2009 (r197382) +++ head/sys/conf/NOTES Mon Sep 21 08:17:57 2009 (r197383) @@ -2758,4 +2758,4 @@ options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 # x86 real mode emulator -options X86EMU +options X86BIOS Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 21 07:50:57 2009 (r197382) +++ head/sys/conf/files Mon Sep 21 08:17:57 2009 (r197383) @@ -2828,6 +2828,8 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci dev/xen/xenpci/machine_reboot.c optional xenpci -contrib/x86emu/x86emu.c optional x86emu | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86emu | dpms | vesa +dev/x86bios/x86bios.c optional x86bios | dpms | vesa +dev/x86bios/x86bios_alloc.c optional x86bios | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | dpms | vesa Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Sep 21 07:50:57 2009 (r197382) +++ head/sys/conf/options Mon Sep 21 08:17:57 2009 (r197383) @@ -838,4 +838,4 @@ SND_FEEDER_RATE_HP opt_snd.h SND_PCM_64 opt_snd.h SND_OLDSTEREO opt_snd.h -X86EMU +X86BIOS Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Mon Sep 21 07:50:57 2009 (r197382) +++ head/sys/contrib/x86emu/x86emu.c Mon Sep 21 08:17:57 2009 (r197383) @@ -33,10 +33,6 @@ * */ -#include -#include -#include - #include #include @@ -8335,32 +8331,3 @@ pop_long(struct x86emu *emu) emu->x86.R_SP += 4; return res; } - -static int -x86emu_modevent(module_t mod __unused, int type, void *data __unused) -{ - int err = 0; - - switch (type) { - case MOD_LOAD: - break; - - case MOD_UNLOAD: - break; - - default: - err = ENOTSUP; - break; - - } - return (err); -} - -static moduledata_t x86emu_mod = { - "x86emu", - x86emu_modevent, - NULL, -}; - -DECLARE_MODULE(x86emu, x86emu_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); -MODULE_VERSION(x86emu, 1); Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Mon Sep 21 07:50:57 2009 (r197382) +++ head/sys/dev/dpms/dpms.c Mon Sep 21 08:17:57 2009 (r197383) @@ -67,11 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - -#include -#include +#include /* * VESA DPMS States @@ -94,9 +90,6 @@ struct dpms_softc { int dpms_initial_state; }; -static struct x86emu vesa_emu; -static unsigned char *emumem = NULL; - static int dpms_attach(device_t); static int dpms_detach(device_t); static int dpms_get_supported_states(int *); @@ -126,59 +119,7 @@ static driver_t dpms_driver = { static devclass_t dpms_devclass; DRIVER_MODULE(dpms, vgapci, dpms_driver, dpms_devclass, NULL, NULL); -MODULE_DEPEND(dpms, x86emu, 1, 1, 1); - -static uint8_t -vm86_emu_inb(struct x86emu *emu, uint16_t port) -{ - if (port == 0xb2) /* APM scratch register */ - return 0; - if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inb(port); -} - -static uint16_t -vm86_emu_inw(struct x86emu *emu, uint16_t port) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inw(port); -} - -static uint32_t -vm86_emu_inl(struct x86emu *emu, uint16_t port) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inl(port); -} - -static void -vm86_emu_outb(struct x86emu *emu, uint16_t port, uint8_t val) -{ - if (port == 0xb2) /* APM scratch register */ - return; - if (port >= 0x80 && port < 0x88) /* POST status register */ - return; - outb(port, val); -} - -static void -vm86_emu_outw(struct x86emu *emu, uint16_t port, uint16_t val) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return; - outw(port, val); -} - -static void -vm86_emu_outl(struct x86emu *emu, uint16_t port, uint32_t val) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return; - outl(port, val); -} +MODULE_DEPEND(dpms, x86bios, 1, 1, 1); static void dpms_identify(driver_t *driver, device_t parent) @@ -192,7 +133,6 @@ dpms_identify(driver_t *driver, device_t */ if (devclass_get_device(dpms_devclass, 0) == NULL) device_add_child(parent, "dpms", 0); - } static int @@ -200,21 +140,6 @@ dpms_probe(device_t dev) { int error, states; - emumem = pmap_mapbios(0x0, 0xc00000); - - memset(&vesa_emu, 0, sizeof(vesa_emu)); - x86emu_init_default(&vesa_emu); - - vesa_emu.emu_inb = vm86_emu_inb; - vesa_emu.emu_inw = vm86_emu_inw; - vesa_emu.emu_inl = vm86_emu_inl; - vesa_emu.emu_outb = vm86_emu_outb; - vesa_emu.emu_outw = vm86_emu_outw; - vesa_emu.emu_outl = vm86_emu_outl; - - vesa_emu.mem_base = (char *)emumem; - vesa_emu.mem_size = 1024 * 1024; - error = dpms_get_supported_states(&states); if (error) return (error); @@ -240,8 +165,6 @@ dpms_attach(device_t dev) static int dpms_detach(device_t dev) { - if (emumem) - pmap_unmapdev((vm_offset_t)emumem, 0xc00000); return (0); } @@ -267,17 +190,19 @@ dpms_resume(device_t dev) static int dpms_call_bios(int subfunction, int *bh) { - vesa_emu.x86.R_AX = VBE_DPMS_FUNCTION; - vesa_emu.x86.R_BL = subfunction; - vesa_emu.x86.R_BH = *bh; - vesa_emu.x86.R_ES = 0; - vesa_emu.x86.R_DI = 0; - x86emu_exec_intr(&vesa_emu, 0x10); + x86regs_t regs; + + regs.R_AX = VBE_DPMS_FUNCTION; + regs.R_BL = subfunction; + regs.R_BH = *bh; + regs.R_ES = 0; + regs.R_DI = 0; + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_EAX & 0xffff) != 0x004f) + if ((regs.R_EAX & 0xffff) != 0x004f) return (ENXIO); - *bh = vesa_emu.x86.R_BH; + *bh = regs.R_BH; return (0); } Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Mon Sep 21 07:50:57 2009 (r197382) +++ head/sys/dev/fb/vesa.c Mon Sep 21 08:17:57 2009 (r197383) @@ -45,16 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include -#include -#include +#include #define VESA_VIA_CLE266 "VIA CLE266\r\n" @@ -73,7 +72,7 @@ typedef struct adp_state adp_state_t; /* VESA video adapter */ static video_adapter_t *vesa_adp = NULL; static int vesa_state_buf_size = 0; -#define VESA_X86EMU_BUFSIZE (3 * PAGE_SIZE) +#define VESA_BIOS_BUFSIZE (3 * PAGE_SIZE) /* VESA functions */ #if 0 @@ -106,8 +105,6 @@ static vi_bitblt_t vesa_bitblt; static vi_diag_t vesa_diag; static int vesa_bios_info(int level); -static struct x86emu vesa_emu; - static video_switch_t vesavidsw = { vesa_probe, vesa_init, @@ -206,77 +203,6 @@ static void vesa_unmap_buffer(vm_offset_ static int vesa_get_origin(video_adapter_t *adp, off_t *offset); #endif -#define SEG_ADDR(x) (((x) >> 4) & 0x00F000) -#define SEG_OFF(x) ((x) & 0x0FFFF) - -#if _BYTE_ORDER == _LITTLE_ENDIAN -#define B_O16(x) (x) -#define B_O32(x) (x) -#else -#define B_O16(x) ((((x) & 0xff) << 8) | (((x) & 0xff) >> 8)) -#define B_O32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) \ - | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24)) -#endif - -#define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00) -#define FARP(p) (((unsigned)(p & 0xffff0000) >> 12) | (p & 0xffff)) - -#define REALOFF(x) (x*4096) - -static unsigned char *emumem = NULL; - -static uint8_t -vm86_emu_inb(struct x86emu *emu, uint16_t port) -{ - if (port == 0xb2) /* APM scratch register */ - return 0; - if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inb(port); -} - -static uint16_t -vm86_emu_inw(struct x86emu *emu, uint16_t port) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inw(port); -} - -static uint32_t -vm86_emu_inl(struct x86emu *emu, uint16_t port) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inl(port); -} - -static void -vm86_emu_outb(struct x86emu *emu, uint16_t port, uint8_t val) -{ - if (port == 0xb2) /* APM scratch register */ - return; - if (port >= 0x80 && port < 0x88) /* POST status register */ - return; - outb(port, val); -} - -static void -vm86_emu_outw(struct x86emu *emu, uint16_t port, uint16_t val) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return; - outw(port, val); -} - -static void -vm86_emu_outl(struct x86emu *emu, uint16_t port, uint32_t val) -{ - if (port >= 0x80 && port < 0x88) /* POST status register */ - return; - outl(port, val); -} - static void dump_buffer(u_char *buf, size_t len) { @@ -293,8 +219,11 @@ dump_buffer(u_char *buf, size_t len) static int int10_set_mode(int mode) { - vesa_emu.x86.R_EAX = 0x0000 | mode; - x86emu_exec_intr(&vesa_emu, 0x10); + x86regs_t regs; + + regs.R_EAX = 0x0000 | mode; + + x86biosCall(®s, 0x10); return 0; } @@ -303,21 +232,28 @@ int10_set_mode(int mode) static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode) { + x86regs_t regs; + int offs; u_char *buf; - vesa_emu.x86.R_EAX = 0x4f01; - vesa_emu.x86.R_ECX = mode; + regs.R_EAX = 0x4f01; + regs.R_ECX = mode; + + buf = (u_char *)x86biosAlloc(1, &offs); - buf = (emumem + REALOFF(3)); - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(3)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(3)); + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) + { + x86biosFree(buf, 1); return 1; + } bcopy(buf, vmode, sizeof(*vmode)); + x86biosFree(buf, 1); return 0; } @@ -325,62 +261,73 @@ vesa_bios_get_mode(int mode, struct vesa static int vesa_bios_set_mode(int mode) { - vesa_emu.x86.R_EAX = 0x4f02; - vesa_emu.x86.R_EBX = mode; + x86regs_t regs; + + regs.R_EAX = 0x4f02; + regs.R_EBX = mode; - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - return ((vesa_emu.x86.R_AX & 0xff) != 0x4f); + return ((regs.R_AX & 0xff) != 0x4f); } static int vesa_bios_get_dac(void) { - vesa_emu.x86.R_EAX = 0x4f08; - vesa_emu.x86.R_EBX = 1; + x86regs_t regs; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f08; + regs.R_EBX = 1; - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + x86biosCall(®s, 0x10); + + if ((regs.R_AX & 0xff) != 0x4f) return 6; - return ((vesa_emu.x86.R_EBX >> 8) & 0x00ff); + return ((regs.R_EBX >> 8) & 0x00ff); } static int vesa_bios_set_dac(int bits) { - vesa_emu.x86.R_EAX = 0x4f08; - vesa_emu.x86.R_EBX = (bits << 8); + x86regs_t regs; + + regs.R_EAX = 0x4f08; + regs.R_EBX = (bits << 8); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) return 6; - return ((vesa_emu.x86.R_EBX >> 8) & 0x00ff); + return ((regs.R_EBX >> 8) & 0x00ff); } static int vesa_bios_save_palette(int start, int colors, u_char *palette, int bits) { + x86regs_t regs; + int offs; u_char *p; int i; - vesa_emu.x86.R_EAX = 0x4f09; - vesa_emu.x86.R_EBX = 1; - vesa_emu.x86.R_ECX = colors; - vesa_emu.x86.R_EDX = start; + regs.R_EAX = 0x4f09; + regs.R_EBX = 1; + regs.R_ECX = colors; + regs.R_EDX = start; - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(2)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(2)); + p = (u_char *)x86biosAlloc(1, &offs); - p = emumem + REALOFF(2); + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) + { + x86biosFree(p, 1); return 1; + } bits = 8 - bits; for (i = 0; i < colors; ++i) { @@ -388,6 +335,8 @@ vesa_bios_save_palette(int start, int co palette[i*3 + 1] = p[i*4 + 1] << bits; palette[i*3 + 2] = p[i*4] << bits; } + + x86biosFree(p, 1); return 0; } @@ -395,23 +344,28 @@ static int vesa_bios_save_palette2(int start, int colors, u_char *r, u_char *g, u_char *b, int bits) { + x86regs_t regs; + int offs; u_char *p; int i; - vesa_emu.x86.R_EAX = 0x4f09; - vesa_emu.x86.R_EBX = 1; - vesa_emu.x86.R_ECX = colors; - vesa_emu.x86.R_EDX = start; + regs.R_EAX = 0x4f09; + regs.R_EBX = 1; + regs.R_ECX = colors; + regs.R_EDX = start; - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(2)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(2)); + p = (u_char *)x86biosAlloc(1, &offs); - p = emumem + REALOFF(2); + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) + { + x86biosFree(p, 1); return 1; + } bits = 8 - bits; for (i = 0; i < colors; ++i) { @@ -419,16 +373,20 @@ vesa_bios_save_palette2(int start, int c g[i] = p[i*4 + 1] << bits; b[i] = p[i*4] << bits; } + + x86biosFree(p, 1); return 0; } static int vesa_bios_load_palette(int start, int colors, u_char *palette, int bits) { + x86regs_t regs; + int offs; u_char *p; int i; - p = (emumem + REALOFF(2)); + p = (u_char *)x86biosAlloc(1, &offs); bits = 8 - bits; for (i = 0; i < colors; ++i) { @@ -438,17 +396,19 @@ vesa_bios_load_palette(int start, int co p[i*4 + 3] = 0; } - vesa_emu.x86.R_EAX = 0x4f09; - vesa_emu.x86.R_EBX = 0; - vesa_emu.x86.R_ECX = colors; - vesa_emu.x86.R_EDX = start; + regs.R_EAX = 0x4f09; + regs.R_EBX = 0; + regs.R_ECX = colors; + regs.R_EDX = start; - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(2)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(2)); + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - return ((vesa_emu.x86.R_AX & 0xff) != 0x4f); + x86biosFree(p, 1); + + return ((regs.R_AX & 0xff) != 0x4f); } #ifdef notyet @@ -456,10 +416,12 @@ static int vesa_bios_load_palette2(int start, int colors, u_char *r, u_char *g, u_char *b, int bits) { + x86regs_t regs; + int offs; u_char *p; int i; - p = (emumem + REALOFF(2)); + p = (u_char *)x86biosAlloc(1, &offs); bits = 8 - bits; for (i = 0; i < colors; ++i) { @@ -469,93 +431,106 @@ vesa_bios_load_palette2(int start, int c p[i*4 + 3] = 0; } - vesa_emu.x86.R_EAX = 0x4f09; - vesa_emu.x86.R_EBX = 0; - vesa_emu.x86.R_ECX = colors; - vesa_emu.x86.R_EDX = start; + regs.R_EAX = 0x4f09; + regs.R_EBX = 0; + regs.R_ECX = colors; + regs.R_EDX = start; + + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(2)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(2)); + x86biosCall(®s, 0x10); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosFree(p, 1); - return ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + return ((regs.R_AX & 0xff) != 0x4f); } #endif static int vesa_bios_state_buf_size(void) { - vesa_emu.x86.R_EAX = 0x4f04; - vesa_emu.x86.R_ECX = STATE_ALL; - vesa_emu.x86.R_EDX = STATE_SIZE; + x86regs_t regs; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f04; + regs.R_ECX = STATE_ALL; + regs.R_EDX = STATE_SIZE; - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + x86biosCall(®s, 0x10); + + if ((regs.R_AX & 0xff) != 0x4f) return 0; - return vesa_emu.x86.R_BX*64; + return regs.R_BX*64; } static int vesa_bios_save_restore(int code, void *p, size_t size) { + x86regs_t regs; + int offs; u_char *buf; - if (size > VESA_X86EMU_BUFSIZE) + if (size > VESA_BIOS_BUFSIZE) return (1); - vesa_emu.x86.R_EAX = 0x4f04; - vesa_emu.x86.R_ECX = STATE_ALL; - vesa_emu.x86.R_EDX = code; + regs.R_EAX = 0x4f04; + regs.R_ECX = STATE_ALL; + regs.R_EDX = code; - buf = emumem + REALOFF(2); + buf = (u_char *)x86biosAlloc(1, &offs); - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(2)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(2)); + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); bcopy(p, buf, size); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); bcopy(buf, p, size); - return ((vesa_emu.x86.R_AX & 0xff) != 0x4f); + x86biosFree(p, 1); + + return ((regs.R_AX & 0xff) != 0x4f); } static int vesa_bios_get_line_length(void) { - vesa_emu.x86.R_EAX = 0x4f06; - vesa_emu.x86.R_EBX = 1; + x86regs_t regs; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f06; + regs.R_EBX = 1; - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + x86biosCall(®s, 0x10); + + if ((regs.R_AX & 0xff) != 0x4f) return -1; - return vesa_emu.x86.R_BX; + + return regs.R_BX; } static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines) { - vesa_emu.x86.R_EAX = 0x4f06; - vesa_emu.x86.R_EBX = 0; - vesa_emu.x86.R_ECX = pixel; + x86regs_t regs; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f06; + regs.R_EBX = 0; + regs.R_ECX = pixel; + + x86biosCall(®s, 0x10); #if VESA_DEBUG > 1 - printf("bx:%d, cx:%d, dx:%d\n", vesa_emu.x86.R_BX, vesa_emu.x86.R_CX, vesa_emu.x86.R_DX); + printf("bx:%d, cx:%d, dx:%d\n", regs.R_BX, regs.R_CX, regs.R_DX); #endif - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) return -1; if (bytes) - *bytes = vesa_emu.x86.R_BX; + *bytes = regs.R_BX; if (lines) - *lines = vesa_emu.x86.R_DX; + *lines = regs.R_DX; return 0; } @@ -564,16 +539,18 @@ vesa_bios_set_line_length(int pixel, int static int vesa_bios_get_start(int *x, int *y) { - vesa_emu.x86.R_EAX = 0x4f07; - vesa_emu.x86.R_EBX = 1; + x86regs_t regs; + + regs.R_EAX = 0x4f07; + regs.R_EBX = 1; - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) return -1; - *x = vesa_emu.x86.R_CX; - *y = vesa_emu.x86.R_DX; + *x = regs.R_CX; + *y = regs.R_DX; return 0; } @@ -582,14 +559,16 @@ vesa_bios_get_start(int *x, int *y) static int vesa_bios_set_start(int x, int y) { - vesa_emu.x86.R_EAX = 0x4f07; - vesa_emu.x86.R_EBX = 0x80; - vesa_emu.x86.R_EDX = y; - vesa_emu.x86.R_ECX = x; + x86regs_t regs; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f07; + regs.R_EBX = 0x80; + regs.R_EDX = y; + regs.R_ECX = x; - return ((vesa_emu.x86.R_AX & 0xff) != 0x4f); + x86biosCall(®s, 0x10); + + return ((regs.R_AX & 0xff) != 0x4f); } /* map a generic video mode to a known mode */ @@ -665,6 +644,8 @@ vesa_bios_init(void) static struct vesa_info buf; struct vesa_mode vmode; video_info_t *p; + x86regs_t regs; + int offs; u_char *vmbuf; int is_via_cle266; int modes; @@ -678,16 +659,16 @@ vesa_bios_init(void) vesa_vmode_max = 0; vesa_vmode[0].vi_mode = EOT; - vmbuf = (emumem + REALOFF(2)); + vmbuf = (u_char *)x86biosAlloc(1, &offs); bcopy("VBE2", vmbuf, 4); /* try for VBE2 data */ - vesa_emu.x86.R_EAX = 0x4f00; - vesa_emu.x86.R_ES = SEG_ADDR(REALOFF(2)); - vesa_emu.x86.R_DI = SEG_OFF(REALOFF(2)); + regs.R_EAX = 0x4f00; + regs.R_ES = SEG_ADDR(offs); + regs.R_DI = SEG_OFF(offs); - x86emu_exec_intr(&vesa_emu, 0x10); + x86biosCall(®s, 0x10); - if (((vesa_emu.x86.R_AX & 0xff) != 0x4f) || bcmp("VESA", vmbuf, 4)) + if (((regs.R_AX & 0xff) != 0x4f) || bcmp("VESA", vmbuf, 4)) return 1; bcopy(vmbuf, &buf, sizeof(buf)); @@ -707,17 +688,17 @@ vesa_bios_init(void) return 1; } - vesa_oemstr = (char *)(emumem + L_ADD(vesa_adp_info->v_oemstr)); + vesa_oemstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_oemstr)); is_via_cle266 = strcmp(vesa_oemstr, VESA_VIA_CLE266) == 0; if (vesa_adp_info->v_version >= 0x0200) { - vesa_venderstr = (char *)(emumem+L_ADD(vesa_adp_info->v_venderstr)); - vesa_prodstr = (char *)(emumem+L_ADD(vesa_adp_info->v_prodstr)); - vesa_revstr = (char *)(emumem+L_ADD(vesa_adp_info->v_revstr)); + vesa_venderstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_venderstr)); + vesa_prodstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_prodstr)); + vesa_revstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_revstr)); } - vesa_vmodetab = (u_int16_t *)(emumem+L_ADD(vesa_adp_info->v_modetable)); + vesa_vmodetab = (u_int16_t *)x86biosOffs(FARP(vesa_adp_info->v_modetable)); if (vesa_vmodetab == NULL) return 1; @@ -802,7 +783,7 @@ vesa_bios_init(void) - vmode.v_lfb; else vesa_vmode[modes].vi_buffer_size - = vmode.v_offscreen + vmode.v_offscreensize*1024 + = vmode.v_offscreen + vmode.v_offscreensize*1024; #endif vesa_vmode[modes].vi_mem_model = vesa_translate_mmodel(vmode.v_memmodel); @@ -843,6 +824,9 @@ vesa_bios_init(void) ++modes; } vesa_vmode[modes].vi_mode = EOT; + + x86biosFree(vmbuf, 1); + if (bootverbose) printf("VESA: %d mode(s) found\n", modes); @@ -1127,7 +1111,7 @@ vesa_set_mode(video_adapter_t *adp, int } else { vesa_adp->va_buffer = 0; vesa_adp->va_buffer_size = info.vi_buffer_size; - vesa_adp->va_window = (vm_offset_t)(emumem+L_ADD(info.vi_window)); + vesa_adp->va_window = BIOS_PADDRTOVADDR(info.vi_window); vesa_adp->va_window_size = info.vi_window_size; vesa_adp->va_window_gran = info.vi_window_gran; } @@ -1276,14 +1260,16 @@ vesa_load_state(video_adapter_t *adp, vo static int vesa_get_origin(video_adapter_t *adp, off_t *offset) { - vesa_emu.x86.R_EAX = 0x4f05; - vesa_emu.x86.R_EBX = 0x10; + x86regs_t regs; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f05; + regs.R_EBX = 0x10; - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + x86biosCall(®s, 0x10); + + if ((regs.R_AX & 0xff) != 0x4f) return 1; - *offset = vesa_emu.x86.DX*adp->va_window_gran; + *offset = regs.DX*adp->va_window_gran; return 0; } @@ -1292,6 +1278,8 @@ vesa_get_origin(video_adapter_t *adp, of static int vesa_set_origin(video_adapter_t *adp, off_t offset) { + x86regs_t regs; + /* * This function should return as quickly as possible to * maintain good performance of the system. For this reason, @@ -1308,18 +1296,18 @@ vesa_set_origin(video_adapter_t *adp, of if (adp->va_window_gran == 0) return 1; - vesa_emu.x86.R_EAX = 0x4f05; - vesa_emu.x86.R_EBX = 0; - vesa_emu.x86.R_EDX = offset/adp->va_window_gran; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f05; + regs.R_EBX = 0; + regs.R_EDX = offset/adp->va_window_gran; + x86biosCall(®s, 0x10); - if ((vesa_emu.x86.R_AX & 0xff) != 0x4f) + if ((regs.R_AX & 0xff) != 0x4f) return 1; - vesa_emu.x86.R_EAX = 0x4f05; - vesa_emu.x86.R_EBX = 1; - vesa_emu.x86.R_EDX = offset/adp->va_window_gran; - x86emu_exec_intr(&vesa_emu, 0x10); + regs.R_EAX = 0x4f05; + regs.R_EBX = 1; + regs.R_EDX = offset/adp->va_window_gran; + x86biosCall(®s, 0x10); adp->va_window_orig = (offset/adp->va_window_gran)*adp->va_window_gran; return 0; /* XXX */ @@ -1654,22 +1642,6 @@ vesa_load(void) if (vesa_init_done) return 0; - /* Can `emumem' be NULL here? */ - emumem = pmap_mapbios(0x0, 0xc00000); - - memset(&vesa_emu, 0, sizeof(vesa_emu)); - x86emu_init_default(&vesa_emu); - - vesa_emu.emu_inb = vm86_emu_inb; - vesa_emu.emu_inw = vm86_emu_inw; - vesa_emu.emu_inl = vm86_emu_inl; - vesa_emu.emu_outb = vm86_emu_outb; - vesa_emu.emu_outw = vm86_emu_outw; - vesa_emu.emu_outl = vm86_emu_outl; - - vesa_emu.mem_base = (char *)emumem; - vesa_emu.mem_size = 1024 * 1024; - /* locate a VGA adapter */ s = spltty(); vesa_adp = NULL; @@ -1717,9 +1689,6 @@ vesa_unload(void) } splx(s); - if (emumem) - pmap_unmapdev((vm_offset_t)emumem, 0xc00000); - return error; } @@ -1744,6 +1713,6 @@ static moduledata_t vesa_mod = { }; DECLARE_MODULE(vesa, vesa_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -MODULE_DEPEND(vesa, x86emu, 1, 1, 1); +MODULE_DEPEND(vesa, x86bios, 1, 1, 1); #endif /* VGA_NO_MODE_CHANGE */ Added: head/sys/dev/x86bios/x86bios.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/x86bios/x86bios.c Mon Sep 21 08:17:57 2009 (r197383) @@ -0,0 +1,218 @@ +/*- + * Written by paradox + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_x86bios.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:24:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 415E7106566B; Mon, 21 Sep 2009 08:24:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA668FC1D; Mon, 21 Sep 2009 08:24:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L8OMqq080885; Mon, 21 Sep 2009 08:24:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L8OMHs080882; Mon, 21 Sep 2009 08:24:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210824.n8L8OMHs080882@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 08:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197384 - in head/sys: conf dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:24:23 -0000 Author: delphij Date: Mon Sep 21 08:24:22 2009 New Revision: 197384 URL: http://svn.freebsd.org/changeset/base/197384 Log: Allow atkbd to obtain keyboard repeat rate from BIOS on amd64. Submitted by: swell.k at gmail.com Modified: head/sys/conf/files head/sys/dev/atkbdc/atkbd.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 21 08:17:57 2009 (r197383) +++ head/sys/conf/files Mon Sep 21 08:24:22 2009 (r197384) @@ -2828,8 +2828,8 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci dev/xen/xenpci/machine_reboot.c optional xenpci -dev/x86bios/x86bios.c optional x86bios | dpms | vesa -dev/x86bios/x86bios_alloc.c optional x86bios | dpms | vesa -contrib/x86emu/x86emu.c optional x86bios | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | dpms | vesa +dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Sep 21 08:17:57 2009 (r197383) +++ head/sys/dev/atkbdc/atkbd.c Mon Sep 21 08:24:22 2009 (r197384) @@ -44,10 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __i386__ +#if defined(__i386__) || defined(__amd64__) #include #include -#include +#include #include #include @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include -#endif /* __i386__ */ +#endif /* __i386__ || __amd64__ */ #include #include @@ -1089,34 +1089,33 @@ atkbd_shutdown_final(void *v) static int get_typematic(keyboard_t *kbd) { -#ifdef __i386__ +#if defined(__i386__) || defined(__amd64__) /* * Only some systems allow us to retrieve the keyboard repeat * rate previously set via the BIOS... */ - struct vm86frame vmf; - u_int32_t p; + x86regs_t regs; + vm_offset_t p; - bzero(&vmf, sizeof(vmf)); - vmf.vmf_ax = 0xc000; - vm86_intcall(0x15, &vmf); - if ((vmf.vmf_eflags & PSL_C) || vmf.vmf_ah) + regs.R_AX = 0xc000; + x86biosCall(®s, 0x15); + if ((regs.R_EFLG & PSL_C) || regs.R_AH) return ENODEV; - p = BIOS_PADDRTOVADDR(((u_int32_t)vmf.vmf_es << 4) + vmf.vmf_bx); + p = BIOS_PADDRTOVADDR((regs.R_ES << 4) + regs.R_BX); if ((readb(p + 6) & 0x40) == 0) /* int 16, function 0x09 supported? */ return ENODEV; - vmf.vmf_ax = 0x0900; - vm86_intcall(0x16, &vmf); - if ((vmf.vmf_al & 0x08) == 0) /* int 16, function 0x0306 supported? */ + regs.R_AX = 0x0900; + x86biosCall(®s, 0x16); + if ((regs.R_AL & 0x08) == 0) /* int 16, function 0x0306 supported? */ return ENODEV; - vmf.vmf_ax = 0x0306; - vm86_intcall(0x16, &vmf); - kbd->kb_delay1 = typematic_delay(vmf.vmf_bh << 5); - kbd->kb_delay2 = typematic_rate(vmf.vmf_bl); + regs.R_AX = 0x0306; + x86biosCall(®s, 0x16); + kbd->kb_delay1 = typematic_delay(regs.R_BH << 5); + kbd->kb_delay2 = typematic_rate(regs.R_BL); return 0; #else return ENODEV; -#endif /* __i386__ */ +#endif /* __i386__ || __amd64__ */ } static int From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:30:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F42C106566B; Mon, 21 Sep 2009 08:30:53 +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 6E1E88FC14; Mon, 21 Sep 2009 08:30:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L8UrnE081050; Mon, 21 Sep 2009 08:30:53 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L8Ur1A081048; Mon, 21 Sep 2009 08:30:53 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200909210830.n8L8Ur1A081048@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 21 Sep 2009 08:30: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: r197385 - head/lib/libjail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:30:53 -0000 Author: ru Date: Mon Sep 21 08:30:52 2009 New Revision: 197385 URL: http://svn.freebsd.org/changeset/base/197385 Log: Fixed markup (mostly) errors. Modified: head/lib/libjail/jail.3 Modified: head/lib/libjail/jail.3 ============================================================================== --- head/lib/libjail/jail.3 Mon Sep 21 08:24:22 2009 (r197384) +++ head/lib/libjail/jail.3 Mon Sep 21 08:30:52 2009 (r197385) @@ -39,7 +39,7 @@ .Nm jailparam_set , .Nm jailparam_get , .Nm jailparam_export , -.Nm jailparam_free , +.Nm jailparam_free .Nd create and manage system jails .Sh LIBRARY .Lb libjail @@ -89,14 +89,16 @@ knowing the parameter formats. The .Fn jail_getid function returns the JID of the jail identified by -.Ar name , +.Fa name , or \-1 if the jail does not exist. .Pp The .Fn jail_getname function returns the name of the jail identified by -.Ar jid , -or NULL if the jail does not exist. +.Fa jid , +or +.Dv NULL +if the jail does not exist. .Pp The .Fn jail_setv @@ -116,7 +118,7 @@ returned parameters. The .Fn jailparam_all function sets -.Ar jpp +.Fa jpp to a list of all known jail parameters, and returns the number of parameters. The list should later be freed with @@ -127,14 +129,15 @@ and The .Fn jailparam_init function clears a parameter record and copies the -.Ar name -to it. After use, it should be freed with +.Fa name +to it. +After use, it should be freed with .Fn jailparam_free . .Pp The .Fn jailparam_import function adds a -.Ar value +.Fa value to a parameter record, converting it from a string to its native form. The .Fn jailparam_import_raw @@ -151,7 +154,7 @@ and .Pp The .Fn jailparam_get -function function passes a list of parameters to +function passes a list of parameters to .Xr jail_get 2 . The parameters are assumed to have been created with .Fn jailparam_init @@ -163,7 +166,7 @@ with one parameter (the key) having been The .Fn jailparam_export function returns the string equivalent of a parameter value. -The returned string should freed after use. +The returned string should be freed after use. .Pp The .Fn jailparam_free @@ -171,6 +174,43 @@ function frees the stored names and valu If the list itself came from .Fn jailparam_all , it should be freed as well. +.Sh RETURN VALUES +The +.Fn jail_getid , +.Fn jail_setv , +.Fn jail_getv , +.Fn jailparam_set +and +.Fn jailparam_get +functions return a JID on success, or \-1 on error. +.Pp +The +.Fn jail_getname +and +.Fn jailparam_export +functions return a dynamically allocated string on success, or +.Dv NULL +on error. +.Pp +The +.Fn jailparam_all +function returns the number of parameters on success, or \-1 on error. +.Pp +The +.Fn jailparam_init , +.Fn jailparam_import +and +.Fn jailparam_import_raw +functions return 0 on success, or \-1 on error. +.Pp +Whenever an error is returned, +.Va errno +is set, and the global string +.Va jail_errmsg +contains a description of the error, possibly from +.Xr jail_set 2 +or +.Xr jail_get 2 . .Sh EXAMPLES Set the hostname of jail .Dq foo @@ -209,41 +249,6 @@ jailparam_get(params, 2, 0); hostname = jailparam_export(¶ms[1]); jailparam_free(params, 2); .Ed -.Sh RETURN VALUES -The -.Fn jail_getid , -.Fn jail_setv , -.Fn jail_getv , -.Fn jailparam_set -and -.Fn jailparam_get -functions return a JID on success, or \-1 on error. -.Pp -The -.Fn jail_getname -and -.Fn jailparam_export -functions return a dynamically allocated string on success, or NULL on error. -.Pp -The -.Fn jailparam_all -function returns the number of parameters on success, or \-1 on error. -.Pp -The -.Fn jailparam_init , -.Fn jailparam_import -and -.Fn jailparam_import_raw -functions return 0 on success, or \-1 on error. -.Pp -Whenever an error is returned, -.Va errno -is set, and the global string -.Va jail_errmsg -contains a descrption of the error, possibly from -.Xr jail_set 2 -or -.Xr jail_get 2 . .Sh ERRORS The .Nm jail @@ -256,16 +261,17 @@ or In addition, the following errors are possible: .Bl -tag -width Er .It Bq Er EINVAL -A prameter value cannot be convert from the passed string to its +A parameter value cannot be converted from the passed string to its internal form. .It Bq Er ENOENT The named parameter does not exist. .It Bq Er ENOENT A parameter is of an unknown type. +.El .Sh SEE ALSO .Xr jail 2 , -.Xr jail 8 , -.Xr sysctl 3 +.Xr sysctl 3 , +.Xr jail 8 .Sh HISTORY The .Nm jail From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:37:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C08F6106566B; Mon, 21 Sep 2009 08:37:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFB288FC12; Mon, 21 Sep 2009 08:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L8bwJt081216; Mon, 21 Sep 2009 08:37:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L8bwgq081215; Mon, 21 Sep 2009 08:37:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210837.n8L8bwgq081215@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 08:37: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: r197386 - head/sys/contrib/x86emu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:37:58 -0000 Author: delphij Date: Mon Sep 21 08:37:57 2009 New Revision: 197386 URL: http://svn.freebsd.org/changeset/base/197386 Log: Use __FBSDID to embed RCS ID. Modified: head/sys/contrib/x86emu/x86emu.c head/sys/contrib/x86emu/x86emu_util.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Mon Sep 21 08:30:52 2009 (r197385) +++ head/sys/contrib/x86emu/x86emu.c Mon Sep 21 08:37:57 2009 (r197386) @@ -1,6 +1,5 @@ /* $OpenBSD: x86emu.c,v 1.4 2009/06/18 14:19:21 pirofti Exp $ */ /* $NetBSD: x86emu.c,v 1.7 2009/02/03 19:26:29 joerg Exp $ */ -/* $FreeBSD$ */ /* * @@ -33,6 +32,9 @@ * */ +#include +__FBSDID("$FreeBSD$"); + #include #include Modified: head/sys/contrib/x86emu/x86emu_util.c ============================================================================== --- head/sys/contrib/x86emu/x86emu_util.c Mon Sep 21 08:30:52 2009 (r197385) +++ head/sys/contrib/x86emu/x86emu_util.c Mon Sep 21 08:37:57 2009 (r197386) @@ -1,6 +1,5 @@ /* $OpenBSD: x86emu_util.c,v 1.5 2009/06/18 14:19:21 pirofti Exp $ */ /* $NetBSD: x86emu_util.c,v 1.2 2007/12/04 17:32:22 joerg Exp $ */ -/* $FreeBSD$ */ /* * @@ -33,6 +32,9 @@ * */ +#include +__FBSDID("$FreeBSD$"); + #include #include From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:46:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F9F106566C; Mon, 21 Sep 2009 08:46:34 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by mx1.freebsd.org (Postfix) with ESMTP id 47D948FC15; Mon, 21 Sep 2009 08:46:33 +0000 (UTC) Received: by ewy4 with SMTP id 4so2223561ewy.36 for ; Mon, 21 Sep 2009 01:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=TR2hGidj+5v4YVntyh+yft1aGS5Xtya1Yx50f1LQBCA=; b=Ly4KhRNreif7kXoVxLaK5oEAJ8nNFEieqmsiyIgMjLxwUP/47IBSuxUGKegDTHvZVy n1IUOhKr7jwh8jzkW3TJajrCulwPOuqm6CiOEnEt1vsaH3u2M+TXFzVF6BfbOSBXq3AR VIGzx1/WAqQhefA0YTRwa1yU7We16CIRp4LRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=H2ygDM3E2c3bmTHy2jIbB3TJkVGbgpC7cYbxLAWTSh3CWg21Jnur+iwRbru12SsbHU Mdl0mtxZ+0pC9Cd6qnPQCud2TL34W28E5rX6L92iO97e9p7Ro1j86Ci0tps58XL/XGYi +YXfvVZ/ToYLIrfyXADzMlnh0fYSnpDTyngo4= Received: by 10.210.6.8 with SMTP id 8mr2703009ebf.41.1253522792110; Mon, 21 Sep 2009 01:46:32 -0700 (PDT) Received: from localhost (95-24-211-3.broadband.corbina.ru [95.24.211.3]) by mx.google.com with ESMTPS id 10sm1345300eyz.26.2009.09.21.01.46.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Sep 2009 01:46:31 -0700 (PDT) From: Anonymous To: Xin LI References: <200909210817.n8L8HvP3080703@svn.freebsd.org> Date: Mon, 21 Sep 2009 12:46:29 +0400 In-Reply-To: <200909210817.n8L8HvP3080703@svn.freebsd.org> (Xin LI's message of "Mon, 21 Sep 2009 08:17:57 +0000 (UTC)") Message-ID: <86my4olm6y.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197383 - in head/sys: conf contrib/x86emu dev/dpms dev/fb dev/x86bios modules modules/x86bios modules/x86emu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:46:34 -0000 --=-=-= Xin LI writes: > Author: delphij > Date: Mon Sep 21 08:17:57 2009 > New Revision: 197383 > URL: http://svn.freebsd.org/changeset/base/197383 > > Log: > Collapase interrupt supporting functions to a new module, and switch from > x86emu to this new module. > > This changeset also brings a fix for bugs introduced with the initial > x86emu commit, which prevents the user from using some display mode or > cause instant reboots during mode switch. > > Submitted by: paradox > > Index: sys/dev/x86bios/x86bios.c [...] > +static moduledata_t x86bios_mod = { > + "x86bios", > + x86bios_modevent, > + NULL, > +}; > + > +DECLARE_MODULE(x86bios, x86bios_mod, SI_SUB_KLD, SI_ORDER_ANY); > +MODULE_VERSION(x86bios, 1); > + SI_SUB_KLD may not work sometimes. If it panics when loaded from loader(8) then better to place it in SI_SUB_CPU or later. BTW, some style(9) fixes didn't make it there. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=a.diff --- sys/dev/fb/vesa.c~ +++ sys/dev/fb/vesa.c @@ -461,7 +461,7 @@ vesa_bios_state_buf_size(void) if ((regs.R_AX & 0xff) != 0x4f) return 0; - return regs.R_BX*64; + return regs.R_BX * 64; } static int @@ -698,7 +698,7 @@ vesa_bios_init(void) vesa_revstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_revstr)); } - vesa_vmodetab = (u_int16_t *)x86biosOffs(FARP(vesa_adp_info->v_modetable)); + vesa_vmodetab = (uint16_t *)x86biosOffs(FARP(vesa_adp_info->v_modetable)); if (vesa_vmodetab == NULL) return 1; @@ -783,7 +783,7 @@ vesa_bios_init(void) - vmode.v_lfb; else vesa_vmode[modes].vi_buffer_size - = vmode.v_offscreen + vmode.v_offscreensize*1024; + = vmode.v_offscreen + vmode.v_offscreensize * 1024; #endif vesa_vmode[modes].vi_mem_model = vesa_translate_mmodel(vmode.v_memmodel); @@ -1269,7 +1269,7 @@ vesa_get_origin(video_adapter_t *adp, of if ((regs.R_AX & 0xff) != 0x4f) return 1; - *offset = regs.DX*adp->va_window_gran; + *offset = regs.DX * adp->va_window_gran; return 0; } @@ -1298,7 +1298,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 0; - regs.R_EDX = offset/adp->va_window_gran; + regs.R_EDX = offset / adp->va_window_gran; x86biosCall(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) @@ -1306,7 +1306,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 1; - regs.R_EDX = offset/adp->va_window_gran; + regs.R_EDX = offset / adp->va_window_gran; x86biosCall(®s, 0x10); adp->va_window_orig = (offset/adp->va_window_gran)*adp->va_window_gran; --- sys/dev/x86bios/x86bios.c~ +++ sys/dev/x86bios/x86bios.c @@ -27,8 +28,8 @@ #include #include -unsigned char *pbiosMem = NULL; -static unsigned char *pbiosStack = NULL; +u_char *pbiosMem = NULL; +static u_char *pbiosStack = NULL; int busySegMap[5]; --- sys/dev/x86bios/x86bios_alloc.c~ +++ sys/dev/x86bios/x86bios_alloc.c @@ -29,7 +29,7 @@ #include -extern unsigned char *pbiosMem; +extern u_char *pbiosMem; extern int busySegMap[5]; void * @@ -74,7 +74,7 @@ x86biosFree(void *pbuf, int count) int i; int busySeg; - busySeg = ((unsigned char *)pbuf - (unsigned char *)pbiosMem)/4096; + busySeg = ((u_char *)pbuf - pbiosMem) / 4096; for (i = busySeg; i < (busySeg + count); i++) busySegMap[i] = 0; --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:53:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 750EA106566B; Mon, 21 Sep 2009 08:53:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58F628FC4B; Mon, 21 Sep 2009 08:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L8rQnV081870; Mon, 21 Sep 2009 08:53:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L8rQE4081866; Mon, 21 Sep 2009 08:53:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210853.n8L8rQE4081866@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 08:53: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: r197387 - in head/sys/dev: fb x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:53:27 -0000 Author: delphij Date: Mon Sep 21 08:53:26 2009 New Revision: 197387 URL: http://svn.freebsd.org/changeset/base/197387 Log: Style(9) fixes. Submitted by: swell.k at gmail.com Modified: head/sys/dev/fb/vesa.c head/sys/dev/x86bios/x86bios.c head/sys/dev/x86bios/x86bios_alloc.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Mon Sep 21 08:37:57 2009 (r197386) +++ head/sys/dev/fb/vesa.c Mon Sep 21 08:53:26 2009 (r197387) @@ -461,7 +461,7 @@ vesa_bios_state_buf_size(void) if ((regs.R_AX & 0xff) != 0x4f) return 0; - return regs.R_BX*64; + return regs.R_BX * 64; } static int @@ -698,7 +698,7 @@ vesa_bios_init(void) vesa_revstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_revstr)); } - vesa_vmodetab = (u_int16_t *)x86biosOffs(FARP(vesa_adp_info->v_modetable)); + vesa_vmodetab = (uint16_t *)x86biosOffs(FARP(vesa_adp_info->v_modetable)); if (vesa_vmodetab == NULL) return 1; @@ -783,7 +783,7 @@ vesa_bios_init(void) - vmode.v_lfb; else vesa_vmode[modes].vi_buffer_size - = vmode.v_offscreen + vmode.v_offscreensize*1024; + = vmode.v_offscreen + vmode.v_offscreensize * 1024; #endif vesa_vmode[modes].vi_mem_model = vesa_translate_mmodel(vmode.v_memmodel); @@ -1269,7 +1269,7 @@ vesa_get_origin(video_adapter_t *adp, of if ((regs.R_AX & 0xff) != 0x4f) return 1; - *offset = regs.DX*adp->va_window_gran; + *offset = regs.DX * adp->va_window_gran; return 0; } @@ -1298,7 +1298,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 0; - regs.R_EDX = offset/adp->va_window_gran; + regs.R_EDX = offset / adp->va_window_gran; x86biosCall(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) @@ -1306,7 +1306,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 1; - regs.R_EDX = offset/adp->va_window_gran; + regs.R_EDX = offset / adp->va_window_gran; x86biosCall(®s, 0x10); adp->va_window_orig = (offset/adp->va_window_gran)*adp->va_window_gran; Modified: head/sys/dev/x86bios/x86bios.c ============================================================================== --- head/sys/dev/x86bios/x86bios.c Mon Sep 21 08:37:57 2009 (r197386) +++ head/sys/dev/x86bios/x86bios.c Mon Sep 21 08:53:26 2009 (r197387) @@ -27,8 +27,8 @@ __FBSDID("$FreeBSD$"); #include #include -unsigned char *pbiosMem = NULL; -static unsigned char *pbiosStack = NULL; +u_char *pbiosMem = NULL; +static u_char *pbiosStack = NULL; int busySegMap[5]; Modified: head/sys/dev/x86bios/x86bios_alloc.c ============================================================================== --- head/sys/dev/x86bios/x86bios_alloc.c Mon Sep 21 08:37:57 2009 (r197386) +++ head/sys/dev/x86bios/x86bios_alloc.c Mon Sep 21 08:53:26 2009 (r197387) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include -extern unsigned char *pbiosMem; +extern u_char *pbiosMem; extern int busySegMap[5]; void * @@ -74,7 +74,7 @@ x86biosFree(void *pbuf, int count) int i; int busySeg; - busySeg = ((unsigned char *)pbuf - (unsigned char *)pbiosMem)/4096; + busySeg = ((u_char *)pbuf - pbiosMem) / 4096; for (i = busySeg; i < (busySeg + count); i++) busySegMap[i] = 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 09:09:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9465F1065670; Mon, 21 Sep 2009 09:09:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 836648FC15; Mon, 21 Sep 2009 09:09:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L99tUQ083088; Mon, 21 Sep 2009 09:09:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L99tXG083086; Mon, 21 Sep 2009 09:09:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210909.n8L99tXG083086@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 09:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197388 - head/sys/dev/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 09:09:55 -0000 Author: delphij Date: Mon Sep 21 09:09:55 2009 New Revision: 197388 URL: http://svn.freebsd.org/changeset/base/197388 Log: To be safe, make this module initialize earlier by specifying SI_SUB_CPU instead of SI_SUB_KLD. Note that we don't believe that there is any consumers of x86bios that would be triggered in the early stage of boot, so this is more or less just a safebelt. Submitted by: swell.k at gmail.com Modified: head/sys/dev/x86bios/x86bios.c Modified: head/sys/dev/x86bios/x86bios.c ============================================================================== --- head/sys/dev/x86bios/x86bios.c Mon Sep 21 08:53:26 2009 (r197387) +++ head/sys/dev/x86bios/x86bios.c Mon Sep 21 09:09:55 2009 (r197388) @@ -213,6 +213,6 @@ static moduledata_t x86bios_mod = { NULL, }; -DECLARE_MODULE(x86bios, x86bios_mod, SI_SUB_KLD, SI_ORDER_ANY); +DECLARE_MODULE(x86bios, x86bios_mod, SI_SUB_CPU, SI_ORDER_ANY); MODULE_VERSION(x86bios, 1); From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 09:41:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3481F1065672; Mon, 21 Sep 2009 09:41:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 234628FC13; Mon, 21 Sep 2009 09:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L9fpNd084896; Mon, 21 Sep 2009 09:41:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L9fpT7084893; Mon, 21 Sep 2009 09:41:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909210941.n8L9fpT7084893@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Sep 2009 09:41: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: r197389 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 09:41:53 -0000 Author: kib Date: Mon Sep 21 09:41:51 2009 New Revision: 197389 URL: http://svn.freebsd.org/changeset/base/197389 Log: If CPU happens to be in usermode when a T_RESERVED trap occured, then trapsignal is called with ksi.ksi_signo = 0. For debugging kernels, that should end up in panic, for non-debugging kernels behaviour is undefined. Do panic regardeless of execution mode at the moment of trap. Reviewed by: jhb MFC after: 1 month Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Sep 21 09:09:55 2009 (r197388) +++ head/sys/amd64/amd64/trap.c Mon Sep 21 09:41:51 2009 (r197389) @@ -253,6 +253,11 @@ trap(struct trapframe *frame) } #endif + if (type == T_RESERVED) { + trap_fatal(frame, 0); + goto out; + } + #ifdef HWPMC_HOOKS /* * CPU PMCs interrupt using an NMI. If the PMC module is Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Sep 21 09:09:55 2009 (r197388) +++ head/sys/i386/i386/trap.c Mon Sep 21 09:41:51 2009 (r197389) @@ -225,6 +225,11 @@ trap(struct trapframe *frame) } #endif + if (type == T_RESERVED) { + trap_fatal(frame, 0); + goto out; + } + #ifdef HWPMC_HOOKS /* * CPU PMCs interrupt using an NMI so we check for that first. From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 13:09:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A9421065670; Mon, 21 Sep 2009 13:09:57 +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 006AB8FC12; Mon, 21 Sep 2009 13:09:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LD9uIu090257; Mon, 21 Sep 2009 13:09:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LD9uTE090256; Mon, 21 Sep 2009 13:09:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909211309.n8LD9uTE090256@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Sep 2009 13:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197390 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 13:09:57 -0000 Author: kib Date: Mon Sep 21 13:09:56 2009 New Revision: 197390 URL: http://svn.freebsd.org/changeset/base/197390 Log: Remove forward_roundrobin(), it is unused for quite some time. Reviewed by: jhb MFC after: 1 week Modified: head/sys/kern/subr_smp.c head/sys/sys/smp.h Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Mon Sep 21 09:41:51 2009 (r197389) +++ head/sys/kern/subr_smp.c Mon Sep 21 13:09:56 2009 (r197390) @@ -104,12 +104,6 @@ SYSCTL_INT(_kern_smp, OID_AUTO, forward_ &forward_signal_enabled, 0, "Forwarding of a signal to a process on a different CPU"); -/* Enable forwarding of roundrobin to all other cpus */ -static int forward_roundrobin_enabled = 1; -SYSCTL_INT(_kern_smp, OID_AUTO, forward_roundrobin_enabled, CTLFLAG_RW, - &forward_roundrobin_enabled, 0, - "Forwarding of roundrobin to all other CPUs"); - /* Variables needed for SMP rendezvous. */ static volatile int smp_rv_ncpus; static void (*volatile smp_rv_setup_func)(void *arg); @@ -189,33 +183,6 @@ forward_signal(struct thread *td) ipi_selected(1 << id, IPI_AST); } -void -forward_roundrobin(void) -{ - struct pcpu *pc; - struct thread *td; - cpumask_t id, map, me; - - CTR0(KTR_SMP, "forward_roundrobin()"); - - if (!smp_started || cold || panicstr) - return; - if (!forward_roundrobin_enabled) - return; - map = 0; - me = PCPU_GET(cpumask); - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - td = pc->pc_curthread; - id = pc->pc_cpumask; - if (id != me && (id & stopped_cpus) == 0 && - !TD_IS_IDLETHREAD(td)) { - td->td_flags |= TDF_NEEDRESCHED; - map |= id; - } - } - ipi_selected(map, IPI_AST); -} - /* * When called the executing CPU will send an IPI to all other CPUs * requesting that they halt execution. Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Mon Sep 21 09:41:51 2009 (r197389) +++ head/sys/sys/smp.h Mon Sep 21 13:09:56 2009 (r197390) @@ -120,7 +120,6 @@ void cpu_mp_setmaxid(void); void cpu_mp_start(void); void forward_signal(struct thread *); -void forward_roundrobin(void); int restart_cpus(cpumask_t); int stop_cpus(cpumask_t); int stop_cpus_hard(cpumask_t); From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 14:41:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01FFD1065672; Mon, 21 Sep 2009 14:41:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48A78FC13; Mon, 21 Sep 2009 14:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LEf7Hl092085; Mon, 21 Sep 2009 14:41:07 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LEf721092082; Mon, 21 Sep 2009 14:41:07 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200909211441.n8LEf721092082@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 21 Sep 2009 14:41: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: r197391 - head/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 14:41:08 -0000 Author: gallatin Date: Mon Sep 21 14:41:07 2009 New Revision: 197391 URL: http://svn.freebsd.org/changeset/base/197391 Log: Add support for throttling transmit bandwidth. This is most commonly used to reduce packet loss on high delay (WAN) paths with a slow link. Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Sep 21 13:09:56 2009 (r197390) +++ head/sys/dev/mxge/if_mxge.c Mon Sep 21 14:41:07 2009 (r197391) @@ -106,6 +106,7 @@ static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = "mxge_ethp_z8e"; static char *mxge_fw_aligned = "mxge_eth_z8e"; static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; @@ -596,10 +597,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc->throttle) + force_firmware = sc->throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1314,10 +1318,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); + if (sc->throttle) { + cmd.data0 = sc->throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + &cmd)) { + device_printf(sc->dev, + "can't enable throttle\n"); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc->throttle; + err = sysctl_handle_int(oidp, &throttle, arg2, req); + if (err != 0) { + return err; + } + + if (throttle == sc->throttle) + return 0; + + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; + + mtx_lock(&sc->driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); + if (err == 0) + sc->throttle = throttle; + mtx_unlock(&sc->driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1505,6 +1547,12 @@ mxge_add_sysctls(mxge_softc_t *sc) "I", "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "throttle", + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + "I", "transmit throttling"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -4016,6 +4064,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; @@ -4033,6 +4082,12 @@ mxge_fetch_tunables(mxge_softc_t *sc) if (mxge_initial_mtu > ETHERMTU_JUMBO || mxge_initial_mtu < ETHER_MIN_LEN) mxge_initial_mtu = ETHERMTU_JUMBO; + + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) + mxge_throttle = MXGE_MAX_THROTTLE; + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) + mxge_throttle = MXGE_MIN_THROTTLE; + sc->throttle = mxge_throttle; } Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Mon Sep 21 13:09:56 2009 (r197390) +++ head/sys/dev/mxge/if_mxge_var.h Mon Sep 21 14:41:07 2009 (r197391) @@ -261,6 +261,7 @@ struct mxge_softc { int fw_multicast_support; int link_width; int max_mtu; + int throttle; int tx_defrag; int media_flags; int need_media_probe; @@ -286,6 +287,8 @@ struct mxge_softc { #define MXGE_PCI_REV_Z8ES 1 #define MXGE_XFP_COMPLIANCE_BYTE 131 #define MXGE_SFP_COMPLIANCE_BYTE 3 +#define MXGE_MIN_THROTTLE 416 +#define MXGE_MAX_THROTTLE 4096 #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 14:43:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94FAD1065694; Mon, 21 Sep 2009 14:43:05 +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 842DB8FC1D; Mon, 21 Sep 2009 14:43:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LEh5vg092159; Mon, 21 Sep 2009 14:43:05 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LEh5tt092157; Mon, 21 Sep 2009 14:43:05 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200909211443.n8LEh5tt092157@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 21 Sep 2009 14:43: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: r197392 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 14:43:05 -0000 Author: ru Date: Mon Sep 21 14:43:05 2009 New Revision: 197392 URL: http://svn.freebsd.org/changeset/base/197392 Log: - List newsletters VI-2, VI-3 and VI-4 that were already applied. - Apply newsletters VI-5 (BO's name change) and VI-6 (VE's name change). Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Mon Sep 21 14:41:07 2009 (r197391) +++ head/share/misc/iso3166 Mon Sep 21 14:43:05 2009 (r197392) @@ -42,7 +42,7 @@ BZ BLZ 084 Belize BJ BEN 204 Benin BM BMU 060 Bermuda BT BTN 064 Bhutan -BO BOL 068 Bolivia +BO BOL 068 Bolivia, Plurinational State of BA BIH 070 Bosnia and Herzegovina BW BWA 072 Botswana BV BVT 074 Bouvet Island @@ -253,7 +253,7 @@ UY URY 858 Uruguay UZ UZB 860 Uzbekistan VU VUT 548 Vanuatu VA VAT 336 Holy See (Vatican City State) -VE VEN 862 Venezuela +VE VEN 862 Venezuela, Bolivarian Republic of VN VNM 704 Viet Nam VG VGB 092 Virgin Islands, British VI VIR 850 Virgin Islands, U.S. @@ -518,3 +518,19 @@ ZW ZWE 716 Zimbabwe # # Newsletter VI-1 2007-09-21 # Added SAINT BARTHELEMY (BL) and SAINT MARTIN (MF). +# +# Newsletter VI-2 2008-04-25 +# Name changes for Moldova, Montenegro and other minor corrections. +# +# Newsletter VI-3 2008-09-09 +# Name change for Nepal and other minor corrections. +# Not relevant to this file. +# +# Newsletter VI-4 2009-01-07 +# Name change for the Republic of Moldova and other minor corrections. +# +# Newsletter VI-5 2009-03-03 +# Name change for Bolivarian Republic of Venezuela and other minor corrections. +# +# Newsletter VI-6 2009-05-08 +# Name change for Plurinational State of Bolivia. From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 15:28:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E652C1065672; Mon, 21 Sep 2009 15:28:22 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 3DC868FC19; Mon, 21 Sep 2009 15:28:22 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANc4t0qDaFvI/2dsb2JhbADSXYQbBYFY X-IronPort-AV: E=Sophos;i="4.44,424,1249272000"; d="scan'208";a="47098018" Received: from darling.cs.uoguelph.ca ([131.104.91.200]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 21 Sep 2009 11:28:21 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 2D010940091; Mon, 21 Sep 2009 11:28:21 -0400 (EDT) X-Virus-Scanned: amavisd-new at darling.cs.uoguelph.ca Received: from darling.cs.uoguelph.ca ([127.0.0.1]) by localhost (darling.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ilz99QQU7b17; Mon, 21 Sep 2009 11:28:20 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 887E79400CE; Mon, 21 Sep 2009 11:28:19 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8LFXvr01341; Mon, 21 Sep 2009 11:33:58 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Mon, 21 Sep 2009 11:33:57 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: "Daniel O'Connor" In-Reply-To: <200909211416.11654.doconnor@gsoft.com.au> Message-ID: References: <20090919.230053.58383965.imp@bsdimp.com> <200909211216.07249.doconnor@gsoft.com.au> <20090920.220343.-737556392.imp@bsdimp.com> <200909211416.11654.doconnor@gsoft.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, jhb@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, rmacklem@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 15:28:23 -0000 On Mon, 21 Sep 2009, Daniel O'Connor wrote: [good stuff snipped] >> : >> : The thought of doing NFS over the internet boggles my mind :) >> [more stuff snipped] Just fyi, NFSv4 avoids all of this by doing everything via NFS over TCP to port 2049. Unless someone stands up and thinks that it isn't an appropriate change for 8.0, I'll email re@ at the end of to-day requesting the merge of the one line change I already committed to head. - It makes the default for Mount and the NFS Null RPC done before the mount(2) syscall use TCP by default. (It doesn't affect the behaviour when any of "udp", "tcp", "mntudp" options are specified.) Since Linux uses Mount over TCP for "tcp" mounts, I believe pretty well any server that supports NFS over TCP must also support Mount over TCP. (They'd get screamed at, otherwise.) Thanks for the input, rick From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 16:15:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBCA3106566C; Mon, 21 Sep 2009 16:15:22 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3A4AE8FC1D; Mon, 21 Sep 2009 16:15:21 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAGJDt0qDaFvI/2dsb2JhbADSUYQbBQ X-IronPort-AV: E=Sophos;i="4.44,425,1249272000"; d="scan'208";a="48807458" Received: from darling.cs.uoguelph.ca ([131.104.91.200]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 21 Sep 2009 12:15:19 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 2C1A2940099; Mon, 21 Sep 2009 12:15:19 -0400 (EDT) X-Virus-Scanned: amavisd-new at darling.cs.uoguelph.ca Received: from darling.cs.uoguelph.ca ([127.0.0.1]) by localhost (darling.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oZcI5crmkKRd; Mon, 21 Sep 2009 12:15:18 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 21DCA94007B; Mon, 21 Sep 2009 12:15:18 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8LGKuQ10491; Mon, 21 Sep 2009 12:20:56 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Mon, 21 Sep 2009 12:20:56 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: "M. Warner Losh" In-Reply-To: <20090920.155347.-675685342.imp@bsdimp.com> Message-ID: References: <4AB495DD.1010006@FreeBSD.org> <20090919.230053.58383965.imp@bsdimp.com> <20090920.155347.-675685342.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, rmacklem@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 16:15:23 -0000 On Sun, 20 Sep 2009, M. Warner Losh wrote: > : Someone mentioned an issue w.r.t. umount using UDP, which was basically > : a slow timeout when a server didn't handle the UDP call, such as when > : it was down. I'd guess that a TCP attempt would fail more quickly than > : a UDP attempt when the server doesn't have rpcbind/portmapper running. > : (Not so sure when the server has crashed, but I'm guessing that the TCP > : connection attempt fails more quickly than the N retries over UDP?) > > A server down would have the same timeout issues as a UDP timeout. > I was thinking of this email: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=213665+0+archive/2009/freebsd-current/2 Actually, we were both wrong (although you were closer), at least for the little experiment I just tried.:-) When the server is up, but not supporting that protocol (UDP or TCP), both cases failed in < 1sec. (So, you got this one right. I had thought UDP would take longer, but it didn't. It appears that the ICMP Dest Unreachable causes it to fail quickly. I have no idea if ICMP Dest. Unreachable messages get forwarded normally. Maybe that's what the email was alluding to when he said "some situations".) When the server is down/network partitioned, it actually took longer for TCP (1min vs about 10sec) for the defaults in the 8.0 RPC libraries. Probably not relevent to the discussion, but I thought someone might find it interesting, rick From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 17:19:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D28106566C; Mon, 21 Sep 2009 17:19:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 704698FC0A; Mon, 21 Sep 2009 17:19:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LHJavF095122; Mon, 21 Sep 2009 17:19:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LHJanh095120; Mon, 21 Sep 2009 17:19:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909211719.n8LHJanh095120@svn.freebsd.org> From: Alan Cox Date: Mon, 21 Sep 2009 17:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197393 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 17:19:36 -0000 Author: alc Date: Mon Sep 21 17:19:36 2009 New Revision: 197393 URL: http://svn.freebsd.org/changeset/base/197393 Log: Add FreeBSD 7.2 and 7.3. Discussed with: ru 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 Mon Sep 21 14:43:05 2009 (r197392) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Mon Sep 21 17:19:36 2009 (r197393) @@ -72,6 +72,8 @@ .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-7.2 7.2 +.ds doc-operating-system-FreeBSD-7.3 7.3 .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-9.0 9.0 . From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 18:02:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B79EC106566B; Mon, 21 Sep 2009 18:02:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A790E8FC08; Mon, 21 Sep 2009 18:02:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LI223J095958; Mon, 21 Sep 2009 18:02:02 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LI22wu095956; Mon, 21 Sep 2009 18:02:02 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909211802.n8LI22wu095956@svn.freebsd.org> From: Alan Cox Date: Mon, 21 Sep 2009 18:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197394 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 18:02:02 -0000 Author: alc Date: Mon Sep 21 18:02:02 2009 New Revision: 197394 URL: http://svn.freebsd.org/changeset/base/197394 Log: Correct a section name; specifically, "AUTHOR" should be "AUTHORS". [1] Turn the "AUTHORS" section into a full sentence. Pointed out by: ru [1] Modified: head/lib/libc/gen/getpagesizes.3 Modified: head/lib/libc/gen/getpagesizes.3 ============================================================================== --- head/lib/libc/gen/getpagesizes.3 Mon Sep 21 17:19:36 2009 (r197393) +++ head/lib/libc/gen/getpagesizes.3 Mon Sep 21 18:02:02 2009 (r197394) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2009 +.Dd September 21, 2009 .Dt GETPAGESIZES 3 .Os .Sh NAME @@ -94,5 +94,6 @@ function first appeared in Solaris 9. This manual page was written in conjunction with a new but compatible implementation that was first released in .Fx 7.3 . -.Sh AUTHOR -.An Alan L. Cox Aq alc@cs.rice.edu +.Sh AUTHORS +This manual page was written by +.An Alan L. Cox Aq alc@cs.rice.edu . From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 20:16:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CF5F106566B; Mon, 21 Sep 2009 20:16:10 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9068FC13; Mon, 21 Sep 2009 20:16:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LKGAN6098400; Mon, 21 Sep 2009 20:16:10 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LKGAjP098398; Mon, 21 Sep 2009 20:16:10 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200909212016.n8LKGAjP098398@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 21 Sep 2009 20:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197395 - head/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 20:16:10 -0000 Author: gallatin Date: Mon Sep 21 20:16:10 2009 New Revision: 197395 URL: http://svn.freebsd.org/changeset/base/197395 Log: Improve mxge watchdog routine's ability to reliably reset a failed NIC: - Mark the link as down, so if watchdog reset fails, link watching failover software can notice it - Don't send MXGEFW_CMD_ETHERNET_DOWN if the NIC has been reset, it is not needed, and will fail on a freshly reset NIC. - Ensure the transmit routines aren't attempting to PIO write to doorbells while the NIC is being reset. - Download the correct f/w, rather than using the EEPROM f/w after reset. - Export a count of the number of watchdog resets via sysctl - Zero all f/w stats at reset. This will lead to less confusing diagnostic output when investigating NIC failures. MFC after: 3 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Sep 21 18:02:02 2009 (r197394) +++ head/sys/dev/mxge/if_mxge.c Mon Sep 21 20:16:10 2009 (r197395) @@ -144,7 +144,7 @@ MODULE_DEPEND(mxge, zlib, 1, 1, 1); static int mxge_load_firmware(mxge_softc_t *sc, int adopt); static int mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data); -static int mxge_close(mxge_softc_t *sc); +static int mxge_close(mxge_softc_t *sc, int down); static int mxge_open(mxge_softc_t *sc); static void mxge_tick(void *arg); @@ -1309,8 +1309,7 @@ mxge_reset(mxge_softc_t *sc, int interru ss->lro_queued = 0; ss->lro_flushed = 0; if (ss->fw_stats != NULL) { - ss->fw_stats->valid = 0; - ss->fw_stats->send_done_count = 0; + bzero(ss->fw_stats, sizeof *ss->fw_stats); } } sc->rdma_tags_available = 15; @@ -1421,7 +1420,7 @@ mxge_change_lro_locked(mxge_softc_t *sc, ifp->if_capenable |= IFCAP_LRO; sc->lro_cnt = lro_cnt; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); err = mxge_open(sc); } return err; @@ -1537,6 +1536,10 @@ mxge_add_sysctls(mxge_softc_t *sc) "read_write_dma_MBs", CTLFLAG_RD, &sc->read_write_dma, 0, "DMA concurrent Read/Write speed in MB/s"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "watchdog_resets", + CTLFLAG_RD, &sc->watchdog_resets, + 0, "Number of times NIC was reset"); /* performance related tunables */ @@ -3648,7 +3651,7 @@ abort: } static int -mxge_close(mxge_softc_t *sc) +mxge_close(mxge_softc_t *sc, int down) { mxge_cmd_t cmd; int err, old_down_cnt; @@ -3665,21 +3668,23 @@ mxge_close(mxge_softc_t *sc) } #endif sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - old_down_cnt = sc->down_cnt; - wmb(); - err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd); - if (err) { - device_printf(sc->dev, "Couldn't bring down link\n"); - } - if (old_down_cnt == sc->down_cnt) { - /* wait for down irq */ - DELAY(10 * sc->intr_coal_delay); - } - wmb(); - if (old_down_cnt == sc->down_cnt) { - device_printf(sc->dev, "never got down irq\n"); + if (!down) { + old_down_cnt = sc->down_cnt; + wmb(); + err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd); + if (err) { + device_printf(sc->dev, + "Couldn't bring down link\n"); + } + if (old_down_cnt == sc->down_cnt) { + /* wait for down irq */ + DELAY(10 * sc->intr_coal_delay); + } + wmb(); + if (old_down_cnt == sc->down_cnt) { + device_printf(sc->dev, "never got down irq\n"); + } } - mxge_free_mbufs(sc); return 0; @@ -3732,8 +3737,9 @@ static int mxge_watchdog_reset(mxge_softc_t *sc, int slice) { struct pci_devinfo *dinfo; + struct mxge_slice_state *ss; mxge_tx_ring_t *tx; - int err; + int err, running, s, num_tx_slices = 1; uint32_t reboot; uint16_t cmd; @@ -3767,6 +3773,30 @@ mxge_watchdog_reset(mxge_softc_t *sc, in reboot = mxge_read_reboot(sc); device_printf(sc->dev, "NIC rebooted, status = 0x%x\n", reboot); + running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; + if (running) { + + /* + * quiesce NIC so that TX routines will not try to + * xmit after restoration of BAR + */ + + /* Mark the link as down */ + if (sc->link_state) { + sc->link_state = 0; + if_link_state_change(sc->ifp, + LINK_STATE_DOWN); + } +#ifdef IFNET_BUF_RING + num_tx_slices = sc->num_slices; +#endif + /* grab all TX locks to ensure no tx */ + for (s = 0; s < num_tx_slices; s++) { + ss = &sc->ss[s]; + mtx_lock(&ss->tx.mtx); + } + mxge_close(sc, 1); + } /* restore PCI configuration space */ dinfo = device_get_ivars(sc->dev); pci_cfg_restore(sc->dev, dinfo); @@ -3774,10 +3804,22 @@ mxge_watchdog_reset(mxge_softc_t *sc, in /* and redo any changes we made to our config space */ mxge_setup_cfg_space(sc); - if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); - err = mxge_open(sc); + /* reload f/w */ + err = mxge_load_firmware(sc, 0); + if (err) { + device_printf(sc->dev, + "Unable to re-load f/w\n"); } + if (running) { + if (!err) + err = mxge_open(sc); + /* release all TX locks */ + for (s = 0; s < num_tx_slices; s++) { + ss = &sc->ss[s]; + mtx_unlock(&ss->tx.mtx); + } + } + sc->watchdog_resets++; } else { tx = &sc->ss[slice].tx; device_printf(sc->dev, @@ -3793,6 +3835,9 @@ mxge_watchdog_reset(mxge_softc_t *sc, in be32toh(sc->ss->fw_stats->send_done_count)); device_printf(sc->dev, "not resetting\n"); } + if (err) + device_printf(sc->dev, "watchdog reset failed\n"); + return (err); } @@ -3908,11 +3953,11 @@ mxge_change_mtu(mxge_softc_t *sc, int mt old_mtu = ifp->if_mtu; ifp->if_mtu = mtu; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); err = mxge_open(sc); if (err != 0) { ifp->if_mtu = old_mtu; - mxge_close(sc); + mxge_close(sc, 0); (void) mxge_open(sc); } } @@ -3970,7 +4015,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); } } mtx_unlock(&sc->driver_mtx); @@ -4700,7 +4745,7 @@ mxge_detach(device_t dev) mtx_lock(&sc->driver_mtx); sc->dying = 1; if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) - mxge_close(sc); + mxge_close(sc, 0); mtx_unlock(&sc->driver_mtx); ether_ifdetach(sc->ifp); callout_drain(&sc->co_hdl); From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 22:31:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0B0D10656A4; Mon, 21 Sep 2009 22:31:06 +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 AEB188FC27; Mon, 21 Sep 2009 22:31:06 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 38F696D41C; Mon, 21 Sep 2009 22:31:05 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 0FED784491; Tue, 22 Sep 2009 00:31:05 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI References: <200909210817.n8L8HvP3080703@svn.freebsd.org> Date: Tue, 22 Sep 2009 00:31:04 +0200 In-Reply-To: <200909210817.n8L8HvP3080703@svn.freebsd.org> (Xin LI's message of "Mon, 21 Sep 2009 08:17:57 +0000 (UTC)") Message-ID: <86pr9kkk0n.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (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: r197383 - in head/sys: conf contrib/x86emu dev/dpms dev/fb dev/x86bios modules modules/x86bios modules/x86emu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 22:31:07 -0000 Xin LI writes: > Log: > Collapase interrupt supporting functions to a new module, and switch fr= om > x86emu to this new module. >=20=20=20 > This changeset also brings a fix for bugs introduced with the initial > x86emu commit, which prevents the user from using some display mode or > cause instant reboots during mode switch. This broke powerpc and sparc64... It would be nice if you could provide a little more information (a man page, or at the very least a few sentences in a comment in NOTES) explaining what this module does. I believe it has something to do with running video card BIOS code? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 23:58:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1251065672; Mon, 21 Sep 2009 23:58:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2129F8FC08; Mon, 21 Sep 2009 23:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LNwUB2003689; Mon, 21 Sep 2009 23:58:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8LNwTF1003684; Mon, 21 Sep 2009 23:58:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909212358.n8LNwTF1003684@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 23:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197397 - in head/sys: amd64/conf conf i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 23:58:30 -0000 Author: delphij Date: Mon Sep 21 23:58:29 2009 New Revision: 197397 URL: http://svn.freebsd.org/changeset/base/197397 Log: Build x86bios only for i386/amd64 for now. More work is required to make these functional on other architectures, and the current code breaks sparc64 and powerpc. Spotted by: tinderbox via des Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Sep 21 23:20:18 2009 (r197396) +++ head/sys/amd64/conf/NOTES Mon Sep 21 23:58:29 2009 (r197397) @@ -160,6 +160,11 @@ options VESA # Turn on extra debugging checks and output for VESA support. options VESA_DEBUG +device dpms # DPMS suspend & resume via VESA BIOS + +# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +options X86BIOS + # # Optional devices: # Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Sep 21 23:20:18 2009 (r197396) +++ head/sys/conf/NOTES Mon Sep 21 23:58:29 2009 (r197397) @@ -2757,5 +2757,3 @@ options AAC_DEBUG # Debugging levels: options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 -# x86 real mode emulator -options X86BIOS Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Sep 21 23:20:18 2009 (r197396) +++ head/sys/i386/conf/NOTES Mon Sep 21 23:58:29 2009 (r197397) @@ -361,6 +361,9 @@ options VESA_DEBUG device dpms # DPMS suspend & resume via VESA BIOS +# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +options X86BIOS + # # The Numeric Processing eXtension driver. This is non-optional. device npx Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Sep 21 23:20:18 2009 (r197396) +++ head/sys/modules/Makefile Mon Sep 21 23:58:29 2009 (r197397) @@ -298,7 +298,7 @@ SUBDIR= ${_3dfx} \ wlan_xauth \ ${_wpi} \ ${_wpifw} \ - x86bios \ + ${_x86bios} \ ${_xe} \ xfs \ xl \ @@ -456,6 +456,7 @@ _padlock= padlock _s3= s3 _twa= twa _vesa= vesa +_x86bios= x86bios .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus @@ -539,6 +540,7 @@ _sppp= sppp _tmpfs= tmpfs _twa= twa _vesa= vesa +_x86bios= x86bios _wi= wi _wpi= wpi _wpifw= wpifw From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 07:10:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48604106568B; Tue, 22 Sep 2009 07:10:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 374758FC16; Tue, 22 Sep 2009 07:10:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8M7AOLZ012073; Tue, 22 Sep 2009 07:10:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8M7AOFF012072; Tue, 22 Sep 2009 07:10:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909220710.n8M7AOFF012072@svn.freebsd.org> From: Xin LI Date: Tue, 22 Sep 2009 07:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197399 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 07:10:24 -0000 Author: delphij Date: Tue Sep 22 07:10:23 2009 New Revision: 197399 URL: http://svn.freebsd.org/changeset/base/197399 Log: Hide x86bios stuff in i386/amd64 specific files as atkbdc would get these stuff into build. Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 22 03:10:04 2009 (r197398) +++ head/sys/conf/files Tue Sep 22 07:10:23 2009 (r197399) @@ -2828,8 +2828,3 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci dev/xen/xenpci/machine_reboot.c optional xenpci -dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa - Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Sep 22 03:10:04 2009 (r197398) +++ head/sys/conf/files.amd64 Tue Sep 22 07:10:23 2009 (r197399) @@ -294,3 +294,11 @@ i386/cpufreq/p4tcc.c optional cpufreq # libkern/memmove.c standard libkern/memset.c standard +# +# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +# +dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa + Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Sep 22 03:10:04 2009 (r197398) +++ head/sys/conf/files.i386 Tue Sep 22 07:10:23 2009 (r197399) @@ -378,3 +378,10 @@ i386/xbox/xbox.c optional xbox i386/xbox/xboxfb.c optional xboxfb dev/fb/boot_font.c optional xboxfb i386/xbox/pic16l.s optional xbox +# +# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +# +dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 11:22:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4882A106566C; Tue, 22 Sep 2009 11:22:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9118FC14; Tue, 22 Sep 2009 11:22:48 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C18B346B06; Tue, 22 Sep 2009 07:22:47 -0400 (EDT) Date: Tue, 22 Sep 2009 12:22:47 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andrew Gallatin In-Reply-To: <200909211441.n8LEf721092082@svn.freebsd.org> Message-ID: References: <200909211441.n8LEf721092082@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197391 - head/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 11:22:48 -0000 On Mon, 21 Sep 2009, Andrew Gallatin wrote: > Add support for throttling transmit bandwidth. This is most commonly > used to reduce packet loss on high delay (WAN) paths with a > slow link. Hi Drew-- Could you say a little more about the situations in which this is used? I see (or think I see) that the card supports internal throttling, but is there a reason, other than the hardware supporting it, for not to do something like this higher in the stack before cycles are burned and PCI bus bandwidth has been wasted? Robert N M Watson Computer Laboratory University of Cambridge > > Modified: > head/sys/dev/mxge/if_mxge.c > head/sys/dev/mxge/if_mxge_var.h > > Modified: head/sys/dev/mxge/if_mxge.c > ============================================================================== > --- head/sys/dev/mxge/if_mxge.c Mon Sep 21 13:09:56 2009 (r197390) > +++ head/sys/dev/mxge/if_mxge.c Mon Sep 21 14:41:07 2009 (r197391) > @@ -106,6 +106,7 @@ static int mxge_max_slices = 1; > static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; > static int mxge_always_promisc = 0; > static int mxge_initial_mtu = ETHERMTU_JUMBO; > +static int mxge_throttle = 0; > static char *mxge_fw_unaligned = "mxge_ethp_z8e"; > static char *mxge_fw_aligned = "mxge_eth_z8e"; > static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; > @@ -596,10 +597,13 @@ static int > mxge_select_firmware(mxge_softc_t *sc) > { > int aligned = 0; > + int force_firmware = mxge_force_firmware; > > + if (sc->throttle) > + force_firmware = sc->throttle; > > - if (mxge_force_firmware != 0) { > - if (mxge_force_firmware == 1) > + if (force_firmware != 0) { > + if (force_firmware == 1) > aligned = 1; > else > aligned = 0; > @@ -1314,10 +1318,48 @@ mxge_reset(mxge_softc_t *sc, int interru > mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); > mxge_change_pause(sc, sc->pause); > mxge_set_multicast_list(sc); > + if (sc->throttle) { > + cmd.data0 = sc->throttle; > + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, > + &cmd)) { > + device_printf(sc->dev, > + "can't enable throttle\n"); > + } > + } > return status; > } > > static int > +mxge_change_throttle(SYSCTL_HANDLER_ARGS) > +{ > + mxge_cmd_t cmd; > + mxge_softc_t *sc; > + int err; > + unsigned int throttle; > + > + sc = arg1; > + throttle = sc->throttle; > + err = sysctl_handle_int(oidp, &throttle, arg2, req); > + if (err != 0) { > + return err; > + } > + > + if (throttle == sc->throttle) > + return 0; > + > + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) > + return EINVAL; > + > + mtx_lock(&sc->driver_mtx); > + cmd.data0 = throttle; > + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); > + if (err == 0) > + sc->throttle = throttle; > + mtx_unlock(&sc->driver_mtx); > + return err; > +} > + > +static int > mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) > { > mxge_softc_t *sc; > @@ -1505,6 +1547,12 @@ mxge_add_sysctls(mxge_softc_t *sc) > "I", "interrupt coalescing delay in usecs"); > > SYSCTL_ADD_PROC(ctx, children, OID_AUTO, > + "throttle", > + CTLTYPE_INT|CTLFLAG_RW, sc, > + 0, mxge_change_throttle, > + "I", "transmit throttling"); > + > + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, > "flow_control_enabled", > CTLTYPE_INT|CTLFLAG_RW, sc, > 0, mxge_change_flow_control, > @@ -4016,6 +4064,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) > TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); > TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); > TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); > + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); > if (sc->lro_cnt != 0) > mxge_lro_cnt = sc->lro_cnt; > > @@ -4033,6 +4082,12 @@ mxge_fetch_tunables(mxge_softc_t *sc) > if (mxge_initial_mtu > ETHERMTU_JUMBO || > mxge_initial_mtu < ETHER_MIN_LEN) > mxge_initial_mtu = ETHERMTU_JUMBO; > + > + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) > + mxge_throttle = MXGE_MAX_THROTTLE; > + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) > + mxge_throttle = MXGE_MIN_THROTTLE; > + sc->throttle = mxge_throttle; > } > > > > Modified: head/sys/dev/mxge/if_mxge_var.h > ============================================================================== > --- head/sys/dev/mxge/if_mxge_var.h Mon Sep 21 13:09:56 2009 (r197390) > +++ head/sys/dev/mxge/if_mxge_var.h Mon Sep 21 14:41:07 2009 (r197391) > @@ -261,6 +261,7 @@ struct mxge_softc { > int fw_multicast_support; > int link_width; > int max_mtu; > + int throttle; > int tx_defrag; > int media_flags; > int need_media_probe; > @@ -286,6 +287,8 @@ struct mxge_softc { > #define MXGE_PCI_REV_Z8ES 1 > #define MXGE_XFP_COMPLIANCE_BYTE 131 > #define MXGE_SFP_COMPLIANCE_BYTE 3 > +#define MXGE_MIN_THROTTLE 416 > +#define MXGE_MAX_THROTTLE 4096 > > #define MXGE_HIGHPART_TO_U32(X) \ > (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) > From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 11:29:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4644C1065672; Tue, 22 Sep 2009 11:29:12 +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 357F58FC12; Tue, 22 Sep 2009 11:29:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MBTCU9019013; Tue, 22 Sep 2009 11:29:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MBTCiD019011; Tue, 22 Sep 2009 11:29:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909221129.n8MBTCiD019011@svn.freebsd.org> From: Ed Schouten Date: Tue, 22 Sep 2009 11: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: r197400 - head/sys/dev/kbd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 11:29:12 -0000 Author: ed Date: Tue Sep 22 11:29:11 2009 New Revision: 197400 URL: http://svn.freebsd.org/changeset/base/197400 Log: Use an unsigned integer for storing the key code. It seems Clang breaks when checking for SPCLKEY, which is now 0x80000000. Using an unsigned integer fixes this. This is also consistent with other pieces of kbd/syscons code, because these also use u_int. Submitted by: rdivacky Modified: head/sys/dev/kbd/kbd.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Tue Sep 22 07:10:23 2009 (r197399) +++ head/sys/dev/kbd/kbd.c Tue Sep 22 11:29:11 2009 (r197400) @@ -728,7 +728,7 @@ genkbd_event(keyboard_t *kbd, int event, size_t len; u_char *cp; int mode; - int c; + u_int c; /* assert(KBD_IS_VALID(kbd)) */ sc = (genkbd_softc_t *)arg; From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 11:38:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B9211065697; Tue, 22 Sep 2009 11:38:46 +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 EE1ED8FC1F; Tue, 22 Sep 2009 11:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MBcjkM019246; Tue, 22 Sep 2009 11:38:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MBcjEB019244; Tue, 22 Sep 2009 11:38:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909221138.n8MBcjEB019244@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Sep 2009 11:38: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: r197401 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 11:38:46 -0000 Author: marius Date: Tue Sep 22 11:38:45 2009 New Revision: 197401 URL: http://svn.freebsd.org/changeset/base/197401 Log: - According to Linux, the ALi M5451 can do 31-bit DMA instead of just 30-bit like the reset of the controllers supported by this driver. Actually ALi M5451 can be setup up to generate 32-bit addresses by setting the 31st bit via the accompanying ISA bridge, which allows it to work in sparc64 machines whose IOMMU require at least 32-bit DMA. Even though other architectures would also benefit from 32-bit DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT results in a buffer in the 32-bit range. - According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of ALi M5451 is fixed to 64k and in fact using the default size of 4k - The 4DWAVE DX and NX require the recording buffer to be 8-byte aligned so adjust the bus_dma_tag_create(9) accordingly. - Unlike the rest of the controllers supported by this driver, the ALi M5451 only has 32 hardware channels instead of 64 so limit the loop in tr_intr() accordingly. [1] Submitted by: yongari [1] Reviewed by: yongari (superset of what is committed) MFC after: 3 days Modified: head/sys/dev/sound/pci/t4dwave.c Modified: head/sys/dev/sound/pci/t4dwave.c ============================================================================== --- head/sys/dev/sound/pci/t4dwave.c Tue Sep 22 11:29:11 2009 (r197400) +++ head/sys/dev/sound/pci/t4dwave.c Tue Sep 22 11:38:45 2009 (r197401) @@ -45,18 +45,22 @@ SND_DECLARE_FILE("$FreeBSD$"); #define SPA_PCI_ID 0x70181039 #define TR_DEFAULT_BUFSZ 0x1000 +/* For ALi M5451 the DMA transfer size appears to be fixed to 64k. */ +#define ALI_BUFSZ 0x10000 +#define TR_BUFALGN 0x8 #define TR_TIMEOUT_CDC 0xffff +#define TR_MAXHWCH 64 +#define ALI_MAXHWCH 32 #define TR_MAXPLAYCH 4 +#define ALI_MAXPLAYCH 1 /* - * Though, it's not clearly documented in trident datasheet, trident - * audio cards can't handle DMA addresses located above 1GB. The LBA - * (loop begin address) register which holds DMA base address is 32bits - * register. - * But the MSB 2bits are used for other purposes(I guess it is really - * bad idea). This effectivly limits the DMA address space up to 1GB. + * Though, it's not clearly documented in the 4DWAVE datasheet, the + * DX and NX chips can't handle DMA addresses located above 1GB as the + * LBA (loop begin address) register which holds the DMA base address + * is 32-bit, but the two MSBs are used for other purposes. */ -#define TR_MAXADDR ((1 << 30) - 1) - +#define TR_MAXADDR ((1U << 30) - 1) +#define ALI_MAXADDR ((1U << 31) - 1) struct tr_info; @@ -97,6 +101,7 @@ struct tr_info { struct mtx *lock; + u_int32_t hwchns; u_int32_t playchns; unsigned int bufsz; @@ -398,7 +403,10 @@ tr_wrch(struct tr_chinfo *ch) ch->ec &= 0x00000fff; ch->alpha &= 0x00000fff; ch->delta &= 0x0000ffff; - ch->lba &= 0x3fffffff; + if (tr->type == ALI_PCI_ID) + ch->lba &= ALI_MAXADDR; + else + ch->lba &= TR_MAXADDR; cr[1]=ch->lba; cr[3]=(ch->fmc<<14) | (ch->rvol<<7) | (ch->cvol); @@ -441,7 +449,10 @@ tr_rdch(struct tr_chinfo *ch) snd_mtxunlock(tr->lock); - ch->lba= (cr[1] & 0x3fffffff); + if (tr->type == ALI_PCI_ID) + ch->lba=(cr[1] & ALI_MAXADDR); + else + ch->lba=(cr[1] & TR_MAXADDR); ch->fmc= (cr[3] & 0x0000c000) >> 14; ch->rvol= (cr[3] & 0x00003f80) >> 7; ch->cvol= (cr[3] & 0x0000007f); @@ -628,7 +639,6 @@ trrchan_setformat(kobj_t obj, void *data tr_wr(tr, TR_REG_SBCTRL, i, 1); return 0; - } static u_int32_t @@ -729,7 +739,7 @@ tr_intr(void *p) intsrc = tr_rd(tr, TR_REG_MISCINT, 4); if (intsrc & TR_INT_ADDR) { chnum = 0; - while (chnum < 64) { + while (chnum < tr->hwchns) { mask = 0x00000001; active = tr_rd(tr, (chnum < 32)? TR_REG_ADDRINTA : TR_REG_ADDRINTB, 4); bufhalf = tr_rd(tr, (chnum < 32)? TR_REG_CSPF_A : TR_REG_CSPF_B, 4); @@ -815,8 +825,13 @@ tr_pci_attach(device_t dev) u_int32_t data; struct tr_info *tr; struct ac97_info *codec = 0; + bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; +#ifdef __sparc64__ + device_t *children; + int nchildren; +#endif tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO); tr->type = pci_get_devid(dev); @@ -834,7 +849,7 @@ tr_pci_attach(device_t dev) } else { switch (tr->type) { case ALI_PCI_ID: - dacn = 1; + dacn = ALI_MAXPLAYCH; break; default: dacn = TR_MAXPLAYCH; @@ -859,8 +874,6 @@ tr_pci_attach(device_t dev) goto bad; } - tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, 65536); - if (tr_init(tr) == -1) { device_printf(dev, "unable to initialize the card\n"); goto bad; @@ -879,12 +892,59 @@ tr_pci_attach(device_t dev) goto bad; } - if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), /*alignment*/2, + if (tr->type == ALI_PCI_ID) { + /* + * The M5451 generates 31 bit of DMA and in order to do + * 32-bit DMA, the 31st bit can be set via its accompanying + * ISA bridge. Note that we can't predict whether bus_dma(9) + * will actually supply us with a 32-bit buffer and even when + * using a low address of BUS_SPACE_MAXADDR_32BIT for both + * we might end up with the play buffer being in the 32-bit + * range while the record buffer isn't or vice versa. So we + * limit enabling the 31st bit to sparc64, where the IOMMU + * guarantees that we're using a 32-bit address (and in turn + * requires it). + */ + lowaddr = ALI_MAXADDR; +#ifdef __sparc64__ + if (device_get_children(device_get_parent(dev), &children, + &nchildren) == 0) { + for (i = 0; i < nchildren; i++) { + if (pci_get_devid(children[i]) == 0x153310b9) { + lowaddr = BUS_SPACE_MAXADDR_32BIT; + data = pci_read_config(children[i], + 0x7e, 1); + if (bootverbose) + device_printf(dev, + "M1533 0x7e: 0x%x -> ", + data); + data |= 0x1; + if (bootverbose) + printf("0x%x\n", data); + pci_write_config(children[i], 0x7e, + data, 1); + break; + } + } + } + free(children, M_TEMP); +#endif + tr->hwchns = ALI_MAXHWCH; + tr->bufsz = ALI_BUFSZ; + } else { + lowaddr = TR_MAXADDR; + tr->hwchns = TR_MAXHWCH; + tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, + 65536); + } + + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), + /*alignment*/TR_BUFALGN, /*boundary*/0, - /*lowaddr*/TR_MAXADDR, + /*lowaddr*/lowaddr, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, + /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/tr->bufsz, /*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, &tr->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 11:47:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B93A106568B; Tue, 22 Sep 2009 11:47:21 +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 7A2148FC1A; Tue, 22 Sep 2009 11:47:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MBlL2F019464; Tue, 22 Sep 2009 11:47:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MBlLFC019462; Tue, 22 Sep 2009 11:47:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909221147.n8MBlLFC019462@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Sep 2009 11:47: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: r197402 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 11:47:21 -0000 Author: marius Date: Tue Sep 22 11:47:21 2009 New Revision: 197402 URL: http://svn.freebsd.org/changeset/base/197402 Log: - Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously the work area was totally unsynchronized which means this driver only had a chance of working on x86 when no bounce buffers were involved, which isn't that likely given that support for 64-bit DMA is currently broken throughout ata(4). - Add necessary little-endian conversion of accesses to the work area, making this driver work on big-endian hosts. While at it, use the alignment-agnostic byte order encoders in order to be on the safe side. - Clear the reserved member of the SG list entries in order to be on the safe side. [1] Submitted by: yongari [1] Reviewed by: yongari MFC after: 3 days Modified: head/sys/dev/ata/chipsets/ata-marvell.c Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Tue Sep 22 11:38:45 2009 (r197401) +++ head/sys/dev/ata/chipsets/ata-marvell.c Tue Sep 22 11:47:21 2009 (r197402) @@ -227,6 +227,8 @@ ata_marvell_edma_ch_attach(device_t dev) work = ch->dma.work_bus; /* clear work area */ bzero(ch->dma.work, 1024+256); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* set legacy ATA resources */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { @@ -310,7 +312,11 @@ ata_marvell_edma_ch_attach(device_t dev) static int ata_marvell_edma_ch_detach(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ch->dma.work_tag && ch->dma.work_map) + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); ata_dmafini(dev); return (0); } @@ -344,8 +350,6 @@ ata_marvell_edma_begin_transaction(struc struct ata_channel *ch = device_get_softc(request->parent); u_int32_t req_in; u_int8_t *bytep; - u_int16_t *wordp; - u_int32_t *quadp; int i; int error, slot; @@ -374,13 +378,14 @@ ata_marvell_edma_begin_transaction(struc slot = (((req_in & ~0xfffffc00) >> 5) + 0) & 0x1f; bytep = (u_int8_t *)(ch->dma.work); bytep += (slot << 5); - wordp = (u_int16_t *)bytep; - quadp = (u_int32_t *)bytep; /* fill in this request */ - quadp[0] = (long)request->dma->sg_bus & 0xffffffff; - quadp[1] = (u_int64_t)request->dma->sg_bus >> 32; - wordp[4] = (request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag<<1); + le32enc(bytep + 0 * sizeof(u_int32_t), + request->dma->sg_bus & 0xffffffff); + le32enc(bytep + 1 * sizeof(u_int32_t), + (u_int64_t)request->dma->sg_bus >> 32); + le16enc(bytep + 4 * sizeof(u_int16_t), + (request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag << 1)); i = 10; bytep[i++] = (request->u.ata.count >> 8) & 0xff; @@ -409,6 +414,9 @@ ata_marvell_edma_begin_transaction(struc bytep[i++] = request->u.ata.command; bytep[i++] = 0x90 | ATA_COMMAND; + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* enable EDMA machinery if needed */ if (!(ATA_INL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch)) & 0x00000001)) { ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001); @@ -451,6 +459,8 @@ ata_marvell_edma_end_transaction(struct slot = (((rsp_in & ~0xffffff00) >> 3)) & 0x1f; rsp_out &= 0xffffff00; rsp_out += (slot << 3); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); response = (struct ata_marvell_response *) (ch->dma.work + 1024 + (slot << 3)); @@ -525,6 +535,7 @@ ata_marvell_edma_dmasetprd(void *xsc, bu prd[i].addrlo = htole32(segs[i].ds_addr); prd[i].count = htole32(segs[i].ds_len); prd[i].addrhi = htole32((u_int64_t)segs[i].ds_addr >> 32); + prd[i].reserved = 0; } prd[i - 1].count |= htole32(ATA_DMA_EOT); KASSERT(nsegs <= ATA_DMA_ENTRIES, ("too many DMA segment entries\n")); From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 11:49:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 337901065694; Tue, 22 Sep 2009 11:49:27 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id D919E8FC0A; Tue, 22 Sep 2009 11:49:26 +0000 (UTC) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id 0B3858FC45; Tue, 22 Sep 2009 15:49:25 +0400 (MSD) Date: Tue, 22 Sep 2009 15:49:19 +0400 From: Stanislav Sedov To: Ed Schouten Message-Id: <20090922154919.55abf2f1.stas@FreeBSD.org> In-Reply-To: <200909191756.n8JHuQCq031719@svn.freebsd.org> References: <200909191756.n8JHuQCq031719@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Tue__22_Sep_2009_15_49_19_+0400_tyLY3UbXyPCH787L" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197330 - in head: sys/dev/kbd sys/sys usr.sbin/kbdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 11:49:27 -0000 --Signature=_Tue__22_Sep_2009_15_49_19_+0400_tyLY3UbXyPCH787L Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, 19 Sep 2009 17:56:26 +0000 (UTC) Ed Schouten mentioned: >=20 > Modified: head/sys/sys/kbio.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/kbio.h Sat Sep 19 15:48:59 2009 (r197329) > +++ head/sys/sys/kbio.h Sat Sep 19 17:56:26 2009 (r197330) > @@ -106,7 +106,7 @@ typedef struct keyboard_repeat keyboard_ > #define _KEYMAP_DECLARED > =20 > struct keyent_t { > - u_char map[NUM_STATES]; > + u_int map[NUM_STATES]; > u_char spcl; > u_char flgs; > #define FLAG_LOCK_O 0 Hi, Ed! Can we make this conditional depending on some variable like KBD_UNICODE so it will be possible to avoid the increased memory footprint (24 bytes per entry) in situations where unicode support is not required? Or maybe even have this dynamically allocated? Thanks! --=20 Stanislav Sedov ST4096-RIPE --Signature=_Tue__22_Sep_2009_15_49_19_+0400_tyLY3UbXyPCH787L Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKuLnEAAoJEKN82nOYvCd0iAAP+wai14YbHXCXa401Yjvu54fJ SU4YzY7h5SsEWeYnZ9L/mkgqlc+62LBwO1zr/rm3PBlMIHmkrBzIilvDoEw3tfB2 3mPRwnMMjyqbEAptOBxKKHloGwZHFan6fCmdHBJCe5OLnVQdlZax0qgjwBue6lfG RmrxfSTKiFHDa28wCZhE5JJU3fpc/xHa1jQZRYihmq+lCa5QaXesRNdIa+MbIfzM es63FsgKRw6ADI1bpvU/OGs864p1xpoCr8jnR6e8BBQ3E5RcrJJ3Km4xiK6BeEYJ TtcWj7EJ/sjxM27ee5JxL50s6nORv0KQoue/++L/Raq6/Q7YByt7OXVn687/uxc3 9JY179W98HarLa3SM/HgeNApY9jUEP/VkCQ1i9t88NzMTYvVkc2FAFy1Ku2QE3AY Or7Qieco/31KcLE0bhcW+k4cFiU57MOd+rh3WpqrDdbsi0DwJX1yvQ9z2b77wmin mrwuIAgn7TiwiLPLw499MEiNOeUFvKXKpBWrxK1e/e+0d2DkPOCeTXxinHFr9kRP QLFmn24ndgJlXcKE11fVOU4tUTacTKelPs85mc9WM1gLbs8bgIYy6BCpCbX+T7us MMHUlP19ObnhQAm77x6V29CVkfQNCTd2DhZA07GIAlKs82HrpswIxst1Jnop6Jxw RECFaC5WBY3as5WzUPOX =DjQ7 -----END PGP SIGNATURE----- --Signature=_Tue__22_Sep_2009_15_49_19_+0400_tyLY3UbXyPCH787L-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 12:36:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08390106566B; Tue, 22 Sep 2009 12:36:52 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBDD38FC13; Tue, 22 Sep 2009 12:36:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MCapEo020542; Tue, 22 Sep 2009 12:36:51 GMT (envelope-from cokane@svn.freebsd.org) Received: (from cokane@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MCapHo020541; Tue, 22 Sep 2009 12:36:51 GMT (envelope-from cokane@svn.freebsd.org) Message-Id: <200909221236.n8MCapHo020541@svn.freebsd.org> From: Coleman Kane Date: Tue, 22 Sep 2009 12:36: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: r197403 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 12:36:52 -0000 Author: cokane Date: Tue Sep 22 12:36:51 2009 New Revision: 197403 URL: http://svn.freebsd.org/changeset/base/197403 Log: The ndis_scan function may be started after ndis vap have been destroyed PR: kern/138632 Submitted by: Paul B. Mahol MFC after: 3 days Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Tue Sep 22 11:47:21 2009 (r197402) +++ head/sys/dev/if_ndis/if_ndis.c Tue Sep 22 12:36:51 2009 (r197403) @@ -1012,7 +1012,12 @@ static void ndis_vap_delete(struct ieee80211vap *vap) { struct ndis_vap *nvp = NDIS_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct ifnet *ifp = ic->ic_ifp; + struct ndis_softc *sc = ifp->if_softc; + ndis_stop(sc); + callout_drain(&sc->ndis_scan_callout); ieee80211_vap_detach(vap); free(nvp, M_80211_VAP); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 13:24:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 287EE1065694; Tue, 22 Sep 2009 13:24:00 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 177B08FC18; Tue, 22 Sep 2009 13:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MDNxnX021506; Tue, 22 Sep 2009 13:23:59 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MDNxto021503; Tue, 22 Sep 2009 13:23:59 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <200909221323.n8MDNxto021503@svn.freebsd.org> From: Joel Dahl Date: Tue, 22 Sep 2009 13:23: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: r197404 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 13:24:00 -0000 Author: joel (doc committer) Date: Tue Sep 22 13:23:59 2009 New Revision: 197404 URL: http://svn.freebsd.org/changeset/base/197404 Log: Move es137x.c and es137x.h to a 2-clause BSD license. Also move a few comments. Submitted by: Joachim Kuebart Approved by: core, Russell Cattelan Modified: head/sys/dev/sound/pci/es137x.c head/sys/dev/sound/pci/es137x.h Modified: head/sys/dev/sound/pci/es137x.c ============================================================================== --- head/sys/dev/sound/pci/es137x.c Tue Sep 22 12:36:51 2009 (r197403) +++ head/sys/dev/sound/pci/es137x.c Tue Sep 22 13:23:59 2009 (r197404) @@ -1,10 +1,33 @@ /*- - * Support the ENSONIQ AudioPCI board and Creative Labs SoundBlaster PCI - * boards based on the ES1370, ES1371 and ES1373 chips. - * * Copyright (c) 1999 Russell Cattelan + * Copyright (c) 1998 Joachim Kuebart + * 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. + */ + +/*- * Copyright (c) 1999 Cameron Grant - * Copyright (c) 1998 by Joachim Kuebart. All rights reserved. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,12 +63,14 @@ */ /* + * Support the ENSONIQ AudioPCI board and Creative Labs SoundBlaster PCI + * boards based on the ES1370, ES1371 and ES1373 chips. + * * Part of this code was heavily inspired by the linux driver from * Thomas Sailer (sailer@ife.ee.ethz.ch) * Just about everything has been touched and reworked in some way but * the all the underlying sequences/timing/register values are from * Thomas' code. - * */ #ifdef HAVE_KERNEL_OPTION_HEADERS Modified: head/sys/dev/sound/pci/es137x.h ============================================================================== --- head/sys/dev/sound/pci/es137x.h Tue Sep 22 12:36:51 2009 (r197403) +++ head/sys/dev/sound/pci/es137x.h Tue Sep 22 13:23:59 2009 (r197404) @@ -1,26 +1,21 @@ /*- - * This supports the ENSONIQ AudioPCI board based on the ES1370. - * - * Copyright (c) 1998 Joachim Kuebart + * Copyright (c) 1998 Joachim Kuebart * 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 immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Absolutely no warranty of function or purpose is made by the author - * Joachim Kuebart. - * 4. Modifications may be freely made to this file if the above conditions - * are met. * * $FreeBSD$ */ +/* This supports the ENSONIQ AudioPCI board based on the ES1370. */ + #ifndef _ES1370_REG_H #define _ES1370_REG_H From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 13:38:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484251065695; Tue, 22 Sep 2009 13:38:00 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.82]) by mx1.freebsd.org (Postfix) with ESMTP id 016CB8FC28; Tue, 22 Sep 2009 13:37:59 +0000 (UTC) Received: from iMac.local (pgw.vnode.se [77.110.37.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 805DEE9F42C; Tue, 22 Sep 2009 15:37:58 +0200 (CEST) Message-ID: <4AB8D335.5040205@FreeBSD.org> Date: Tue, 22 Sep 2009 15:37:57 +0200 From: Joel Dahl User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200909221323.n8MDNxto021503@svn.freebsd.org> In-Reply-To: <200909221323.n8MDNxto021503@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r197404 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 13:38:00 -0000 Joel Dahl skrev: > Author: joel (doc committer) > Date: Tue Sep 22 13:23:59 2009 > New Revision: 197404 > URL: http://svn.freebsd.org/changeset/base/197404 > > Log: > Move es137x.c and es137x.h to a 2-clause BSD license. Also move a few > comments. There is still a 4-clause BSD license in es137x.c. Not sure if we can do anything about it, since Cameron passed away a few years ago. Joachim originally wrote this driver and later on Russel added support for ES1371. Cameron introduced the driver for the newpcm world, which is also when he added his name to the already existing 4-clause copyright text (Cameron always used our standard 2-clause BSD license for everything else in the sound/ area, with this file being the only exception, I think). -- Joel From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 13:44:44 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B04FA106566B; Tue, 22 Sep 2009 13:44:44 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 645BB8FC19; Tue, 22 Sep 2009 13:44:44 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n8MDihG7008811 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Sep 2009 09:44:43 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n8MDihG7008811 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1253627083; bh=ipLbrohWHpuIS1F/YNaCSAijjD6N8X4sYFN342HQD3Y=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=CXzi1Rt4eWF8V3a6UgM+v8lsToGpCwI+opS7m/CoJOVBlhYEOx/8S5i/YCWae8qNc iLkVnMGj3TUt4coPHQbvz2MvA6+3mEEd3uXt2lVeiVJg0KKG99RaoZ9rW2pwSBU4B7 hllx/GH1JRl2Tu4YERkBJ8YOM2ApcyXuXkez3XqI= Message-ID: <4AB8D4C4.8090604@cs.duke.edu> Date: Tue, 22 Sep 2009 09:44:36 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Robert Watson References: <200909211441.n8LEf721092082@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197391 - head/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 13:44:44 -0000 Robert Watson wrote: > > On Mon, 21 Sep 2009, Andrew Gallatin wrote: > >> Add support for throttling transmit bandwidth. This is most commonly >> used to reduce packet loss on high delay (WAN) paths with a >> slow link. > > Hi Drew-- > > Could you say a little more about the situations in which this is used? > I see (or think I see) that the card supports internal throttling, but As you say, the card supports it, and I ported it from our Linux and Solaris drivers because we've had a few requests for it. I don't pretend to know a lot about WAN tuning, but our Linux customers claim this works better for them than the Linux host based traffic shaping. > is there a reason, other than the hardware supporting it, for not to do > something like this higher in the stack before cycles are burned and PCI > bus bandwidth has been wasted? This throttling increases neither CPU usage nor PCI bus bandwidth usage. It uses a very simple mechanism of having the NIC insert delays between issuing PCIe DMA reads (its slightly more complex than this, but that's the easiest way to think of it). This decreases the maximum transmit bandwidth opaquely to the host. Throttle it enough, and it is almost as if you placed the NIC into a slower PCIe slot. The key is that only DMA reads are slowed, so the NIC can still receive at full bandwidth. The advantage over host based traffic shaping is that no software in the host is involved, so it uses no host CPU. It is also effective at throttling TCP connections where TSO is in use. This means you don't either have to disable TSO, or worry about 64KB bursts at full bandwidth like you would with a host based traffic shaping solution. In addition to WAN scenarios, I should also have mentioned that it is useful in LAN scenarios. Picture a cluster of machines based around some PCIe chipset which has an unbalanced read/write DMA performance (the HT2000 is one such chipset which can send at line rate, but can only receive at 7Gb/s). If link level flow control is not effective then you wind up with massive packet loss. TCP can sometimes deal with this, but UDP is just miserable when you have a steady state where the sender can send faster than the receiver can receive. In fact, one of the scenarios where this was most helpful was a project where data was being collected on machine A, and forwarded to machine B via UDP. For security reasons, the physical link was simplex (only one physical fiber between the TX laser on A and RX on B), so neither TCP, nor link level flow control was possible. These were also "unbalanced" machines. Drew From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 15:15:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 988E61065694; Tue, 22 Sep 2009 15:15:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 858C78FC0A; Tue, 22 Sep 2009 15:15:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MFF3Cv023771; Tue, 22 Sep 2009 15:15:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MFF3Ei023762; Tue, 22 Sep 2009 15:15:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200909221515.n8MFF3Ei023762@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 Sep 2009 15:15: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: r197405 - in head: share/man/man9 sys/conf sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 15:15:03 -0000 Author: trasz Date: Tue Sep 22 15:15:03 2009 New Revision: 197405 URL: http://svn.freebsd.org/changeset/base/197405 Log: Add pieces of infrastructure required for NFSv4 ACL support in UFS. Reviewed by: rwatson Added: head/share/man/man9/vaccess_acl_nfs4.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/VOP_ACCESS.9 head/share/man/man9/acl.9 head/share/man/man9/vaccess.9 head/sys/conf/files head/sys/kern/subr_acl_nfs4.c head/sys/sys/vnode.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Sep 22 13:23:59 2009 (r197404) +++ head/share/man/man9/Makefile Tue Sep 22 15:15:03 2009 (r197405) @@ -253,6 +253,7 @@ MAN= accept_filter.9 \ usbdi.9 \ utopia.9 \ vaccess.9 \ + vaccess_acl_nfs4.9 \ vaccess_acl_posix1e.9 \ vcount.9 \ vflush.9 \ Modified: head/share/man/man9/VOP_ACCESS.9 ============================================================================== --- head/share/man/man9/VOP_ACCESS.9 Tue Sep 22 13:23:59 2009 (r197404) +++ head/share/man/man9/VOP_ACCESS.9 Tue Sep 22 15:15:03 2009 (r197405) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2009 +.Dd September 18, 2009 .Os .Dt VOP_ACCESS 9 .Sh NAME @@ -95,6 +95,7 @@ requested access. .El .Sh SEE ALSO .Xr vaccess 9 , +.Xr vaccess_acl_nfs4 9 , .Xr vaccess_acl_posix1e 9 , .Xr vnode 9 .Sh AUTHORS Modified: head/share/man/man9/acl.9 ============================================================================== --- head/share/man/man9/acl.9 Tue Sep 22 13:23:59 2009 (r197404) +++ head/share/man/man9/acl.9 Tue Sep 22 15:15:03 2009 (r197405) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 1999 +.Dd September 18, 2009 .Os .Dt ACL 9 .Sh NAME @@ -207,6 +207,7 @@ The following values are valid: .El .Sh SEE ALSO .Xr acl 3 , +.Xr vaccess_acl_nfs4 9 , .Xr vaccess_acl_posix1e 9 , .Xr VFS 9 , .Xr vnaccess 9 , Modified: head/share/man/man9/vaccess.9 ============================================================================== --- head/share/man/man9/vaccess.9 Tue Sep 22 13:23:59 2009 (r197404) +++ head/share/man/man9/vaccess.9 Tue Sep 22 15:15:03 2009 (r197405) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2001 +.Dd September 18, 2009 .Os .Dt VACCESS 9 .Sh NAME @@ -117,6 +117,7 @@ An attempt was made to perform an operat appropriate privileges or to the owner of a file or other resource. .El .Sh SEE ALSO +.Xr vaccess_acl_nfs4 9 , .Xr vaccess_acl_posix1e 9 , .Xr vnode 9 , .Xr VOP_ACCESS 9 Added: head/share/man/man9/vaccess_acl_nfs4.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/vaccess_acl_nfs4.9 Tue Sep 22 15:15:03 2009 (r197405) @@ -0,0 +1,129 @@ +.\"- +.\" Copyright (c) 2001 Robert N. M. Watson +.\" 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 September 18, 2009 +.Os +.Dt VACCESS_ACL_NFS4 9 +.Sh NAME +.Nm vaccess_acl_nfs4 +.Nd generate a NFSv4 ACL access control decision using vnode parameters +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.In sys/acl.h +.Ft int +.Fo vaccess_acl_nfs4 +.Fa "enum vtype type" +.Fa "uid_t file_uid" +.Fa "gid_t file_gid" +.Fa "struct acl *acl" +.Fa "accmode_t accmode" +.Fa "struct ucred *cred" +.Fa "int *privused" +.Fc +.Sh DESCRIPTION +This call implements the logic for the +.Ux +discretionary file security model +with NFSv4 ACL extensions. +It accepts the vnodes type +.Fa type , +owning UID +.Fa file_uid , +owning GID +.Fa file_gid , +access ACL for the file +.Fa acl , +desired access mode +.Fa accmode , +requesting credential +.Fa cred , +and an optional call-by-reference +.Vt int +pointer returning whether or not +privilege was required for successful evaluation of the call; the +.Fa privused +pointer may be set to +.Dv NULL +by the caller in order not to be informed of +privilege information, or it may point to an integer that will be set to +1 if privilege is used, and 0 otherwise. +.Pp +This call is intended to support implementations of +.Xr VOP_ACCESS 9 , +which will use their own access methods to retrieve the vnode properties, +and then invoke +.Fn vaccess_acl_nfs4 +in order to perform the actual check. +Implementations of +.Xr VOP_ACCESS 9 +may choose to implement additional security mechanisms whose results will +be composed with the return value. +.Pp +The algorithm used by +.Fn vaccess_acl_nfs4 +is based on the NFSv4 ACL evaluation algorithm, as described in +NFSv4 Minor Version 1, draft-ietf-nfsv4-minorversion1-21.txt. +The algorithm selects a +.Em matching +entry from the access ACL, which may +then be composed with an available ACL mask entry, providing +.Ux +security compatibility. +.Pp +Once appropriate protections are selected for the current credential, +the requested access mode, in combination with the vnode type, will be +compared with the discretionary rights available for the credential. +If the rights granted by discretionary protections are insufficient, +then super-user privilege, if available for the credential, will also be +considered. +.Sh RETURN VALUES +.Fn vaccess_acl_nfs4 +will return 0 on success, or a non-zero error value on failure. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EACCES +Permission denied. +An attempt was made to access a file in a way forbidden by its file access +permissions. +.It Bq Er EPERM +Operation not permitted. +An attempt was made to perform an operation limited to processes with +appropriate privileges or to the owner of a file or other resource. +.El +.Sh SEE ALSO +.Xr vaccess 9 , +.Xr vnode 9 , +.Xr VOP_ACCESS 9 +.Sh AUTHORS +Current implementation of +.Fn vaccess_acl_nfs4 +was written by +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org . +.Sh BUGS +This manual page should include a full description of the NFSv4 ACL +evaluation algorithm, or cross reference another page that does. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 22 13:23:59 2009 (r197404) +++ head/sys/conf/files Tue Sep 22 15:15:03 2009 (r197405) @@ -2009,6 +2009,7 @@ kern/sched_ule.c optional sched_ule kern/serdev_if.m standard kern/stack_protector.c standard \ compile-with "${NORMAL_C:N-fstack-protector*}" +kern/subr_acl_nfs4.c standard kern/subr_acl_posix1e.c standard kern/subr_autoconf.c standard kern/subr_blist.c standard Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Tue Sep 22 13:23:59 2009 (r197404) +++ head/sys/kern/subr_acl_nfs4.c Tue Sep 22 15:15:03 2009 (r197405) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008 Edward Tomasz NapieraÅ‚a + * Copyright (c) 2008-2009 Edward Tomasz NapieraÅ‚a * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,213 @@ __FBSDID("$FreeBSD$"); #include #define KASSERT(a, b) assert(a) #define CTASSERT(a) -#endif +#endif /* _KERNEL */ + +#ifdef _KERNEL + +static struct { + accmode_t accmode; + int mask; +} accmode2mask[] = {{VREAD, ACL_READ_DATA}, + {VWRITE, ACL_WRITE_DATA}, + {VAPPEND, ACL_APPEND_DATA}, + {VEXEC, ACL_EXECUTE}, + {VREAD_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, + {VWRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, + {VDELETE_CHILD, ACL_DELETE_CHILD}, + {VREAD_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {VWRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {VDELETE, ACL_DELETE}, + {VREAD_ACL, ACL_READ_ACL}, + {VWRITE_ACL, ACL_WRITE_ACL}, + {VWRITE_OWNER, ACL_WRITE_OWNER}, + {VSYNCHRONIZE, ACL_SYNCHRONIZE}, + {0, 0}}; + +static int +_access_mask_from_accmode(accmode_t accmode) +{ + int access_mask = 0, i; + + for (i = 0; accmode2mask[i].accmode != 0; i++) { + if (accmode & accmode2mask[i].accmode) + access_mask |= accmode2mask[i].mask; + } + + return (access_mask); +} + +/* + * Return 0, iff access is allowed, 1 otherwise. + */ +static int +_acl_denies(const struct acl *aclp, int access_mask, struct ucred *cred, + int file_uid, int file_gid, int *denied_explicitly) +{ + int i; + const struct acl_entry *entry; + + if (denied_explicitly != NULL) + *denied_explicitly = 0; + + KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); + KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, + ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); + + for (i = 0; i < aclp->acl_cnt; i++) { + entry = &(aclp->acl_entry[i]); + + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW && + entry->ae_entry_type != ACL_ENTRY_TYPE_DENY) + continue; + if (entry->ae_flags & ACL_ENTRY_INHERIT_ONLY) + continue; + switch (entry->ae_tag) { + case ACL_USER_OBJ: + if (file_uid != cred->cr_uid) + continue; + break; + case ACL_USER: + if (entry->ae_id != cred->cr_uid) + continue; + break; + case ACL_GROUP_OBJ: + if (!groupmember(file_gid, cred)) + continue; + break; + case ACL_GROUP: + if (!groupmember(entry->ae_id, cred)) + continue; + break; + default: + KASSERT(entry->ae_tag == ACL_EVERYONE, + ("entry->ae_tag == ACL_EVERYONE")); + } + + if (entry->ae_entry_type == ACL_ENTRY_TYPE_DENY) { + if (entry->ae_perm & access_mask) { + if (denied_explicitly != NULL) + *denied_explicitly = 1; + return (1); + } + } + + access_mask &= ~(entry->ae_perm); + if (access_mask == 0) + return (0); + } + + return (1); +} + +int +vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, + struct acl *aclp, accmode_t accmode, struct ucred *cred, int *privused) +{ + accmode_t priv_granted = 0; + int denied, explicitly_denied, access_mask, is_directory, + must_be_owner = 0; + + if (privused != NULL) + *privused = 0; + + if (accmode & VADMIN) + must_be_owner = 1; + + /* + * Ignore VSYNCHRONIZE permission. + */ + accmode &= ~VSYNCHRONIZE; + + access_mask = _access_mask_from_accmode(accmode); + + if (type == VDIR) + is_directory = 1; + else + is_directory = 0; + + /* + * File owner is always allowed to read and write the ACL + * and basic attributes. This is to prevent a situation + * where user would change ACL in a way that prevents him + * from undoing the change. + */ + if (file_uid == cred->cr_uid) + access_mask &= ~(ACL_READ_ACL | ACL_WRITE_ACL | + ACL_READ_ATTRIBUTES | ACL_WRITE_ATTRIBUTES); + + /* + * Ignore append permission for regular files; use write + * permission instead. + */ + if (!is_directory && (access_mask & ACL_APPEND_DATA)) { + access_mask &= ~ACL_APPEND_DATA; + access_mask |= ACL_WRITE_DATA; + } + + denied = _acl_denies(aclp, access_mask, cred, file_uid, file_gid, + &explicitly_denied); + + if (must_be_owner) { + if (file_uid != cred->cr_uid) + denied = EPERM; + } + + if (!denied) + return (0); + + /* + * Access failed. Iff it was not denied explicitly and + * VEXPLICIT_DENY flag was specified, allow access. + */ + if ((accmode & VEXPLICIT_DENY) && explicitly_denied == 0) + return (0); + + accmode &= ~VEXPLICIT_DENY; + + /* + * No match. Try to use privileges, if there are any. + */ + if (is_directory) { + if ((accmode & VEXEC) && !priv_check_cred(cred, + PRIV_VFS_LOOKUP, 0)) + priv_granted |= VEXEC; + } else { + if ((accmode & VEXEC) && !priv_check_cred(cred, + PRIV_VFS_EXEC, 0)) + priv_granted |= VEXEC; + } + + if ((accmode & VREAD) && !priv_check_cred(cred, PRIV_VFS_READ, 0)) + priv_granted |= VREAD; + + if ((accmode & (VWRITE | VAPPEND | VDELETE_CHILD)) && + !priv_check_cred(cred, PRIV_VFS_WRITE, 0)) + priv_granted |= (VWRITE | VAPPEND | VDELETE_CHILD); + + if ((accmode & VADMIN_PERMS) && + !priv_check_cred(cred, PRIV_VFS_ADMIN, 0)) + priv_granted |= VADMIN_PERMS; + + if ((accmode & VSTAT_PERMS) && + !priv_check_cred(cred, PRIV_VFS_STAT, 0)) + priv_granted |= VSTAT_PERMS; + + if ((accmode & priv_granted) == accmode) { + if (privused != NULL) + *privused = 1; + + return (0); + } + + if (accmode & (VADMIN_PERMS | VDELETE_CHILD | VDELETE)) + denied = EPERM; + else + denied = EACCES; + + return (denied); +} +#endif /* _KERNEL */ static int _acl_entry_matches(struct acl_entry *entry, acl_tag_t tag, acl_perm_t perm, @@ -577,3 +783,290 @@ acl_nfs4_sync_mode_from_acl(mode_t *_mod *_mode = mode | (old_mode & ACL_PRESERVE_MASK); } + +void +acl_nfs4_compute_inherited_acl(const struct acl *parent_aclp, + struct acl *child_aclp, mode_t mode, int file_owner_id, + int is_directory) +{ + int i, flags; + const struct acl_entry *parent_entry; + struct acl_entry *entry, *copy; + + KASSERT(child_aclp->acl_cnt == 0, ("child_aclp->acl_cnt == 0")); + KASSERT(parent_aclp->acl_cnt > 0, ("parent_aclp->acl_cnt > 0")); + KASSERT(parent_aclp->acl_cnt <= ACL_MAX_ENTRIES, + ("parent_aclp->acl_cnt <= ACL_MAX_ENTRIES")); + + /* + * NFSv4 Minor Version 1, draft-ietf-nfsv4-minorversion1-03.txt + * + * 3.16.6.2. Applying the mode given to CREATE or OPEN + * to an inherited ACL + */ + + /* + * 1. Form an ACL that is the concatenation of all inheritable ACEs. + */ + for (i = 0; i < parent_aclp->acl_cnt; i++) { + parent_entry = &(parent_aclp->acl_entry[i]); + flags = parent_entry->ae_flags; + + /* + * Entry is not inheritable at all. + */ + if ((flags & (ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_FILE_INHERIT)) == 0) + continue; + + /* + * We're creating a file, but entry is not inheritable + * by files. + */ + if (!is_directory && (flags & ACL_ENTRY_FILE_INHERIT) == 0) + continue; + + /* + * Entry is inheritable only by files, but has NO_PROPAGATE + * flag set, and we're creating a directory, so it wouldn't + * propagate to any file in that directory anyway. + */ + if (is_directory && + (flags & ACL_ENTRY_DIRECTORY_INHERIT) == 0 && + (flags & ACL_ENTRY_NO_PROPAGATE_INHERIT)) + continue; + + KASSERT(child_aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES, + ("child_aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES")); + child_aclp->acl_entry[child_aclp->acl_cnt] = *parent_entry; + child_aclp->acl_cnt++; + } + + /* + * 2. For each entry in the new ACL, adjust its flags, possibly + * creating two entries in place of one. + */ + for (i = 0; i < child_aclp->acl_cnt; i++) { + entry = &(child_aclp->acl_entry[i]); + + /* + * This is not in the specification, but SunOS + * apparently does that. + */ + if (((entry->ae_flags & ACL_ENTRY_NO_PROPAGATE_INHERIT) || + !is_directory) && + entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW) + entry->ae_perm &= ~(ACL_WRITE_ACL | ACL_WRITE_OWNER); + + /* + * 2.A. If the ACL_ENTRY_NO_PROPAGATE_INHERIT is set, or if the object + * being created is not a directory, then clear the + * following flags: ACL_ENTRY_NO_PROPAGATE_INHERIT, + * ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT, + * ACL_ENTRY_INHERIT_ONLY. + */ + if (entry->ae_flags & ACL_ENTRY_NO_PROPAGATE_INHERIT || + !is_directory) { + entry->ae_flags &= ~(ACL_ENTRY_NO_PROPAGATE_INHERIT | + ACL_ENTRY_FILE_INHERIT | ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_INHERIT_ONLY); + + /* + * Continue on to the next ACE. + */ + continue; + } + + /* + * 2.B. If the object is a directory and ACL_ENTRY_FILE_INHERIT + * is set, but ACL_ENTRY_NO_PROPAGATE_INHERIT is not set, ensure + * that ACL_ENTRY_INHERIT_ONLY is set. Continue to the + * next ACE. Otherwise... + */ + /* + * XXX: Read it again and make sure what does the "otherwise" + * apply to. + */ + if (is_directory && + (entry->ae_flags & ACL_ENTRY_FILE_INHERIT) && + ((entry->ae_flags & ACL_ENTRY_DIRECTORY_INHERIT) == 0)) { + entry->ae_flags |= ACL_ENTRY_INHERIT_ONLY; + continue; + } + + /* + * 2.C. If the type of the ACE is neither ALLOW nor deny, + * then continue. + */ + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW && + entry->ae_entry_type != ACL_ENTRY_TYPE_DENY) + continue; + + /* + * 2.D. Copy the original ACE into a second, adjacent ACE. + */ + copy = _acl_duplicate_entry(child_aclp, i); + + /* + * 2.E. On the first ACE, ensure that ACL_ENTRY_INHERIT_ONLY + * is set. + */ + entry->ae_flags |= ACL_ENTRY_INHERIT_ONLY; + + /* + * 2.F. On the second ACE, clear the following flags: + * ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_FILE_INHERIT, + * ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_INHERIT_ONLY. + */ + copy->ae_flags &= ~(ACL_ENTRY_NO_PROPAGATE_INHERIT | + ACL_ENTRY_FILE_INHERIT | ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_INHERIT_ONLY); + + /* + * 2.G. On the second ACE, if the type is ALLOW, + * an implementation MAY clear the following + * mask bits: ACL_WRITE_ACL, ACL_WRITE_OWNER. + */ + if (copy->ae_entry_type == ACL_ENTRY_TYPE_ALLOW) + copy->ae_perm &= ~(ACL_WRITE_ACL | ACL_WRITE_OWNER); + + /* + * Increment the counter to skip the copied entry. + */ + i++; + } + + /* + * 3. To ensure that the mode is honored, apply the algorithm describe + * in Section 2.16.6.3, using the mode that is to be used for file + * creation. + */ + acl_nfs4_sync_acl_from_mode(child_aclp, mode, file_owner_id); +} + +#ifdef _KERNEL +static int +_acls_are_equal(const struct acl *a, const struct acl *b) +{ + int i; + const struct acl_entry *entrya, *entryb; + + if (a->acl_cnt != b->acl_cnt) + return (0); + + for (i = 0; i < b->acl_cnt; i++) { + entrya = &(a->acl_entry[i]); + entryb = &(b->acl_entry[i]); + + if (entrya->ae_tag != entryb->ae_tag || + entrya->ae_id != entryb->ae_id || + entrya->ae_perm != entryb->ae_perm || + entrya->ae_entry_type != entryb->ae_entry_type || + entrya->ae_flags != entryb->ae_flags) + return (0); + } + + return (1); +} + +/* + * This routine is used to determine whether to remove entry_type attribute + * that stores ACL contents. + */ +int +acl_nfs4_is_trivial(const struct acl *aclp, int file_owner_id) +{ + int trivial; + mode_t tmpmode = 0; + struct acl *tmpaclp; + + if (aclp->acl_cnt != 6) + return (0); + + /* + * Compute the mode from the ACL, then compute new ACL from that mode. + * If the ACLs are identical, then the ACL is trivial. + * + * XXX: I guess there is a faster way to do this. However, even + * this slow implementation significantly speeds things up + * for files that don't have any entry_type ACL entries - it's + * critical for performance to not use EA when they are not + * needed. + */ + tmpaclp = acl_alloc(M_WAITOK | M_ZERO); + acl_nfs4_sync_mode_from_acl(&tmpmode, aclp); + acl_nfs4_sync_acl_from_mode(tmpaclp, tmpmode, file_owner_id); + trivial = _acls_are_equal(aclp, tmpaclp); + acl_free(tmpaclp); + + return (trivial); +} +#endif /* _KERNEL */ + +int +acl_nfs4_check(const struct acl *aclp, int is_directory) +{ + int i; + const struct acl_entry *entry; + + /* + * The spec doesn't seem to say anything about ACL validity. + * It seems there is not much to do here. There is even no need + * to count "owner@" or "everyone@" (ACL_USER_OBJ and ACL_EVERYONE) + * entries, as there can be several of them and that's perfectly + * valid. There can be none of them too. Really. + */ + + if (aclp->acl_cnt > ACL_MAX_ENTRIES || aclp->acl_cnt <= 0) + return (EINVAL); + + for (i = 0; i < aclp->acl_cnt; i++) { + entry = &(aclp->acl_entry[i]); + + switch (entry->ae_tag) { + case ACL_USER_OBJ: + case ACL_GROUP_OBJ: + case ACL_EVERYONE: + if (entry->ae_id != ACL_UNDEFINED_ID) + return (EINVAL); + break; + + case ACL_USER: + case ACL_GROUP: + if (entry->ae_id == ACL_UNDEFINED_ID) + return (EINVAL); + break; + + default: + return (EINVAL); + } + + if ((entry->ae_perm | ACL_NFS4_PERM_BITS) != ACL_NFS4_PERM_BITS) + return (EINVAL); + + /* + * Disallow ACL_ENTRY_TYPE_AUDIT and ACL_ENTRY_TYPE_ALARM for now. + */ + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW && + entry->ae_entry_type != ACL_ENTRY_TYPE_DENY) + return (EINVAL); + + if ((entry->ae_flags | ACL_FLAGS_BITS) != ACL_FLAGS_BITS) + return (EINVAL); + + /* Disallow unimplemented flags. */ + if (entry->ae_flags & (ACL_ENTRY_SUCCESSFUL_ACCESS | + ACL_ENTRY_FAILED_ACCESS)) + return (EINVAL); + + /* Disallow flags not allowed for ordinary files. */ + if (!is_directory) { + if (entry->ae_flags & (ACL_ENTRY_FILE_INHERIT | + ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_NO_PROPAGATE_INHERIT | ACL_ENTRY_INHERIT_ONLY)) + return (EINVAL); + } + } + + return (0); +} Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Sep 22 13:23:59 2009 (r197404) +++ head/sys/sys/vnode.h Tue Sep 22 15:15:03 2009 (r197405) @@ -614,6 +614,9 @@ int vn_commname(struct vnode *vn, char * int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, accmode_t accmode, struct ucred *cred, int *privused); +int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, + struct acl *aclp, accmode_t accmode, struct ucred *cred, + int *privused); int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, struct acl *acl, accmode_t accmode, struct ucred *cred, int *privused); From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 15:43:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1684B106566B; Tue, 22 Sep 2009 15:43:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0614C8FC14; Tue, 22 Sep 2009 15:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MFh37S024306; Tue, 22 Sep 2009 15:43:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MFh3ZO024304; Tue, 22 Sep 2009 15:43:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909221543.n8MFh3ZO024304@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Sep 2009 15:43: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: r197406 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 15:43:04 -0000 Author: jhb Date: Tue Sep 22 15:43:03 2009 New Revision: 197406 URL: http://svn.freebsd.org/changeset/base/197406 Log: Don't reread the command register to see if enabling I/O or memory decoding "took". Other OS's that I checked do not do this and it breaks some amdpm(4) devices. Prior to 7.2 we did not honor the error returned when this failed anyway, so this in effect restores previous behavior. PR: kern/137668 Tested by: Aurelien Mere aurelien.mere amc-os.com MFC after: 3 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Sep 22 15:15:03 2009 (r197405) +++ head/sys/dev/pci/pci.c Tue Sep 22 15:43:03 2009 (r197406) @@ -2149,62 +2149,38 @@ pci_disable_busmaster_method(device_t de int pci_enable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_set_command_bit(dev, child, bit); - /* Some devices seem to need a brief stall here, what do to? */ - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) - return (0); - device_printf(child, "failed to enable %s mapping!\n", error); - return (ENXIO); + return (0); } int pci_disable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_clear_command_bit(dev, child, bit); - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) { - device_printf(child, "failed to disable %s mapping!\n", error); - return (ENXIO); - } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 16:16:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97D371065676; Tue, 22 Sep 2009 16:16:02 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86E768FC0C; Tue, 22 Sep 2009 16:16:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MGG2H7024915; Tue, 22 Sep 2009 16:16:02 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MGG2bB024912; Tue, 22 Sep 2009 16:16:02 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200909221616.n8MGG2bB024912@svn.freebsd.org> From: Roman Divacky Date: Tue, 22 Sep 2009 16:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197407 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 16:16:02 -0000 Author: rdivacky Date: Tue Sep 22 16:16:02 2009 New Revision: 197407 URL: http://svn.freebsd.org/changeset/base/197407 Log: Change unsigned foo to u_foo as required by style(9). Requested by: bde Approved by: ed (mentor) Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Tue Sep 22 15:43:03 2009 (r197406) +++ head/sys/kern/kern_event.c Tue Sep 22 16:16:02 2009 (r197407) @@ -146,7 +146,7 @@ static int filt_userattach(struct knote static void filt_userdetach(struct knote *kn); static int filt_user(struct knote *kn, long hint); static void filt_usertouch(struct knote *kn, struct kevent *kev, - unsigned long type); + u_long type); static struct filterops file_filtops = { .f_isfd = 1, @@ -617,9 +617,9 @@ filt_user(struct knote *kn, __unused lon } static void -filt_usertouch(struct knote *kn, struct kevent *kev, unsigned long type) +filt_usertouch(struct knote *kn, struct kevent *kev, u_long type) { - unsigned int ffctrl; + u_int ffctrl; switch (type) { case EVENT_REGISTER: Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Tue Sep 22 15:43:03 2009 (r197406) +++ head/sys/sys/event.h Tue Sep 22 16:16:02 2009 (r197407) @@ -191,8 +191,7 @@ struct filterops { int (*f_attach)(struct knote *kn); void (*f_detach)(struct knote *kn); int (*f_event)(struct knote *kn, long hint); - void (*f_touch)(struct knote *kn, struct kevent *kev, - unsigned long type); + void (*f_touch)(struct knote *kn, struct kevent *kev, u_long type); }; /* From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 16:22:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA56A106566B; Tue, 22 Sep 2009 16:22:05 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 999748FC17; Tue, 22 Sep 2009 16:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MGM5f5025139; Tue, 22 Sep 2009 16:22:05 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MGM5WK025136; Tue, 22 Sep 2009 16:22:05 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200909221622.n8MGM5WK025136@svn.freebsd.org> From: Roman Divacky Date: Tue, 22 Sep 2009 16:22: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: r197408 - in head/sys: conf ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 16:22:05 -0000 Author: rdivacky Date: Tue Sep 22 16:22:05 2009 New Revision: 197408 URL: http://svn.freebsd.org/changeset/base/197408 Log: Don't build ufs_gjournal.c at all if UFS_GJOURNAL option is not given instead of building an almost empty C file. Approved by: pjd Approved by: ed (mentor, implicit) Modified: head/sys/conf/files head/sys/ufs/ufs/ufs_gjournal.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 22 16:16:02 2009 (r197407) +++ head/sys/conf/files Tue Sep 22 16:22:05 2009 (r197408) @@ -2634,7 +2634,7 @@ ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs ufs/ufs/ufs_dirhash.c optional ffs ufs/ufs/ufs_extattr.c optional ffs -ufs/ufs/ufs_gjournal.c optional ffs +ufs/ufs/ufs_gjournal.c optional ffs UFS_GJOURNAL ufs/ufs/ufs_inode.c optional ffs ufs/ufs/ufs_lookup.c optional ffs ufs/ufs/ufs_quota.c optional ffs Modified: head/sys/ufs/ufs/ufs_gjournal.c ============================================================================== --- head/sys/ufs/ufs/ufs_gjournal.c Tue Sep 22 16:16:02 2009 (r197407) +++ head/sys/ufs/ufs/ufs_gjournal.c Tue Sep 22 16:22:05 2009 (r197408) @@ -29,8 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ufs.h" -#ifdef UFS_GJOURNAL - #include #include #include @@ -137,5 +135,3 @@ ufs_gjournal_close(struct vnode *vp) return; ufs_gjournal_modref(vp, -1); } - -#endif /* UFS_GJOURNAL */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 16:28:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED75E106566C; Tue, 22 Sep 2009 16:28:07 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C276A8FC16; Tue, 22 Sep 2009 16:28:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MGS7fm025281; Tue, 22 Sep 2009 16:28:07 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MGS72v025276; Tue, 22 Sep 2009 16:28:07 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200909221628.n8MGS72v025276@svn.freebsd.org> From: Roman Divacky Date: Tue, 22 Sep 2009 16:28: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: r197409 - in head/sys/dev: twa twe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 16:28:08 -0000 Author: rdivacky Date: Tue Sep 22 16:28:07 2009 New Revision: 197409 URL: http://svn.freebsd.org/changeset/base/197409 Log: Change the command argument to ioctl routines to u_long to avoid truncating the command to 32bit on 64bit archs where int is 32bit (ie. amd64). Approved by: scottl Approved by: ed (mentor, implicit) Modified: head/sys/dev/twa/tw_cl_io.c head/sys/dev/twa/tw_cl_share.h head/sys/dev/twe/twe.c head/sys/dev/twe/twevar.h Modified: head/sys/dev/twa/tw_cl_io.c ============================================================================== --- head/sys/dev/twa/tw_cl_io.c Tue Sep 22 16:22:05 2009 (r197408) +++ head/sys/dev/twa/tw_cl_io.c Tue Sep 22 16:28:07 2009 (r197409) @@ -396,7 +396,7 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand * non-zero-- failure */ TW_INT32 -tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, TW_INT32 cmd, TW_VOID *buf) +tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf) { struct tw_cli_ctlr_context *ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); Modified: head/sys/dev/twa/tw_cl_share.h ============================================================================== --- head/sys/dev/twa/tw_cl_share.h Tue Sep 22 16:22:05 2009 (r197408) +++ head/sys/dev/twa/tw_cl_share.h Tue Sep 22 16:28:07 2009 (r197409) @@ -565,7 +565,7 @@ extern TW_INT32 tw_cl_interrupt(struct t /* CL's ioctl handler. */ extern TW_INT32 tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, - TW_INT32 cmd, TW_VOID *buf); + u_long cmd, TW_VOID *buf); #ifdef TW_OSL_DEBUG Modified: head/sys/dev/twe/twe.c ============================================================================== --- head/sys/dev/twe/twe.c Tue Sep 22 16:22:05 2009 (r197408) +++ head/sys/dev/twe/twe.c Tue Sep 22 16:28:07 2009 (r197409) @@ -487,7 +487,7 @@ twe_dump_blocks(struct twe_softc *sc, in * Handle controller-specific control operations. */ int -twe_ioctl(struct twe_softc *sc, int ioctlcmd, void *addr) +twe_ioctl(struct twe_softc *sc, u_long ioctlcmd, void *addr) { struct twe_usercommand *tu = (struct twe_usercommand *)addr; struct twe_paramcommand *tp = (struct twe_paramcommand *)addr; Modified: head/sys/dev/twe/twevar.h ============================================================================== --- head/sys/dev/twe/twevar.h Tue Sep 22 16:22:05 2009 (r197408) +++ head/sys/dev/twe/twevar.h Tue Sep 22 16:28:07 2009 (r197409) @@ -150,7 +150,7 @@ extern void twe_startio(struct twe_softc extern int twe_start(struct twe_request *tr); extern int twe_dump_blocks(struct twe_softc *sc, int unit, /* crashdump block write */ u_int32_t lba, void *data, int nblks); -extern int twe_ioctl(struct twe_softc *sc, int cmd, +extern int twe_ioctl(struct twe_softc *sc, u_long cmd, void *addr); /* handle user request */ extern void twe_describe_controller(struct twe_softc *sc); /* print controller info */ extern void twe_print_controller(struct twe_softc *sc); From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 16:51:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBBF41065672; Tue, 22 Sep 2009 16:51:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA2FF8FC1F; Tue, 22 Sep 2009 16:51:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MGp0WK025740; Tue, 22 Sep 2009 16:51:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MGp0sX025737; Tue, 22 Sep 2009 16:51:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909221651.n8MGp0sX025737@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Sep 2009 16:51: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: r197410 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 16:51:00 -0000 Author: jhb Date: Tue Sep 22 16:51:00 2009 New Revision: 197410 URL: http://svn.freebsd.org/changeset/base/197410 Log: - Split the logic to parse an SMAP entry out into a separate function on amd64 similar to i386. This fixes a bug on amd64 where overlapping entries would not cause the SMAP parsing to stop. - Change the SMAP parsing code to do a sorted insertion into physmap[] instead of an append to support systems with out-of-order SMAP entries. PR: amd64/138220 Reported by: James R. Van Artsdalen james of jrv org MFC after: 3 days Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Sep 22 16:28:07 2009 (r197409) +++ head/sys/amd64/amd64/machdep.c Tue Sep 22 16:51:00 2009 (r197410) @@ -1192,6 +1192,77 @@ isa_irq_pending(void) u_int basemem; +static int +add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +{ + int i, insert_idx, physmap_idx; + + physmap_idx = *physmap_idxp; + + if (boothowto & RB_VERBOSE) + printf("SMAP type=%02x base=%016lx len=%016lx\n", + smap->type, smap->base, smap->length); + + if (smap->type != SMAP_TYPE_MEMORY) + return (1); + + if (smap->length == 0) + return (0); + + /* + * Find insertion point while checking for overlap. Start off by + * assuming the new entry will be added to the end. + */ + insert_idx = physmap_idx + 2; + for (i = 0; i <= physmap_idx; i += 2) { + if (smap->base < physmap[i + 1]) { + if (smap->base + smap->length <= physmap[i]) { + insert_idx = i; + break; + } + if (boothowto & RB_VERBOSE) + printf( + "Overlapping memory regions, ignoring second region\n"); + return (1); + } + } + + /* See if we can prepend to the next entry. */ + if (insert_idx <= physmap_idx && + smap->base + smap->length == physmap[insert_idx]) { + physmap[insert_idx] = smap->base; + return (1); + } + + /* See if we can append to the previous entry. */ + if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += smap->length; + return (1); + } + + physmap_idx += 2; + *physmap_idxp = physmap_idx; + if (physmap_idx == PHYSMAP_SIZE) { + printf( + "Too many segments in the physical address map, giving up\n"); + return (0); + } + + /* + * Move the last 'N' entries down to make room for the new + * entry if needed. + */ + for (i = physmap_idx; i > insert_idx; i -= 2) { + physmap[i] = physmap[i - 2]; + physmap[i + 1] = physmap[i - 1]; + } + + /* Insert the new entry. */ + physmap[insert_idx] = smap->base; + physmap[insert_idx + 1] = smap->base + smap->length; + return (1); +} + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -1235,40 +1306,9 @@ getmemsize(caddr_t kmdp, u_int64_t first smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); - for (smap = smapbase; smap < smapend; smap++) { - if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016lx len=%016lx\n", - smap->type, smap->base, smap->length); - - if (smap->type != SMAP_TYPE_MEMORY) - continue; - - if (smap->length == 0) - continue; - - for (i = 0; i <= physmap_idx; i += 2) { - if (smap->base < physmap[i + 1]) { - if (boothowto & RB_VERBOSE) - printf( - "Overlapping or non-monotonic memory region, ignoring second region\n"); - continue; - } - } - - if (smap->base == physmap[physmap_idx + 1]) { - physmap[physmap_idx + 1] += smap->length; - continue; - } - - physmap_idx += 2; - if (physmap_idx == PHYSMAP_SIZE) { - printf( - "Too many segments in the physical address map, giving up\n"); + for (smap = smapbase; smap < smapend; smap++) + if (!add_smap_entry(smap, physmap, &physmap_idx)) break; - } - physmap[physmap_idx] = smap->base; - physmap[physmap_idx + 1] = smap->base + smap->length; - } /* * Find the 'base memory' segment for SMP Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Sep 22 16:28:07 2009 (r197409) +++ head/sys/i386/i386/machdep.c Tue Sep 22 16:51:00 2009 (r197410) @@ -1946,7 +1946,7 @@ sdtossd(sd, ssd) static int add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) { - int i, physmap_idx; + int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; @@ -1968,17 +1968,34 @@ add_smap_entry(struct bios_smap *smap, v } #endif + /* + * Find insertion point while checking for overlap. Start off by + * assuming the new entry will be added to the end. + */ + insert_idx = physmap_idx + 2; for (i = 0; i <= physmap_idx; i += 2) { if (smap->base < physmap[i + 1]) { + if (smap->base + smap->length <= physmap[i]) { + insert_idx = i; + break; + } if (boothowto & RB_VERBOSE) printf( - "Overlapping or non-monotonic memory region, ignoring second region\n"); + "Overlapping memory regions, ignoring second region\n"); return (1); } } - if (smap->base == physmap[physmap_idx + 1]) { - physmap[physmap_idx + 1] += smap->length; + /* See if we can prepend to the next entry. */ + if (insert_idx <= physmap_idx && + smap->base + smap->length == physmap[insert_idx]) { + physmap[insert_idx] = smap->base; + return (1); + } + + /* See if we can append to the previous entry. */ + if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += smap->length; return (1); } @@ -1989,8 +2006,19 @@ add_smap_entry(struct bios_smap *smap, v "Too many segments in the physical address map, giving up\n"); return (0); } - physmap[physmap_idx] = smap->base; - physmap[physmap_idx + 1] = smap->base + smap->length; + + /* + * Move the last 'N' entries down to make room for the new + * entry if needed. + */ + for (i = physmap_idx; i > insert_idx; i -= 2) { + physmap[i] = physmap[i - 2]; + physmap[i + 1] = physmap[i - 1]; + } + + /* Insert the new entry. */ + physmap[insert_idx] = smap->base; + physmap[insert_idx + 1] = smap->base + smap->length; return (1); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 16:52:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B13F8106568F; Tue, 22 Sep 2009 16:52:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 816B38FC22; Tue, 22 Sep 2009 16:52:00 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 32C7246B37; Tue, 22 Sep 2009 12:52:00 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 65A3D8A021; Tue, 22 Sep 2009 12:51:59 -0400 (EDT) From: John Baldwin To: "M. Warner Losh" Date: Tue, 22 Sep 2009 10:24:01 -0400 User-Agent: KMail/1.9.7 References: <4AB35086.90502@FreeBSD.org> <4AB495DD.1010006@FreeBSD.org> <20090919.230053.58383965.imp@bsdimp.com> In-Reply-To: <20090919.230053.58383965.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909221024.02623.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 22 Sep 2009 12:51:59 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, rmacklem@freebsd.org, svn-src-all@freebsd.org, rmacklem@uoguelph.ca, src-committers@freebsd.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 16:52:00 -0000 On Sunday 20 September 2009 1:00:53 am M. Warner Losh wrote: > : Hmm, it might actually be nice to be able to change those at some point > : as well. I have looked at this in the past and it is quite deeply > : buried in libc. :-/ > > What's the benefit for forcing a tcp connection for the portmapper > RPCs? They just happen once at startup... I can't recall now. I know it was a request at my previous job to force all NFS stuff to TCP instead of UDP. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 16:59:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E553A1065676; Tue, 22 Sep 2009 16:59:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB8438FC13; Tue, 22 Sep 2009 16:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MGxFJn025926; Tue, 22 Sep 2009 16:59:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MGxFT1025925; Tue, 22 Sep 2009 16:59:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909221659.n8MGxFT1025925@svn.freebsd.org> From: Xin LI Date: Tue, 22 Sep 2009 16:59: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: r197411 - head/sys/modules/x86emu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 16:59:16 -0000 Author: delphij Date: Tue Sep 22 16:59:15 2009 New Revision: 197411 URL: http://svn.freebsd.org/changeset/base/197411 Log: Removed unused empty directory. Submitted by: b. f. Deleted: head/sys/modules/x86emu/ From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 17:32:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49F8A106568B; Tue, 22 Sep 2009 17:32:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0618FC13; Tue, 22 Sep 2009 17:32:14 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C0B4946B09; Tue, 22 Sep 2009 13:32:13 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 15D1F8A021; Tue, 22 Sep 2009 13:32:13 -0400 (EDT) From: John Baldwin To: Roman Divacky Date: Tue, 22 Sep 2009 13:01:07 -0400 User-Agent: KMail/1.9.7 References: <200909221622.n8MGM5WK025136@svn.freebsd.org> In-Reply-To: <200909221622.n8MGM5WK025136@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909221301.07781.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 22 Sep 2009 13:32:13 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197408 - in head/sys: conf ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 17:32:14 -0000 On Tuesday 22 September 2009 12:22:05 pm Roman Divacky wrote: > Author: rdivacky > Date: Tue Sep 22 16:22:05 2009 > New Revision: 197408 > URL: http://svn.freebsd.org/changeset/base/197408 > > Log: > Don't build ufs_gjournal.c at all if UFS_GJOURNAL option is not given > instead of building an almost empty C file. > > Approved by: pjd > Approved by: ed (mentor, implicit) > > Modified: > head/sys/conf/files > head/sys/ufs/ufs/ufs_gjournal.c > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Tue Sep 22 16:16:02 2009 (r197407) > +++ head/sys/conf/files Tue Sep 22 16:22:05 2009 (r197408) > @@ -2634,7 +2634,7 @@ ufs/ufs/ufs_acl.c optional ffs > ufs/ufs/ufs_bmap.c optional ffs > ufs/ufs/ufs_dirhash.c optional ffs > ufs/ufs/ufs_extattr.c optional ffs > -ufs/ufs/ufs_gjournal.c optional ffs > +ufs/ufs/ufs_gjournal.c optional ffs UFS_GJOURNAL > ufs/ufs/ufs_inode.c optional ffs > ufs/ufs/ufs_lookup.c optional ffs > ufs/ufs/ufs_quota.c optional ffs Hmm, shouldn't this be lowercase? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 17:45:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56758106566B; Tue, 22 Sep 2009 17:45:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B8368FC18; Tue, 22 Sep 2009 17:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MHjTGs026954; Tue, 22 Sep 2009 17:45:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MHjTC0026952; Tue, 22 Sep 2009 17:45:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909221745.n8MHjTC0026952@svn.freebsd.org> From: Rui Paulo Date: Tue, 22 Sep 2009 17:45: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: r197412 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 17:45:29 -0000 Author: rpaulo Date: Tue Sep 22 17:45:28 2009 New Revision: 197412 URL: http://svn.freebsd.org/changeset/base/197412 Log: Reserve events for XScale. Reviewed by: jkoshy, gnn MFC after: 1 week Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Sep 22 16:59:15 2009 (r197411) +++ head/sys/dev/hwpmc/pmc_events.h Tue Sep 22 17:45:28 2009 (r197412) @@ -1979,6 +1979,30 @@ __PMC_EV_ALIAS("SIMD_INT_64.SHUFFLE_MOVE #define PMC_EV_TSC_FIRST PMC_EV_TSC_TSC #define PMC_EV_TSC_LAST PMC_EV_TSC_TSC + +/* + * Intel XScale events from "Intel XScale Core Developer's Manual", + * January 2004, #27347302 + */ +#define __PMC_EV_XSCALE() \ + __PMC_EV(XSCALE, IC_FETCH) \ + __PMC_EV(XSCALE, IC_MISS) \ + __PMC_EV(XSCALE, DATA_DEPENDENCY_STALL) \ + __PMC_EV(XSCALE, ITLB_MISS) \ + __PMC_EV(XSCALE, DTLB_MISS) \ + __PMC_EV(XSCALE, BRANCH_EXECUTED) \ + __PMC_EV(XSCALE, BRANCH_MISPRED) \ + __PMC_EV(XSCALE, INSTR_EXECUTED) \ + __PMC_EV(XSCALE, DC_FULL_CYCLE) \ + __PMC_EV(XSCALE, DC_FULL_CONTIG) \ + __PMC_EV(XSCALE, DC_ACCESS) \ + __PMC_EV(XSCALE, DC_MISS) \ + __PMC_EV(XSCALE, DC_WRITEBACK) \ + __PMC_EV(XSCALE, PC_CHANGE) + +#define PMC_EV_XSCALE_FIRST PMC_EV_XSCALE_IC_FETCH +#define PMC_EV_XSCALE_LAST PMC_EV_XSCALE_PC_CHANGE + /* * All known PMC events. * @@ -1996,6 +2020,7 @@ __PMC_EV_ALIAS("SIMD_INT_64.SHUFFLE_MOVE * 0x11000 0x0080 INTEL Pentium 4 events * 0x11080 0x0080 INTEL Pentium MMX events * 0x11100 0x0100 INTEL Pentium Pro/P-II/P-III/Pentium-M events + * 0x11200 0x00FF INTEL XScale events */ #define __PMC_EVENTS() \ __PMC_EV_BLOCK(TSC, 0x01000) \ @@ -2013,9 +2038,11 @@ __PMC_EV_ALIAS("SIMD_INT_64.SHUFFLE_MOVE __PMC_EV_BLOCK(P5, 0x11080) \ __PMC_EV_P5() \ __PMC_EV_BLOCK(P6, 0x11100) \ - __PMC_EV_P6() + __PMC_EV_P6() \ + __PMC_EV_BLOCK(XSCALE, 0x11200) \ + __PMC_EV_XSCALE() #define PMC_EVENT_FIRST PMC_EV_TSC_TSC -#define PMC_EVENT_LAST PMC_EV_P6_LAST +#define PMC_EVENT_LAST PMC_EV_XSCALE_LAST #endif /* _DEV_HWPMC_PMC_EVENTS_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 18:18:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B4F01065676; Tue, 22 Sep 2009 18:18:14 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78D4B8FC0A; Tue, 22 Sep 2009 18:18:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MIIEc7027744; Tue, 22 Sep 2009 18:18:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MIIEhR027741; Tue, 22 Sep 2009 18:18:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909221818.n8MIIEhR027741@svn.freebsd.org> From: Rui Paulo Date: Tue, 22 Sep 2009 18:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197413 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 18:18:14 -0000 Author: rpaulo Date: Tue Sep 22 18:18:14 2009 New Revision: 197413 URL: http://svn.freebsd.org/changeset/base/197413 Log: Update 802.11s mesh support to draft 3.03. This includes a revised frame format for peering and changes to the PERR frames. Note that this is incompatible with the previous code. Reviewed by: sam MFC after: 1 week Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Tue Sep 22 17:45:28 2009 (r197412) +++ head/sys/net80211/ieee80211.h Tue Sep 22 18:18:14 2009 (r197413) @@ -708,7 +708,7 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.0 spec and were not assigned by + * 802.11s IEs based on D3.03 spec and were not assigned by * ANA. Beware changing them because some of them are being * kept compatible with Linux. */ @@ -726,10 +726,9 @@ enum { IEEE80211_ELEMID_MESHPREQ = 68, IEEE80211_ELEMID_MESHPREP = 69, IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPU = 53, - IEEE80211_ELEMID_MESHPUC = 54, + IEEE80211_ELEMID_MESHPXU = 53, + IEEE80211_ELEMID_MESHPXUC = 54, IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ - IEEE80211_ELEMID_MESHPEERVER = 80, /* Peering Protocol Version */ }; struct ieee80211_tim_ie { @@ -925,6 +924,9 @@ enum { IEEE80211_REASON_MESH_INVALID_GTK = 8, /* 11s */ IEEE80211_REASON_MESH_INCONS_PARAMS = 9, /* 11s */ IEEE80211_REASON_MESH_INVALID_SECURITY = 10, /* 11s */ + IEEE80211_REASON_MESH_PERR_UNSPEC = 11, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_FI = 12, /* 11s */ + IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 13, /* 11s */ IEEE80211_STATUS_SUCCESS = 0, IEEE80211_STATUS_UNSPECIFIED = 1, Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Sep 22 17:45:28 2009 (r197412) +++ head/sys/net80211/ieee80211_hwmp.c Tue Sep 22 18:18:14 2009 (r197413) @@ -188,10 +188,7 @@ SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, ra #define IEEE80211_HWMP_DEFAULT_MAXHOPS 31 -static ieee80211_recv_action_func hwmp_recv_action_meshpath_preq; -static ieee80211_recv_action_func hwmp_recv_action_meshpath_prep; -static ieee80211_recv_action_func hwmp_recv_action_meshpath_perr; -static ieee80211_recv_action_func hwmp_recv_action_meshpath_rann; +static ieee80211_recv_action_func hwmp_recv_action_meshpath; static struct ieee80211_mesh_proto_path mesh_proto_hwmp = { .mpp_descr = "HWMP", @@ -217,16 +214,10 @@ ieee80211_hwmp_init(void) ieee80211_hwmp_rannint = msecs_to_ticks(1*1000); /* - * Register action frame handlers. + * Register action frame handler. */ ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, - IEEE80211_ACTION_MESHPATH_REQ, hwmp_recv_action_meshpath_preq); - ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, - IEEE80211_ACTION_MESHPATH_REP, hwmp_recv_action_meshpath_prep); - ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, - IEEE80211_ACTION_MESHPATH_ERR, hwmp_recv_action_meshpath_perr); - ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, - IEEE80211_ACTION_MESHPATH_RANN, hwmp_recv_action_meshpath_rann); + IEEE80211_ACTION_MESHPATH_SEL, hwmp_recv_action_meshpath); /* NB: default is 5 secs per spec */ mesh_proto_hwmp.mpp_inact = msecs_to_ticks(5*1000); @@ -285,17 +276,23 @@ hwmp_newstate(struct ieee80211vap *vap, } static int -hwmp_recv_action_meshpath_preq(struct ieee80211_node *ni, +hwmp_recv_action_meshpath(struct ieee80211_node *ni, const struct ieee80211_frame *wh, const uint8_t *frm, const uint8_t *efrm) { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_meshpreq_ie preq; + struct ieee80211_meshprep_ie prep; + struct ieee80211_meshperr_ie perr; + struct ieee80211_meshrann_ie rann; const uint8_t *iefrm = frm + 2; /* action + code */ + int found = 0; while (efrm - iefrm > 1) { IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0); - if (*iefrm == IEEE80211_ELEMID_MESHPREQ) { + switch (*iefrm) { + case IEEE80211_ELEMID_MESHPREQ: + { const struct ieee80211_meshpreq_ie *mpreq = (const struct ieee80211_meshpreq_ie *) iefrm; /* XXX > 1 target */ @@ -305,7 +302,7 @@ hwmp_recv_action_meshpath_preq(struct ie IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, wh, NULL, "%s", "PREQ with wrong len"); vap->iv_stats.is_rx_mgtdiscard++; - return 1; + break; } memcpy(&preq, mpreq, sizeof(preq)); preq.preq_id = LE_READ_4(&mpreq->preq_id); @@ -315,28 +312,11 @@ hwmp_recv_action_meshpath_preq(struct ie preq.preq_targets[0].target_seq = LE_READ_4(&mpreq->preq_targets[0].target_seq); hwmp_recv_preq(vap, ni, wh, &preq); - return 0; + found++; + break; } - iefrm += iefrm[1] + 2; - } - IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "PREQ without IE"); - vap->iv_stats.is_rx_mgtdiscard++; - return 0; -} - -static int -hwmp_recv_action_meshpath_prep(struct ieee80211_node *ni, - const struct ieee80211_frame *wh, - const uint8_t *frm, const uint8_t *efrm) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211_meshprep_ie prep; - const uint8_t *iefrm = frm + 2; /* action + code */ - - while (efrm - iefrm > 1) { - IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0); - if (*iefrm == IEEE80211_ELEMID_MESHPREP) { + case IEEE80211_ELEMID_MESHPREP: + { const struct ieee80211_meshprep_ie *mprep = (const struct ieee80211_meshprep_ie *) iefrm; if (mprep->prep_len != @@ -345,7 +325,7 @@ hwmp_recv_action_meshpath_prep(struct ie IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, wh, NULL, "%s", "PREP with wrong len"); vap->iv_stats.is_rx_mgtdiscard++; - return 1; + break; } memcpy(&prep, mprep, sizeof(prep)); prep.prep_targetseq = LE_READ_4(&mprep->prep_targetseq); @@ -353,28 +333,11 @@ hwmp_recv_action_meshpath_prep(struct ie prep.prep_metric = LE_READ_4(&mprep->prep_metric); prep.prep_origseq = LE_READ_4(&mprep->prep_origseq); hwmp_recv_prep(vap, ni, wh, &prep); - return 0; + found++; + break; } - iefrm += iefrm[1] + 2; - } - IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "PREP without IE"); - vap->iv_stats.is_rx_mgtdiscard++; - return 0; -} - -static int -hwmp_recv_action_meshpath_perr(struct ieee80211_node *ni, - const struct ieee80211_frame *wh, - const uint8_t *frm, const uint8_t *efrm) -{ - struct ieee80211_meshperr_ie perr; - struct ieee80211vap *vap = ni->ni_vap; - const uint8_t *iefrm = frm + 2; /* action + code */ - - while (efrm - iefrm > 1) { - IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0); - if (*iefrm == IEEE80211_ELEMID_MESHPERR) { + case IEEE80211_ELEMID_MESHPERR: + { const struct ieee80211_meshperr_ie *mperr = (const struct ieee80211_meshperr_ie *) iefrm; /* XXX > 1 target */ @@ -384,34 +347,17 @@ hwmp_recv_action_meshpath_perr(struct ie IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, wh, NULL, "%s", "PERR with wrong len"); vap->iv_stats.is_rx_mgtdiscard++; - return 1; + break; } memcpy(&perr, mperr, sizeof(perr)); perr.perr_dests[0].dest_seq = LE_READ_4(&mperr->perr_dests[0].dest_seq); hwmp_recv_perr(vap, ni, wh, &perr); - return 0; + found++; + break; } - iefrm += iefrm[1] + 2; - } - IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "PERR without IE"); - vap->iv_stats.is_rx_mgtdiscard++; - return 0; -} - -static int -hwmp_recv_action_meshpath_rann(struct ieee80211_node *ni, - const struct ieee80211_frame *wh, - const uint8_t *frm, const uint8_t *efrm) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211_meshrann_ie rann; - const uint8_t *iefrm = frm + 2; /* action + code */ - - while (efrm - iefrm > 1) { - IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0); - if (*iefrm == IEEE80211_ELEMID_MESHRANN) { + case IEEE80211_ELEMID_MESHRANN: + { const struct ieee80211_meshrann_ie *mrann = (const struct ieee80211_meshrann_ie *) iefrm; if (mrann->rann_len != @@ -426,13 +372,18 @@ hwmp_recv_action_meshpath_rann(struct ie rann.rann_seq = LE_READ_4(&mrann->rann_seq); rann.rann_metric = LE_READ_4(&mrann->rann_metric); hwmp_recv_rann(vap, ni, wh, &rann); - return 0; + found++; + break; + } } iefrm += iefrm[1] + 2; } - IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "RANN without IE"); - vap->iv_stats.is_rx_mgtdiscard++; + if (!found) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "%s", "PATH SEL action without IE"); + vap->iv_stats.is_rx_mgtdiscard++; + } return 0; } @@ -480,24 +431,21 @@ hwmp_send_action(struct ieee80211_node * return ENOMEM; } *frm++ = IEEE80211_ACTION_CAT_MESHPATH; + *frm++ = IEEE80211_ACTION_MESHPATH_SEL; switch (*ie) { case IEEE80211_ELEMID_MESHPREQ: - *frm++ = IEEE80211_ACTION_MESHPATH_REQ; frm = hwmp_add_meshpreq(frm, (struct ieee80211_meshpreq_ie *)ie); break; case IEEE80211_ELEMID_MESHPREP: - *frm++ = IEEE80211_ACTION_MESHPATH_REP; frm = hwmp_add_meshprep(frm, (struct ieee80211_meshprep_ie *)ie); break; case IEEE80211_ELEMID_MESHPERR: - *frm++ = IEEE80211_ACTION_MESHPATH_ERR; frm = hwmp_add_meshperr(frm, (struct ieee80211_meshperr_ie *)ie); break; case IEEE80211_ELEMID_MESHRANN: - *frm++ = IEEE80211_ACTION_MESHPATH_RANN; frm = hwmp_add_meshrann(frm, (struct ieee80211_meshrann_ie *)ie); break; @@ -528,6 +476,11 @@ hwmp_send_action(struct ieee80211_node * return ic->ic_raw_xmit(ni, m, ¶ms); } +#define ADDSHORT(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = (v) >> 8; \ + frm += 2; \ +} while (0) #define ADDWORD(frm, v) do { \ LE_WRITE_4(frm, v); \ frm += 4; \ @@ -592,12 +545,14 @@ hwmp_add_meshperr(uint8_t *frm, const st *frm++ = IEEE80211_ELEMID_MESHPERR; *frm++ = sizeof(struct ieee80211_meshperr_ie) - 2 + (perr->perr_ndests - 1) * sizeof(*perr->perr_dests); - *frm++ = perr->perr_mode; + *frm++ = perr->perr_ttl; *frm++ = perr->perr_ndests; for (i = 0; i < perr->perr_ndests; i++) { + *frm += perr->perr_dests[i].dest_flags; IEEE80211_ADDR_COPY(frm, perr->perr_dests[i].dest_addr); frm += 6; ADDWORD(frm, perr->perr_dests[i].dest_seq); + ADDSHORT(frm, perr->perr_dests[i].dest_rcode); } return frm; } @@ -1138,12 +1093,15 @@ hwmp_send_prep(struct ieee80211_node *ni sizeof(struct ieee80211_meshprep_ie)); } +#define PERR_DFLAGS(n) perr.perr_dests[n].dest_flags #define PERR_DADDR(n) perr.perr_dests[n].dest_addr #define PERR_DSEQ(n) perr.perr_dests[n].dest_seq +#define PERR_DRCODE(n) perr.perr_dests[n].dest_rcode static void hwmp_peerdown(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_meshperr_ie perr; struct ieee80211_mesh_route *rt; struct ieee80211_hwmp_route *hr; @@ -1154,19 +1112,27 @@ hwmp_peerdown(struct ieee80211_node *ni) hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "%s", "delete route entry"); - perr.perr_mode = 0; + perr.perr_ttl = ms->ms_ttl; perr.perr_ndests = 1; + if (hr->hr_seq == 0) + PERR_DFLAGS(0) |= IEEE80211_MESHPERR_DFLAGS_USN; + PERR_DFLAGS(0) |= IEEE80211_MESHPERR_DFLAGS_RC; IEEE80211_ADDR_COPY(PERR_DADDR(0), rt->rt_dest); PERR_DSEQ(0) = hr->hr_seq; + PERR_DRCODE(0) = IEEE80211_REASON_MESH_PERR_DEST_UNREACH; /* NB: flush everything passing through peer */ ieee80211_mesh_rt_flush_peer(vap, ni->ni_macaddr); hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &perr); } +#undef PERR_DFLAGS #undef PERR_DADDR #undef PERR_DSEQ +#undef PERR_DRCODE +#define PERR_DFLAGS(n) perr->perr_dests[n].dest_flags #define PERR_DADDR(n) perr->perr_dests[n].dest_addr #define PERR_DSEQ(n) perr->perr_dests[n].dest_seq +#define PERR_DRCODE(n) perr->perr_dests[n].dest_rcode static void hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie *perr) @@ -1192,9 +1158,9 @@ hwmp_recv_perr(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_find(vap, PERR_DADDR(i)); if (rt == NULL) continue; - hr = IEEE80211_MESH_ROUTE_PRIV(rt, - struct ieee80211_hwmp_route); - if (HWMP_SEQ_GEQ(PERR_DSEQ(i), hr->hr_seq)) { + hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); + if (!(PERR_DFLAGS(0) & IEEE80211_MESHPERR_DFLAGS_USN) && + HWMP_SEQ_GEQ(PERR_DSEQ(i), hr->hr_seq)) { ieee80211_mesh_rt_del(vap, rt->rt_dest); ieee80211_mesh_rt_flush_peer(vap, rt->rt_dest); rt = NULL; @@ -1205,10 +1171,11 @@ hwmp_recv_perr(struct ieee80211vap *vap, * Propagate the PERR if we previously found it on our routing table. * XXX handle ndest > 1 */ - if (forward) { + if (forward && perr->perr_ttl > 1) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "propagate PERR from %s", ether_sprintf(wh->i_addr2)); memcpy(&pperr, perr, sizeof(*perr)); + pperr.perr_ttl--; hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &pperr); } Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Tue Sep 22 17:45:28 2009 (r197412) +++ head/sys/net80211/ieee80211_mesh.c Tue Sep 22 18:18:14 2009 (r197413) @@ -87,10 +87,10 @@ static void mesh_peer_timeout_backoff(st static void mesh_peer_timeout_cb(void *); static __inline void mesh_peer_timeout_stop(struct ieee80211_node *); -static int mesh_verify_meshpeerver(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshid(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *); -static int mesh_verify_meshpeer(struct ieee80211vap *, const uint8_t *); +static int mesh_verify_meshpeer(struct ieee80211vap *, uint8_t, + const uint8_t *); uint32_t mesh_airtime_calc(struct ieee80211_node *); /* @@ -1544,19 +1544,16 @@ static const struct ieee80211_meshpeer_i mesh_parse_meshpeering_action(struct ieee80211_node *ni, const struct ieee80211_frame *wh, /* XXX for VERIFY_LENGTH */ const uint8_t *frm, const uint8_t *efrm, - struct ieee80211_meshpeer_ie *mp) + struct ieee80211_meshpeer_ie *mp, uint8_t subtype) { struct ieee80211vap *vap = ni->ni_vap; const struct ieee80211_meshpeer_ie *mpie; - const uint8_t *meshid, *meshconf, *meshpeerver, *meshpeer; + const uint8_t *meshid, *meshconf, *meshpeer; - meshid = meshconf = meshpeerver = meshpeer = NULL; + meshid = meshconf = meshpeer = NULL; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return NULL); switch (*frm) { - case IEEE80211_ELEMID_MESHPEERVER: - meshpeerver = frm; - break; case IEEE80211_ELEMID_MESHID: meshid = frm; break; @@ -1567,12 +1564,10 @@ mesh_parse_meshpeering_action(struct iee meshpeer = frm; mpie = (const struct ieee80211_meshpeer_ie *) frm; memset(mp, 0, sizeof(*mp)); - mp->peer_subtype = mpie->peer_subtype; mp->peer_llinkid = LE_READ_2(&mpie->peer_llinkid); /* NB: peer link ID is optional on these frames */ - if (mpie->peer_subtype == - IEEE80211_MESH_PEER_LINK_CLOSE && - mpie->peer_len == 5) { + if (subtype == IEEE80211_MESH_PEER_LINK_CLOSE && + mpie->peer_len == 8) { mp->peer_linkid = 0; mp->peer_rcode = LE_READ_2(&mpie->peer_linkid); } else { @@ -1589,12 +1584,12 @@ mesh_parse_meshpeering_action(struct iee * close subtype don't have a Mesh Configuration IE. * If if fails validation, close the peer link. */ - KASSERT(meshpeer != NULL && mp->peer_subtype != - IEEE80211_ACTION_MESHPEERING_CLOSE, ("parsing close action")); + KASSERT(meshpeer != NULL && + subtype != IEEE80211_ACTION_MESHPEERING_CLOSE, + ("parsing close action")); - if (mesh_verify_meshpeerver(vap, meshpeerver) || - mesh_verify_meshid(vap, meshid) || - mesh_verify_meshpeer(vap, meshpeer) || + if (mesh_verify_meshid(vap, meshid) || + mesh_verify_meshpeer(vap, subtype, meshpeer) || mesh_verify_meshconf(vap, meshconf)) { uint16_t args[3]; @@ -1638,7 +1633,8 @@ mesh_recv_action_meshpeering_open(struct uint16_t args[3]; /* +2+2 for action + code + capabilites */ - meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2, efrm, &ie); + meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2, efrm, &ie, + IEEE80211_ACTION_MESHPEERING_OPEN); if (meshpeer == NULL) { return 0; } @@ -1770,7 +1766,8 @@ mesh_recv_action_meshpeering_confirm(str uint16_t args[3]; /* +2+2+2+2 for action + code + capabilites + status code + AID */ - meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2+2+2, efrm, &ie); + meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2+2+2, efrm, &ie, + IEEE80211_ACTION_MESHPEERING_CONFIRM); if (meshpeer == NULL) { return 0; } @@ -1933,7 +1930,6 @@ mesh_send_action_meshpeering_open(struct ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ + sizeof(uint16_t) /* capabilites */ - + sizeof(struct ieee80211_meshpeerver_ie) + 2 + IEEE80211_RATE_SIZE + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + 2 + IEEE80211_MESHID_LEN @@ -1946,7 +1942,6 @@ mesh_send_action_meshpeering_open(struct * [1] category * [1] action * [2] capabilities - * [tlv] mesh peer protocol version * [tlv] rates * [tlv] xrates * [tlv] mesh id @@ -1956,7 +1951,6 @@ mesh_send_action_meshpeering_open(struct *frm++ = category; *frm++ = action; ADDSHORT(frm, ieee80211_getcapinfo(vap, ni->ni_chan)); - frm = ieee80211_add_meshpeerver(frm, vap); rs = ieee80211_get_suprates(ic, ic->ic_curchan); frm = ieee80211_add_rates(frm, rs); frm = ieee80211_add_xrates(frm, rs); @@ -1999,7 +1993,6 @@ mesh_send_action_meshpeering_confirm(str + sizeof(uint16_t) /* capabilites */ + sizeof(uint16_t) /* status code */ + sizeof(uint16_t) /* AID */ - + sizeof(struct ieee80211_meshpeerver_ie) + 2 + IEEE80211_RATE_SIZE + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + 2 + IEEE80211_MESHID_LEN @@ -2014,7 +2007,6 @@ mesh_send_action_meshpeering_confirm(str * [2] capabilities * [2] status code * [2] association id (peer ID) - * [tlv] mesh peer protocol version * [tlv] rates * [tlv] xrates * [tlv] mesh id @@ -2026,7 +2018,6 @@ mesh_send_action_meshpeering_confirm(str ADDSHORT(frm, ieee80211_getcapinfo(vap, ni->ni_chan)); ADDSHORT(frm, 0); /* status code */ ADDSHORT(frm, args[1]); /* AID */ - frm = ieee80211_add_meshpeerver(frm, vap); rs = ieee80211_get_suprates(ic, ic->ic_curchan); frm = ieee80211_add_rates(frm, rs); frm = ieee80211_add_xrates(frm, rs); @@ -2067,7 +2058,6 @@ mesh_send_action_meshpeering_close(struc ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ + sizeof(uint16_t) /* reason code */ - + sizeof(struct ieee80211_meshpeerver_ie) + 2 + IEEE80211_MESHID_LEN + sizeof(struct ieee80211_meshpeer_ie) ); @@ -2077,14 +2067,12 @@ mesh_send_action_meshpeering_close(struc * [1] category * [1] action * [2] reason code - * [tlv] mesh peer protocol version * [tlv] mesh id * [tlv] mesh peer link mgmt */ *frm++ = category; *frm++ = action; ADDSHORT(frm, args[2]); /* reason code */ - frm = ieee80211_add_meshpeerver(frm, vap); frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshpeer(frm, IEEE80211_MESH_PEER_LINK_CLOSE, @@ -2279,19 +2267,6 @@ mesh_peer_timeout_cb(void *arg) } static int -mesh_verify_meshpeerver(struct ieee80211vap *vap, const uint8_t *ie) -{ - static const uint8_t peer[4] = IEEE80211_MESHPEERVER_PEER; - const struct ieee80211_meshpeerver_ie *meshpeerver = - (const struct ieee80211_meshpeerver_ie *) ie; - - if (meshpeerver->peerver_len != - sizeof(struct ieee80211_meshpeerver_ie) - 2) - return 1; - return memcmp(meshpeerver->peerver_proto, peer, 4); -} - -static int mesh_verify_meshid(struct ieee80211vap *vap, const uint8_t *ie) { struct ieee80211_mesh_state *ms = vap->iv_mesh; @@ -2364,26 +2339,28 @@ mesh_verify_meshconf(struct ieee80211vap } static int -mesh_verify_meshpeer(struct ieee80211vap *vap, const uint8_t *ie) +mesh_verify_meshpeer(struct ieee80211vap *vap, uint8_t subtype, + const uint8_t *ie) { const struct ieee80211_meshpeer_ie *meshpeer = (const struct ieee80211_meshpeer_ie *) ie; - if (meshpeer == NULL) + if (meshpeer == NULL || meshpeer->peer_len < 6 || + meshpeer->peer_len > 10) return 1; - switch (meshpeer->peer_subtype) { + switch (subtype) { case IEEE80211_MESH_PEER_LINK_OPEN: - if (meshpeer->peer_len != 3) + if (meshpeer->peer_len != 6) return 1; break; case IEEE80211_MESH_PEER_LINK_CONFIRM: - if (meshpeer->peer_len != 5) + if (meshpeer->peer_len != 8) return 1; break; case IEEE80211_MESH_PEER_LINK_CLOSE: - if (meshpeer->peer_len < 5) + if (meshpeer->peer_len < 8) return 1; - if (meshpeer->peer_len == 5 && meshpeer->peer_linkid != 0) + if (meshpeer->peer_len == 8 && meshpeer->peer_linkid != 0) return 1; if (meshpeer->peer_rcode == 0) return 1; @@ -2449,53 +2426,40 @@ ieee80211_add_meshconf(uint8_t *frm, str } /* - * Add a Mesh Peer Protocol IE to a frame. - * XXX: needs to grow support for Abbreviated Handshake - */ -uint8_t * -ieee80211_add_meshpeerver(uint8_t *frm, struct ieee80211vap *vap) -{ - static struct ieee80211_meshpeerver_ie ie = { - .peerver_ie = IEEE80211_ELEMID_MESHPEERVER, - .peerver_len = 4, - .peerver_proto = IEEE80211_MESHPEERVER_PEER, - }; - - KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap")); - - memcpy(frm, &ie, sizeof(ie)); - return frm + sizeof(ie); -} - -/* * Add a Mesh Peer Management IE to a frame. */ uint8_t * ieee80211_add_meshpeer(uint8_t *frm, uint8_t subtype, uint16_t localid, uint16_t peerid, uint16_t reason) { + /* XXX change for AH */ + static const uint8_t meshpeerproto[4] = IEEE80211_MESH_PEER_PROTO; + KASSERT(localid != 0, ("localid == 0")); *frm++ = IEEE80211_ELEMID_MESHPEER; switch (subtype) { case IEEE80211_MESH_PEER_LINK_OPEN: - *frm++ = 3; /* length */ - *frm++ = subtype; + *frm++ = 6; /* length */ + memcpy(frm, meshpeerproto, 4); + frm += 4; ADDSHORT(frm, localid); /* local ID */ break; case IEEE80211_MESH_PEER_LINK_CONFIRM: KASSERT(peerid != 0, ("sending peer confirm without peer id")); - *frm++ = 5; /* length */ - *frm++ = subtype; + *frm++ = 8; /* length */ + memcpy(frm, meshpeerproto, 4); + frm += 4; ADDSHORT(frm, localid); /* local ID */ ADDSHORT(frm, peerid); /* peer ID */ break; case IEEE80211_MESH_PEER_LINK_CLOSE: if (peerid) - *frm++ = 7; /* length */ + *frm++ = 10; /* length */ else - *frm++ = 5; /* length */ - *frm++ = subtype; + *frm++ = 8; /* length */ + memcpy(frm, meshpeerproto, 4); + frm += 4; ADDSHORT(frm, localid); /* local ID */ if (peerid) ADDSHORT(frm, peerid); /* peer ID */ Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Tue Sep 22 17:45:28 2009 (r197412) +++ head/sys/net80211/ieee80211_mesh.h Tue Sep 22 18:18:14 2009 (r197413) @@ -34,7 +34,7 @@ #define IEEE80211_MESH_DEFAULT_TTL 31 /* - * NB: all structures are__packed so sizeof works on arm, et. al. + * NB: all structures are __packed so sizeof works on arm, et. al. */ /* * 802.11s Information Elements. @@ -116,28 +116,11 @@ struct ieee80211_meshcngst_ie { AC_BE, AC_VI, AC_VO */ } __packed; -/* Peer Version */ -struct ieee80211_meshpeerver_ie { - uint8_t peerver_ie; /* IEEE80211_ELEMID_MESHPEERVER */ - uint8_t peerver_len; - uint8_t peerver_proto[4]; -} __packed; -/* Mesh Peering Management Protocol */ -#define IEEE80211_MESHPEERVER_PEER_OUI 0x00, 0x0f, 0xac -#define IEEE80211_MESHPEERVER_PEER_VALUE 0x2a -#define IEEE80211_MESHPEERVER_PEER { IEEE80211_MESHPEERVER_PEER_OUI, \ - IEEE80211_MESHPEERVER_PEER_VALUE } -/* Abbreviated Handshake Protocol */ -#define IEEE80211_MESHPEERVER_AH_OUI 0x00, 0x0f, 0xac -#define IEEE80211_MESHPEERVER_AH_VALUE 0x2b -#define IEEE80211_MESHPEERVER_AH { IEEE80211_MESHPEERVER_AH_OUI, \ - IEEE80211_MESHPEERVER_AH_VALUE } - /* Peer Link Management */ struct ieee80211_meshpeer_ie { uint8_t peer_ie; /* IEEE80211_ELEMID_MESHPEER */ uint8_t peer_len; - uint8_t peer_subtype; + uint8_t peer_proto[4]; /* Peer Management Protocol */ uint16_t peer_llinkid; /* Local Link ID */ uint16_t peer_linkid; /* Peer Link ID */ uint16_t peer_rcode; @@ -150,6 +133,16 @@ enum { /* values 3-255 are reserved */ }; +/* Mesh Peering Management Protocol */ +#define IEEE80211_MESH_PEER_PROTO_OUI 0x00, 0x0f, 0xac +#define IEEE80211_MESH_PEER_PROTO_VALUE 0x2a +#define IEEE80211_MESH_PEER_PROTO { IEEE80211_MESH_PEER_PROTO_OUI, \ + IEEE80211_MESH_PEER_PROTO_VALUE } +/* Abbreviated Handshake Protocol */ +#define IEEE80211_MESH_PEER_PROTO_AH_OUI 0x00, 0x0f, 0xac +#define IEEE80211_MESH_PEER_PROTO_AH_VALUE 0x2b +#define IEEE80211_MESH_PEER_PROTO_AH { IEEE80211_MESH_PEER_PROTO_AH_OUI, \ + IEEE80211_MESH_PEER_PROTO_AH_VALUE } #ifdef notyet /* Mesh Channel Switch Annoucement */ struct ieee80211_meshcsa_ie { @@ -256,11 +249,15 @@ struct ieee80211_meshprep_ie { struct ieee80211_meshperr_ie { uint8_t perr_ie; /* IEEE80211_ELEMID_MESHPERR */ uint8_t perr_len; - uint8_t perr_mode; /* NB: reserved */ + uint8_t perr_ttl; uint8_t perr_ndests; /* Number of Destinations */ struct { + uint8_t dest_flags; +#define IEEE80211_MESHPERR_DFLAGS_USN 0x01 +#define IEEE80211_MESHPERR_DFLAGS_RC 0x02 uint8_t dest_addr[IEEE80211_ADDR_LEN]; uint32_t dest_seq; /* HWMP Sequence Number */ + uint16_t dest_rcode; } __packed perr_dests[1]; /* NB: variable size */ } __packed; @@ -310,14 +307,11 @@ enum { }; /* - * Mesh Path Selection Action codes. + * Mesh Path Selection Action code. */ enum { - IEEE80211_ACTION_MESHPATH_REQ = 0, - IEEE80211_ACTION_MESHPATH_REP = 1, - IEEE80211_ACTION_MESHPATH_ERR = 2, - IEEE80211_ACTION_MESHPATH_RANN = 3, - /* 4-255 reserved */ + IEEE80211_ACTION_MESHPATH_SEL = 0, + /* 1-255 reserved */ }; /* @@ -479,7 +473,6 @@ int ieee80211_mesh_register_proto_path( int ieee80211_mesh_register_proto_metric(const struct ieee80211_mesh_proto_metric *); -uint8_t * ieee80211_add_meshpeerver(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t, From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 18:19:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AC4B106568B; Tue, 22 Sep 2009 18:19:18 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A4C68FC15; Tue, 22 Sep 2009 18:19:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MIJI9K027796; Tue, 22 Sep 2009 18:19:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MIJIWd027794; Tue, 22 Sep 2009 18:19:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909221819.n8MIJIWd027794@svn.freebsd.org> From: Rui Paulo Date: Tue, 22 Sep 2009 18:19: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: r197414 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 18:19:18 -0000 Author: rpaulo Date: Tue Sep 22 18:19:18 2009 New Revision: 197414 URL: http://svn.freebsd.org/changeset/base/197414 Log: Note the D3.03 mesh changes. MFC after: 1 week Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Sep 22 18:18:14 2009 (r197413) +++ head/UPDATING Tue Sep 22 18:19:18 2009 (r197414) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090922: + 802.11s D3.03 support was committed. This is incompatible with the + previous code, which was based on D3.0. + 20090910: ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for mount(8) and -a option for df(1) to see them. From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 18:34:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E13A106568D; Tue, 22 Sep 2009 18:34:24 +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 12D9D8FC0C; Tue, 22 Sep 2009 18:34:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MIYNlL028103; Tue, 22 Sep 2009 18:34:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MIYNL0028101; Tue, 22 Sep 2009 18:34:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909221834.n8MIYNL0028101@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Sep 2009 18:34: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: r197415 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 18:34:24 -0000 Author: jhb Date: Tue Sep 22 18:34:23 2009 New Revision: 197415 URL: http://svn.freebsd.org/changeset/base/197415 Log: The elements in the component arrays may be direct Package objects rather than references to objects. In that case, simply use the Package directly. I think a recent change to ACPI-CA is causing the interpreter to automatically expand these references. Reported by: Olivier Smedts olivier gid0 org MFC after: 3 days Modified: head/sys/dev/acpi_support/acpi_aiboost.c Modified: head/sys/dev/acpi_support/acpi_aiboost.c ============================================================================== --- head/sys/dev/acpi_support/acpi_aiboost.c Tue Sep 22 18:19:18 2009 (r197414) +++ head/sys/dev/acpi_support/acpi_aiboost.c Tue Sep 22 18:34:23 2009 (r197415) @@ -46,7 +46,6 @@ ACPI_MODULE_NAME("AIBOOST") #define DESCSTRLEN 32 struct acpi_aiboost_element{ - ACPI_HANDLE h; uint32_t id; char desc[DESCSTRLEN]; }; @@ -127,22 +126,23 @@ static ACPI_STATUS acpi_aiboost_getcompo for(i = 1 ; i < o->Package.Count; i++){ elem = &o->Package.Elements[i]; - if(elem->Type != ACPI_TYPE_ANY){ - printf("NOREF\n"); - goto error; - } - c->elem[ i - 1].h = elem->Reference.Handle; - - buf2.Pointer = NULL; - buf2.Length = ACPI_ALLOCATE_BUFFER; - - status = AcpiEvaluateObject(c->elem[i - 1].h, NULL, NULL, - &buf2); - if(ACPI_FAILURE(status)){ - printf("FETCH OBJECT\n"); + if (elem->Type == ACPI_TYPE_ANY) { + buf2.Pointer = NULL; + buf2.Length = ACPI_ALLOCATE_BUFFER; + + status = AcpiEvaluateObject(elem->Reference.Handle, + NULL, NULL, &buf2); + if (ACPI_FAILURE(status)){ + printf("FETCH OBJECT\n"); + goto error; + } + subobj = buf2.Pointer; + } else if (elem->Type == ACPI_TYPE_PACKAGE) + subobj = elem; + else { + printf("NO PACKAGE\n"); goto error; } - subobj = buf2.Pointer; if(ACPI_FAILURE(acpi_PkgInt32(subobj,0, &c->elem[i -1].id))){ printf("ID FAILED\n"); goto error; @@ -151,15 +151,17 @@ static ACPI_STATUS acpi_aiboost_getcompo sizeof(c->elem[i - 1].desc)); if(ACPI_FAILURE(status)){ if(status == E2BIG){ - c->elem[i-1].desc[DESCSTRLEN-1] = 0; + c->elem[i - 1].desc[DESCSTRLEN-1] = 0; }else{ printf("DESC FAILED %d\n", i-1); goto error; } } - if(buf2.Pointer) - AcpiOsFree(buf2.Pointer); + if (buf2.Pointer) { + AcpiOsFree(buf2.Pointer); + buf2.Pointer = NULL; + } } if(buf.Pointer) From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 19:35:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8C7F106568F; Tue, 22 Sep 2009 19:35:21 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9888FC08; Tue, 22 Sep 2009 19:35:21 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 72ACC1CE22; Tue, 22 Sep 2009 21:35:20 +0200 (CEST) Date: Tue, 22 Sep 2009 21:35:20 +0200 From: Ed Schouten To: Stanislav Sedov Message-ID: <20090922193520.GH95398@hoeg.nl> References: <200909191756.n8JHuQCq031719@svn.freebsd.org> <20090922154919.55abf2f1.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ca5z/wkVxIQXz1GF" Content-Disposition: inline In-Reply-To: <20090922154919.55abf2f1.stas@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197330 - in head: sys/dev/kbd sys/sys usr.sbin/kbdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 19:35:21 -0000 --Ca5z/wkVxIQXz1GF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, * Stanislav Sedov wrote: > Can we make this conditional depending on some variable like > KBD_UNICODE so it will be possible to avoid the increased > memory footprint (24 bytes per entry) in situations where > unicode support is not required? Or maybe even have this > dynamically allocated? Well, at first I thought about this, but the problem is that there currently is no decoupling of userspace and kernelspace keymap structures. It would have been nice if we had an option to change the struct member size based on a kernel option, but right now that breaks the ioctls, etc. --=20 Ed Schouten WWW: http://80386.nl/ --Ca5z/wkVxIQXz1GF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkq5JvgACgkQ52SDGA2eCwW+EQCffq/xxH3B2qH7UFFsLMrS3BJs wRkAn3kbUQTQGE5LoEc4N1BWUzTV1T3I =UHoM -----END PGP SIGNATURE----- --Ca5z/wkVxIQXz1GF-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 20:08:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9650D106566C; Tue, 22 Sep 2009 20:08:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1C75F8FC08; Tue, 22 Sep 2009 20:08:23 +0000 (UTC) Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n8MK8KMA014716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Sep 2009 06:08:21 +1000 Date: Wed, 23 Sep 2009 06:08:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Roman Divacky In-Reply-To: <200909221616.n8MGG2bB024912@svn.freebsd.org> Message-ID: <20090923045419.E13483@delplex.bde.org> References: <200909221616.n8MGG2bB024912@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197407 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 20:08:24 -0000 On Tue, 22 Sep 2009, Roman Divacky wrote: > Log: > Change unsigned foo to u_foo as required by style(9). > > Requested by: bde > Approved by: ed (mentor) Thanks. style(9) actually doesn't require this, even by example (it has zero examples of u_foo and zero examples of `unsigned', except to say to use C99 uintXX_t instead of old BSD u_intXX_t). Examples from non-broken versions: 4.4BSD-Lite /usr/src/admin/style/style: % /* % * When declaring variables in functions declare them sorted by size, % * then in alphabetical order; multiple ones per line are okay. Old % * style function declarations can go on the same line. ANSI style % * function declarations should go in the include file "extern.h". % * If a line overflows reuse the type keyword. % * % * DO NOT initialize variables in the declarations. ^^^ also broken in FreeBSD % */ % extern u_char one; ^^ (`one' and other variables have unrelated types now) % extern char two; % struct foo three, *four; % double five; % int *six, seven, eight(); % char *nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen; % char *overflow __P((void)); % void *mymalloc __P((u_int)); ^^ NetBSD /usr/src/share/misc/style (style,v 1.30 2005/02/02... at least): % /* % * When declaring variables in functions declare them sorted by size, % * then in alphabetical order; multiple ones per line are okay. % * Function prototypes should go in the include file "extern.h". % * If a line overflows reuse the type keyword. % * % * DO NOT initialize variables in the declarations. % */ % extern uint32_t zero; % extern u_char one; % extern char two; % struct foo three, *four; % double five; % int *six, seven; % char *eight, *nine, ten, eleven, twelve, thirteen; % char fourteen, fifteen, sixteen; FreeBSD version for comparison (style.9,v 1.110 2004/07/03 ... at least): % .Pp % When declaring variables in functions declare them sorted by size, % then in alphabetical order; multiple ones per line are okay. % If a line overflows reuse the type keyword. % .Pp % Be careful to not obfuscate the code by initializing variables in % the declarations. % Use this feature only thoughtfully. % DO NOT use function calls in initializers. % .Bd -literal % struct foo one, *two; % double three; % int *four, five; % char *six, seven, eight, nine, ten, eleven, twelve; Also lost example of "reuse the type keyword". % % four = myfunction(); I prefer the NetBSD version with some modifications: % /* % * When declaring variables in functions declare them sorted by size, Sort on alignment, not size; if alignment isn't known, then sort on type first, with complicated rules for sorting on type (some examples below). % * then in alphabetical order; multiple ones per line are okay. Use the same sorting rules as for structs though the order doesn't matter here. [Don't repeat the details of the rules here.] % * Function prototypes should go in the include file "extern.h". Except most functions should be static. % * If a line overflows reuse the type keyword. [Bug: declarations weren't always keywords even before typedefs existed.] If a line would be longer than the maximum line length (as not yet documented here), then start a new line, repeating the type declaration. % * % * DO NOT initialize variables in the declarations. % */ % extern uint32_t zero; Put a struct first, as in the FreeBSD version. % extern u_char one; % extern char two; Don't permit extern declarations in blocks, as in the FreeBSD version. Putting char variables first violates NetBSD's own rule on sorting by size. The rule shouldn't apply to externs, but it doesn't distinguish externs from locals. % struct foo three, *four; My type-sorting rule doesn't permit mixing pointers with non-pointers. NetBSD's size-sorting rule only permits mixing pointers with non-pointers if the size of the non-pointer is the same as the size of the pointer, or if the rule is misread as being about the size of the part of the type without the '*'. % double five; % int *six, seven; Even for ints, the relative sizes are unknown and/or machine-dependent. My rules would put all pointers before all ints, and this happens to give sorting on both size and alignment on all arches supported by FreeBSD (ILP32 and I32LP64). % char *eight, *nine, ten, eleven, twelve, thirteen; chars are smaller than pointers on most arches and have less than or equal to alignment requirements on all arches, so this example clearly violates NetBSD's own sorting-on-size rule. It also violates the alpha-sorting rule (ten > eleven, although 10 < 11, etc.). In fact, about half of the examples violate the alpha-sorting rule in the same way, starting with (three > four, although 3 < 4). This bug is mostly due to poorly-chosen variable names. % char fourteen, fifteen, sixteen; There are too many examples with the same type and of mixing pointers with non-pointers. Even if the mixing were allowed, 1 example of it would be enough. NetBSD decls sorted by my rules: /* In header file: */ extern uint32_t zero; extern u_char one; extern char two; struct foo three; /* structs first */ stuct foo *four; /* then pointers to structs */ int *six; /* then other pointers... */ char *eight, *nine; /* pointers to least-strict-aligned objs last */ double five; /* then FP scalars */ int seven; /* then integers (typedefed ones first, no ex)*/ /* u_chars before chars no example */ #ifdef TOTALLY_DISORDERED_DONT_DO_THIS char ten, eleven, twelve, thirteen; /* violation of alpha order */ char fourteen, fifteen, sixteen; /* example of "keyword reuse" */ #else char eleven, ten, thirteen, twelve; /* required alpha order ... */ char fifteen, fourteen, sixteen; /* ...is unhelpful here */ #endif The last variables could be named something like v10, v11, ... v16 so that actually following the sorting rules doesn't give an unreadable order. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 20:12:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E6A106566C; Tue, 22 Sep 2009 20:12:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B676E8FC16; Tue, 22 Sep 2009 20:12:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MKCA1k031036; Tue, 22 Sep 2009 20:12:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MKCAKe031034; Tue, 22 Sep 2009 20:12:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909222012.n8MKCAKe031034@svn.freebsd.org> From: Xin LI Date: Tue, 22 Sep 2009 20:12: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: r197416 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 20:12:10 -0000 Author: delphij Date: Tue Sep 22 20:12:10 2009 New Revision: 197416 URL: http://svn.freebsd.org/changeset/base/197416 Log: Temporarily disable typematic retrieving code until we get a real fix, which currently causes hangs in some configurations. Reported by: joel Submitted by: swell.k at gmail.com Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Tue Sep 22 18:34:23 2009 (r197415) +++ head/sys/dev/atkbdc/atkbd.c Tue Sep 22 20:12:10 2009 (r197416) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) || defined(__amd64__) +#if 0 #include #include #include @@ -1089,7 +1089,7 @@ atkbd_shutdown_final(void *v) static int get_typematic(keyboard_t *kbd) { -#if defined(__i386__) || defined(__amd64__) +#if 0 /* * Only some systems allow us to retrieve the keyboard repeat * rate previously set via the BIOS... From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 20:31:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51551106566B; Tue, 22 Sep 2009 20:31:33 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7618FC1A; Tue, 22 Sep 2009 20:31:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MKVXYG031511; Tue, 22 Sep 2009 20:31:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MKVXQU031508; Tue, 22 Sep 2009 20:31:33 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909222031.n8MKVXQU031508@svn.freebsd.org> From: Rui Paulo Date: Tue, 22 Sep 2009 20:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197417 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/asmc dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 20:31:33 -0000 Author: rpaulo Date: Tue Sep 22 20:31:32 2009 New Revision: 197417 URL: http://svn.freebsd.org/changeset/base/197417 Log: MFC 197190: Make the sudden motion sensor work on older models and add a bit of debugging. Submitted by: Christoph Langguth Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/asmc/asmc.c stable/8/sys/dev/asmc/asmcvar.h stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/asmc/asmc.c ============================================================================== --- stable/8/sys/dev/asmc/asmc.c Tue Sep 22 20:12:10 2009 (r197416) +++ stable/8/sys/dev/asmc/asmc.c Tue Sep 22 20:31:32 2009 (r197417) @@ -86,6 +86,10 @@ static void asmc_sms_handler(void *arg) #endif static void asmc_sms_printintr(device_t dev, uint8_t); static void asmc_sms_task(void *arg, int pending); +#ifdef DEBUG +void asmc_dumpall(device_t); +static int asmc_key_dump(device_t, int); +#endif /* * Model functions. @@ -532,6 +536,17 @@ asmc_detach(device_t dev) return (0); } +#ifdef DEBUG +void asmc_dumpall(device_t dev) +{ + int i; + + /* XXX magic number */ + for (i=0; i < 0x100; i++) + asmc_key_dump(dev, i); +} +#endif + static int asmc_init(device_t dev) { @@ -584,13 +599,17 @@ asmc_init(device_t dev) asmc_key_write(dev, ASMC_KEY_SMS_FLAG, buf, 1); DELAY(100); + sc->sc_sms_intr_works = 0; + /* - * Wait up to 5 seconds for SMS initialization. + * Retry SMS initialization 1000 times + * (takes approx. 2 seconds in worst case) */ - for (i = 0; i < 10000; i++) { + for (i = 0; i < 1000; i++) { if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 && - (buf[0] != 0x00 || buf[1] != 0x00)) { + (buf[0] == ASMC_SMS_INIT1 && buf[1] == ASMC_SMS_INIT2)) { error = 0; + sc->sc_sms_intr_works = 1; goto out; } buf[0] = ASMC_SMS_INIT1; @@ -620,6 +639,10 @@ nosms: device_printf(dev, "number of keys: %d\n", buf[3]); } +#ifdef DEBUG + asmc_dumpall(dev); +#endif + return (error); } @@ -729,6 +752,100 @@ out: return (error); } +#ifdef DEBUG +static int +asmc_key_dump(device_t dev, int number) +{ + struct asmc_softc *sc = device_get_softc(dev); + char key[5] = { 0 }; + char type[7] = { 0 }; + uint8_t index[4]; + uint8_t v[32]; + uint8_t maxlen; + int i, error = 1, try = 0; + + mtx_lock_spin(&sc->sc_mtx); + + index[0] = (number >> 24) & 0xff; + index[1] = (number >> 16) & 0xff; + index[2] = (number >> 8) & 0xff; + index[3] = (number) & 0xff; + +begin: + if (asmc_command(dev, 0x12)) + goto out; + + for (i = 0; i < 4; i++) { + ASMC_DATAPORT_WRITE(sc, index[i]); + if (asmc_wait(dev, 0x04)) + goto out; + } + + ASMC_DATAPORT_WRITE(sc, 4); + + for (i = 0; i < 4; i++) { + if (asmc_wait(dev, 0x05)) + goto out; + key[i] = ASMC_DATAPORT_READ(sc); + } + + /* get type */ + if (asmc_command(dev, 0x13)) + goto out; + + for (i = 0; i < 4; i++) { + ASMC_DATAPORT_WRITE(sc, key[i]); + if (asmc_wait(dev, 0x04)) + goto out; + } + + ASMC_DATAPORT_WRITE(sc, 6); + + for (i = 0; i < 6; i++) { + if (asmc_wait(dev, 0x05)) + goto out; + type[i] = ASMC_DATAPORT_READ(sc); + } + + error = 0; +out: + if (error) { + if (++try < 10) goto begin; + device_printf(dev,"%s for key %s failed %d times, giving up\n", + __func__, key, try); + mtx_unlock_spin(&sc->sc_mtx); + } + else { + char buf[1024]; + char buf2[8]; + mtx_unlock_spin(&sc->sc_mtx); + maxlen = type[0]; + type[0] = ' '; + type[5] = 0; + if (maxlen > sizeof(v)) { + device_printf(dev, + "WARNING: cropping maxlen from %d to %zu\n", + maxlen, sizeof(v)); + maxlen = sizeof(v); + } + for (i = 0; i < sizeof(v); i++) { + v[i] = 0; + } + asmc_key_read(dev, key, v, maxlen); + snprintf(buf, sizeof(buf), "key %d is: %s, type %s " + "(len %d), data", number, key, type, maxlen); + for (i = 0; i < maxlen; i++) { + snprintf(buf2, sizeof(buf), " %02x", v[i]); + strlcat(buf, buf2, sizeof(buf)); + } + strlcat(buf, " \n", sizeof(buf)); + device_printf(dev, buf); + } + + return (error); +} +#endif + static int asmc_key_write(device_t dev, const char *key, uint8_t *buf, uint8_t len) { @@ -945,6 +1062,8 @@ asmc_sms_intrfast(void *arg) uint8_t type; device_t dev = (device_t) arg; struct asmc_softc *sc = device_get_softc(dev); + if (!sc->sc_sms_intr_works) + return (FILTER_HANDLED); mtx_lock_spin(&sc->sc_mtx); type = ASMC_INTPORT_READ(sc); Modified: stable/8/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/8/sys/dev/asmc/asmcvar.h Tue Sep 22 20:12:10 2009 (r197416) +++ stable/8/sys/dev/asmc/asmcvar.h Tue Sep 22 20:31:32 2009 (r197417) @@ -49,6 +49,7 @@ struct asmc_softc { int sc_sms_intrtype; struct taskqueue *sc_sms_tq; struct task sc_sms_task; + uint8_t sc_sms_intr_works; }; /* From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 20:58:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF4AC1065670; Tue, 22 Sep 2009 20:58:18 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 074838FC0A; Tue, 22 Sep 2009 20:58:17 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id B949945E35; Tue, 22 Sep 2009 22:58:15 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id EA95145C98; Tue, 22 Sep 2009 22:58:09 +0200 (CEST) Date: Tue, 22 Sep 2009 22:58:10 +0200 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20090922205809.GB2970@garage.freebsd.pl> References: <200909221622.n8MGM5WK025136@svn.freebsd.org> <200909221301.07781.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline In-Reply-To: <200909221301.07781.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r197408 - in head/sys: conf ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 20:58:18 -0000 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 22, 2009 at 01:01:07PM -0400, John Baldwin wrote: > On Tuesday 22 September 2009 12:22:05 pm Roman Divacky wrote: > > Author: rdivacky > > Date: Tue Sep 22 16:22:05 2009 > > New Revision: 197408 > > URL: http://svn.freebsd.org/changeset/base/197408 > >=20 > > Log: > > Don't build ufs_gjournal.c at all if UFS_GJOURNAL option is not given > > instead of building an almost empty C file. > > =20 > > Approved by: pjd > > Approved by: ed (mentor, implicit) > >=20 > > Modified: > > head/sys/conf/files > > head/sys/ufs/ufs/ufs_gjournal.c > >=20 > > Modified: head/sys/conf/files > >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files Tue Sep 22 16:16:02 2009 (r197407) > > +++ head/sys/conf/files Tue Sep 22 16:22:05 2009 (r197408) > > @@ -2634,7 +2634,7 @@ ufs/ufs/ufs_acl.c optional ffs > > ufs/ufs/ufs_bmap.c optional ffs > > ufs/ufs/ufs_dirhash.c optional ffs > > ufs/ufs/ufs_extattr.c optional ffs > > -ufs/ufs/ufs_gjournal.c optional ffs > > +ufs/ufs/ufs_gjournal.c optional ffs UFS_GJOURNAL > > ufs/ufs/ufs_inode.c optional ffs > > ufs/ufs/ufs_lookup.c optional ffs > > ufs/ufs/ufs_quota.c optional ffs >=20 > Hmm, shouldn't this be lowercase? That was my comment to the patch... --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --ew6BAiZeqk4r7MaW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKuTphForvXbEpPzQRAiJxAKDMRl5apNxxJYB0g2fe7kBH9wwDsQCfb+GD BOkLsNIjGBGIfA3DurVAYH4= =tG3f -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 21:35:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC8D10656A6; Tue, 22 Sep 2009 21:35:52 +0000 (UTC) (envelope-from antoine.brodin.freebsd@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 331CD8FC14; Tue, 22 Sep 2009 21:35:50 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so55585fgg.13 for ; Tue, 22 Sep 2009 14:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=vLpdx+7ivdTwY9hAf7TsfojgU4cO87CR79qg0n4q39w=; b=d1l7xv8W+r6TcLxMtTZrCLGtk5Rvg5T7pocaVBzETyNfLXcBBaSslGV/tDjciqTgwE oQOcMqBAixXx6NQlUNiS1hR5IGXNf9J4HcAl6wZ57Ck7qvsRkZnxjhcVzeVEUkmYjcTL 6hujgzcRypKnc0YxiSSVRozJh3H+xP6jG80Uo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=tWQLXBoumgsv8OJe2nznuYvsE1DhIvmGV0mIt2ee717HDXDitxaYmUQN04Kp8MMvZ/ m9CZ4rWurHLMbiArcTaOqqQTFkAj74u7uJtADsGgyESLNPsLGukWdjBVyAEhnncZn27R zqqThj09O1rz+gizjuYiFXCM17WAsoCY6wo4Q= MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.86.18.34 with SMTP id 34mr1199633fgr.2.1253653433091; Tue, 22 Sep 2009 14:03:53 -0700 (PDT) In-Reply-To: <200909191756.n8JHuQCq031719@svn.freebsd.org> References: <200909191756.n8JHuQCq031719@svn.freebsd.org> Date: Tue, 22 Sep 2009 23:03:53 +0200 X-Google-Sender-Auth: 4254c2efe9053a4f Message-ID: From: Antoine Brodin To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197330 - in head: sys/dev/kbd sys/sys usr.sbin/kbdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 21:35:52 -0000 On Sat, Sep 19, 2009 at 7:56 PM, Ed Schouten wrote: > Author: ed > Date: Sat Sep 19 17:56:26 2009 > New Revision: 197330 > URL: http://svn.freebsd.org/changeset/base/197330 > > Log: > =A0Make the keyboard layer Unicode aware. > > =A0Just take keyent_t to use an u_int to store the Unicode codepoints. > =A0Unfortunately the keymap is now too big to be loaded using an ioctl > =A0argument, so change the ioctl to pick a pointer. > > =A0This change breaks kbdcontrol ABI. It doesn't break X11, because X11 > =A0doesn't do anything with syscons keymaps. It just switches the device > =A0out of K_XLATE. Hi, Could you add a note to UPDATING? Using a new kernel with an old world is a bit surprising during login if you don't expect a qwerty keyboard... Thanks Antoine From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 22:17:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77D22106566B; Tue, 22 Sep 2009 22:17:14 +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 681D08FC13; Tue, 22 Sep 2009 22:17:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MMHEJX034008; Tue, 22 Sep 2009 22:17:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MMHErX034006; Tue, 22 Sep 2009 22:17:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909222217.n8MMHErX034006@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Sep 2009 22:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197419 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 22:17:14 -0000 Author: mav Date: Tue Sep 22 22:17:14 2009 New Revision: 197419 URL: http://svn.freebsd.org/changeset/base/197419 Log: MFp4: Reduce code duplication. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Sep 22 20:56:38 2009 (r197418) +++ head/sbin/camcontrol/camcontrol.c Tue Sep 22 22:17:14 2009 (r197419) @@ -1055,23 +1055,22 @@ atacapprint(struct ata_params *parm) printf("\n"); printf("PIO supported PIO"); - if (parm->atavalid & ATA_FLAG_64_70) { - if (parm->apiomodes & 0x02) - printf("4"); - else if (parm->apiomodes & 0x01) - printf("3"); - } else if (parm->mwdmamodes & 0x04) + switch (ata_max_pmode(parm)) { + case ATA_PIO4: printf("4"); - else if (parm->mwdmamodes & 0x02) + break; + case ATA_PIO3: printf("3"); - else if (parm->mwdmamodes & 0x01) + break; + case ATA_PIO2: printf("2"); - else if ((parm->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x200) - printf("2"); - else if ((parm->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x100) + break; + case ATA_PIO1: printf("1"); - else + break; + default: printf("0"); + } printf("\n"); printf("DMA%ssupported ", From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 22:20:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 789891065695; Tue, 22 Sep 2009 22:20:43 +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 68F7A8FC1B; Tue, 22 Sep 2009 22:20:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MMKhHp034115; Tue, 22 Sep 2009 22:20:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MMKh5I034113; Tue, 22 Sep 2009 22:20:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909222220.n8MMKh5I034113@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Sep 2009 22:20: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: r197420 - head/sys/dev/ppbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 22:20:43 -0000 Author: mav Date: Tue Sep 22 22:20:43 2009 New Revision: 197420 URL: http://svn.freebsd.org/changeset/base/197420 Log: Lock bus scan. Modified: head/sys/dev/ppbus/vpo.c Modified: head/sys/dev/ppbus/vpo.c ============================================================================== --- head/sys/dev/ppbus/vpo.c Tue Sep 22 22:17:14 2009 (r197419) +++ head/sys/dev/ppbus/vpo.c Tue Sep 22 22:20:43 2009 (r197420) @@ -176,9 +176,6 @@ vpo_attach(device_t dev) return (ENXIO); } ppb_unlock(ppbus); - - /* all went ok */ - vpo_cam_rescan(vpo); /* have CAM rescan the bus */ return (0); @@ -194,12 +191,15 @@ vpo_cam_rescan_callback(struct cam_perip static void vpo_cam_rescan(struct vpo_data *vpo) { + device_t ppbus = device_get_parent(vpo->vpo_dev); struct cam_path *path; union ccb *ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO); + ppb_lock(ppbus); if (xpt_create_path(&path, xpt_periph, cam_sim_path(vpo->sim), 0, 0) != CAM_REQ_CMP) { /* A failure is benign as the user can do a manual rescan */ + ppb_unlock(ppbus); free(ccb, M_TEMP); return; } @@ -209,6 +209,7 @@ vpo_cam_rescan(struct vpo_data *vpo) ccb->ccb_h.cbfcnp = vpo_cam_rescan_callback; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); + ppb_unlock(ppbus); /* The scan is in progress now. */ } From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 22:23:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D21CD106566C; Tue, 22 Sep 2009 22:23:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C27008FC1D; Tue, 22 Sep 2009 22:23:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MMNqnO034233; Tue, 22 Sep 2009 22:23:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MMNqfK034231; Tue, 22 Sep 2009 22:23:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909222223.n8MMNqfK034231@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Sep 2009 22:23: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: r197421 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 22:23:52 -0000 Author: mav Date: Tue Sep 22 22:23:52 2009 New Revision: 197421 URL: http://svn.freebsd.org/changeset/base/197421 Log: MFp4: If on sense request device returns no sence, give up and return, or we may loop forever. Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Sep 22 22:20:43 2009 (r197420) +++ head/sys/cam/cam_periph.c Tue Sep 22 22:23:52 2009 (r197421) @@ -1034,8 +1034,13 @@ camperiphdone(struct cam_periph *periph, cam_error_print(saved_ccb, CAM_ESF_ALL, CAM_EPF_ALL); #endif - xpt_done_ccb = TRUE; + } else { + saved_ccb->ccb_h.status &= + ~CAM_STATUS_MASK; + saved_ccb->ccb_h.status |= + CAM_AUTOSENSE_FAIL; } + xpt_done_ccb = TRUE; } } bcopy(done_ccb->ccb_h.saved_ccb_ptr, done_ccb, From owner-svn-src-all@FreeBSD.ORG Tue Sep 22 23:11:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E205106566C; Tue, 22 Sep 2009 23:11:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0258D8FC14; Tue, 22 Sep 2009 23:11:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8MNBN8i035354; Tue, 22 Sep 2009 23:11:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8MNBN5A035351; Tue, 22 Sep 2009 23:11:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909222311.n8MNBN5A035351@svn.freebsd.org> From: Ed Maste Date: Tue, 22 Sep 2009 23:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197422 - in stable/7/sys: . contrib/pf kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 23:11:24 -0000 Author: emaste Date: Tue Sep 22 23:11:23 2009 New Revision: 197422 URL: http://svn.freebsd.org/changeset/base/197422 Log: MFC r195134, r195135, r195191 r195134, r195134: Add a complement to FIONREAD, called FIONWRITE, which returns the number of bytes not yet properly disposed of. Implement it for all sockets. r195191: Add FIONSPACE from NetBSD. FIONSPACE is provided so that programs may easily determine how much space is left in the send queue; they do not need to know the send queue size. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/sys_socket.c stable/7/sys/sys/filio.h Modified: stable/7/sys/kern/sys_socket.c ============================================================================== --- stable/7/sys/kern/sys_socket.c Tue Sep 22 22:23:52 2009 (r197421) +++ stable/7/sys/kern/sys_socket.c Tue Sep 22 23:11:23 2009 (r197422) @@ -161,6 +161,19 @@ soo_ioctl(struct file *fp, u_long cmd, v *(int *)data = so->so_rcv.sb_cc; break; + case FIONWRITE: + /* Unlocked read. */ + *(int *)data = so->so_snd.sb_cc; + break; + + case FIONSPACE: + if ((so->so_snd.sb_hiwat < so->so_snd.sb_cc) || + (so->so_snd.sb_mbmax < so->so_snd.sb_mbcnt)) + *(int *)data = 0; + else + *(int *)data = sbspace(&so->so_snd); + break; + case FIOSETOWN: error = fsetown(*(int *)data, &so->so_sigio); break; Modified: stable/7/sys/sys/filio.h ============================================================================== --- stable/7/sys/sys/filio.h Tue Sep 22 22:23:52 2009 (r197421) +++ stable/7/sys/sys/filio.h Tue Sep 22 23:11:23 2009 (r197422) @@ -55,6 +55,8 @@ struct fiodgname_arg { void *buf; }; #define FIODGNAME _IOW('f', 120, struct fiodgname_arg) /* get dev. name */ +#define FIONWRITE _IOR('f', 119, int) /* get # bytes (yet) to write */ +#define FIONSPACE _IOR('f', 118, int) /* get space in send queue */ /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 00:31:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11BEB1065679; Wed, 23 Sep 2009 00:31:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3E4A8FC08; Wed, 23 Sep 2009 00:31:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8N0V8Qn036915; Wed, 23 Sep 2009 00:31:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8N0V8bF036913; Wed, 23 Sep 2009 00:31:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909230031.n8N0V8bF036913@svn.freebsd.org> From: Ed Maste Date: Wed, 23 Sep 2009 00:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197423 - stable/7/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 00:31:09 -0000 Author: emaste Date: Wed Sep 23 00:31:08 2009 New Revision: 197423 URL: http://svn.freebsd.org/changeset/base/197423 Log: MFC r180603: Use %zd for size_t. With this gcore(1) is WARNS=6 clean. Modified: stable/7/usr.bin/gcore/ (props changed) stable/7/usr.bin/gcore/elfcore.c Modified: stable/7/usr.bin/gcore/elfcore.c ============================================================================== --- stable/7/usr.bin/gcore/elfcore.c Tue Sep 22 23:11:23 2009 (r197422) +++ stable/7/usr.bin/gcore/elfcore.c Wed Sep 23 00:31:08 2009 (r197423) @@ -158,7 +158,7 @@ elf_coredump(int efd __unused, int fd, p err(1, "read from %s", memname); if ((size_t)ngot < nwant) errx(1, "short read from %s:" - " wanted %d, got %d", memname, + " wanted %zd, got %zd", memname, nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) @@ -414,7 +414,7 @@ readhdrinfo(pid_t pid, prstatus_t *statu if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1) err(1, "read error from %s", name); if ((size_t)n < sizeof(status->pr_reg)) - errx(1, "short read from %s: wanted %u, got %d", name, + errx(1, "short read from %s: wanted %zd, got %d", name, sizeof status->pr_reg, n); close(fd); @@ -425,7 +425,7 @@ readhdrinfo(pid_t pid, prstatus_t *statu if ((n = read(fd, fpregset, sizeof *fpregset)) == -1) err(1, "read error from %s", name); if ((size_t)n < sizeof(*fpregset)) - errx(1, "short read from %s: wanted %u, got %d", name, + errx(1, "short read from %s: wanted %zd, got %d", name, sizeof *fpregset, n); close(fd); From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 02:45:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBE271065672; Wed, 23 Sep 2009 02:45:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA86E8FC08; Wed, 23 Sep 2009 02:45:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8N2j2Zp042721; Wed, 23 Sep 2009 02:45:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8N2j2wp042719; Wed, 23 Sep 2009 02:45:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909230245.n8N2j2wp042719@svn.freebsd.org> From: Xin LI Date: Wed, 23 Sep 2009 02:45: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: r197424 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 02:45:03 -0000 Author: delphij Date: Wed Sep 23 02:45:02 2009 New Revision: 197424 URL: http://svn.freebsd.org/changeset/base/197424 Log: Initialize registers to zero before calling the interrupt handlers inside emulator. This fixes VESA related freeze observed on some systems. Submitted by: paradox Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Sep 23 00:31:08 2009 (r197423) +++ head/sys/dev/fb/vesa.c Wed Sep 23 02:45:02 2009 (r197424) @@ -221,6 +221,7 @@ int10_set_mode(int mode) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x0000 | mode; x86biosCall(®s, 0x10); @@ -236,6 +237,7 @@ vesa_bios_get_mode(int mode, struct vesa int offs; u_char *buf; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f01; regs.R_ECX = mode; @@ -263,6 +265,7 @@ vesa_bios_set_mode(int mode) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f02; regs.R_EBX = mode; @@ -276,6 +279,7 @@ vesa_bios_get_dac(void) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f08; regs.R_EBX = 1; @@ -292,6 +296,7 @@ vesa_bios_set_dac(int bits) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f08; regs.R_EBX = (bits << 8); @@ -311,6 +316,7 @@ vesa_bios_save_palette(int start, int co u_char *p; int i; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f09; regs.R_EBX = 1; regs.R_ECX = colors; @@ -349,6 +355,7 @@ vesa_bios_save_palette2(int start, int c u_char *p; int i; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f09; regs.R_EBX = 1; regs.R_ECX = colors; @@ -396,6 +403,7 @@ vesa_bios_load_palette(int start, int co p[i*4 + 3] = 0; } + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f09; regs.R_EBX = 0; regs.R_ECX = colors; @@ -431,6 +439,7 @@ vesa_bios_load_palette2(int start, int c p[i*4 + 3] = 0; } + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f09; regs.R_EBX = 0; regs.R_ECX = colors; @@ -452,6 +461,7 @@ vesa_bios_state_buf_size(void) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f04; regs.R_ECX = STATE_ALL; regs.R_EDX = STATE_SIZE; @@ -474,6 +484,7 @@ vesa_bios_save_restore(int code, void *p if (size > VESA_BIOS_BUFSIZE) return (1); + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f04; regs.R_ECX = STATE_ALL; regs.R_EDX = code; @@ -499,6 +510,7 @@ vesa_bios_get_line_length(void) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f06; regs.R_EBX = 1; @@ -515,6 +527,7 @@ vesa_bios_set_line_length(int pixel, int { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f06; regs.R_EBX = 0; regs.R_ECX = pixel; @@ -541,6 +554,7 @@ vesa_bios_get_start(int *x, int *y) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f07; regs.R_EBX = 1; @@ -561,6 +575,7 @@ vesa_bios_set_start(int x, int y) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f07; regs.R_EBX = 0x80; regs.R_EDX = y; @@ -662,6 +677,7 @@ vesa_bios_init(void) vmbuf = (u_char *)x86biosAlloc(1, &offs); bcopy("VBE2", vmbuf, 4); /* try for VBE2 data */ + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f00; regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); @@ -1262,6 +1278,7 @@ vesa_get_origin(video_adapter_t *adp, of { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f05; regs.R_EBX = 0x10; @@ -1296,6 +1313,7 @@ vesa_set_origin(video_adapter_t *adp, of if (adp->va_window_gran == 0) return 1; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f05; regs.R_EBX = 0; regs.R_EDX = offset / adp->va_window_gran; @@ -1304,6 +1322,7 @@ vesa_set_origin(video_adapter_t *adp, of if ((regs.R_AX & 0xff) != 0x4f) return 1; + bzero(®s, sizeof(regs)); regs.R_EAX = 0x4f05; regs.R_EBX = 1; regs.R_EDX = offset / adp->va_window_gran; From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 05:32:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DF661065679; Wed, 23 Sep 2009 05:32:34 +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 3427C8FC12; Wed, 23 Sep 2009 05:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8N5WXHQ054371; Wed, 23 Sep 2009 05:32:33 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8N5WXWU054369; Wed, 23 Sep 2009 05:32:33 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200909230532.n8N5WXWU054369@svn.freebsd.org> From: Mike Silbersack Date: Wed, 23 Sep 2009 05:32: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: r197425 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 05:32:34 -0000 Author: silby Date: Wed Sep 23 05:32:33 2009 New Revision: 197425 URL: http://svn.freebsd.org/changeset/base/197425 Log: In netstat -x, do not try to print out tcp timer status for udp sockets. Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Wed Sep 23 02:45:02 2009 (r197424) +++ head/usr.bin/netstat/inet.c Wed Sep 23 05:32:33 2009 (r197425) @@ -355,6 +355,7 @@ protopr(u_long off, const char *name, in } else { inp = &((struct xinpcb *)xig)->xi_inp; so = &((struct xinpcb *)xig)->xi_socket; + timer = NULL; } /* Ignore sockets for protocols other than the desired one. */ @@ -425,7 +426,7 @@ protopr(u_long off, const char *name, in printf("%7.7s %7.7s %7.7s %7.7s %7.7s %7.7s %s\n", "rexmt", "persist", "keep", "2msl", "delack", "rcvtime", - "(state)"); + "(state)"); } else printf("(state)\n"); } @@ -529,13 +530,14 @@ protopr(u_long off, const char *name, in so->so_rcv.sb_lowat, so->so_snd.sb_lowat, so->so_rcv.sb_mbcnt, so->so_snd.sb_mbcnt, so->so_rcv.sb_mbmax, so->so_snd.sb_mbmax); - printf("%4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d ", - timer->tt_rexmt / 1000, (timer->tt_rexmt % 1000) / 10, - timer->tt_persist / 1000, (timer->tt_persist % 1000) / 10, - timer->tt_keep / 1000, (timer->tt_keep % 1000) / 10, - timer->tt_2msl / 1000, (timer->tt_2msl % 1000) / 10, - timer->tt_delack / 1000, (timer->tt_delack % 1000) / 10, - timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10); + if (timer != NULL) + printf("%4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d ", + timer->tt_rexmt / 1000, (timer->tt_rexmt % 1000) / 10, + timer->tt_persist / 1000, (timer->tt_persist % 1000) / 10, + timer->tt_keep / 1000, (timer->tt_keep % 1000) / 10, + timer->tt_2msl / 1000, (timer->tt_2msl % 1000) / 10, + timer->tt_delack / 1000, (timer->tt_delack % 1000) / 10, + timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10); } } if (istcp && !Lflag) { From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 09:18:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC915106568D; Wed, 23 Sep 2009 09:18:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBE838FC43; Wed, 23 Sep 2009 09:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8N9IGEa058520; Wed, 23 Sep 2009 09:18:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8N9IGP4058519; Wed, 23 Sep 2009 09:18:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909230918.n8N9IGP4058519@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 23 Sep 2009 09:18: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: r197426 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 09:18:17 -0000 Author: pjd Date: Wed Sep 23 09:18:16 2009 New Revision: 197426 URL: http://svn.freebsd.org/changeset/base/197426 Log: Restore BSD behaviour - when creating new directory entry use parent directory gid to set group ownership and not process gid. This was overlooked during v6 -> v13 switch. PR: kern/139076 Reported by: Sean Winn MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Sep 23 05:32:33 2009 (r197425) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Sep 23 09:18:16 2009 (r197426) @@ -1841,7 +1841,7 @@ zfs_perm_init(znode_t *zp, znode_t *pare fgid = zfs_fuid_create_cred(zfsvfs, ZFS_GROUP, tx, cr, fuidp); #ifdef __FreeBSD__ - gid = parent->z_phys->zp_gid; + gid = fgid = parent->z_phys->zp_gid; #else gid = crgetgid(cr); #endif From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 10:12:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C666D106566B; Wed, 23 Sep 2009 10:12:58 +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 B52A78FC1C; Wed, 23 Sep 2009 10:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NACwp4059631; Wed, 23 Sep 2009 10:12:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NACwlo059629; Wed, 23 Sep 2009 10:12:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909231012.n8NACwlo059629@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Sep 2009 10:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197427 - stable/8/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 10:12:58 -0000 Author: marius Date: Wed Sep 23 10:12:58 2009 New Revision: 197427 URL: http://svn.freebsd.org/changeset/base/197427 Log: MFC: r197368 - Update the list of known-working machines based on feedback for 7.2. - Update the V440 entry regarding added support for the on-board NICs in 8.0. Approved by: re (kib), blackend Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Sep 23 09:18:16 2009 (r197426) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Sep 23 10:12:58 2009 (r197427) @@ -503,6 +503,10 @@ + &sun.blade; 2500 + + + &sun.fire; 280R @@ -511,7 +515,12 @@ - &sun.fire; V440 (except for the on-board NICs) + &sun.fire; V250 + + + + &sun.fire; V440 (support for the on-board NICs first + appeared in 8.0-RELEASE) From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 12:08:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA5D01065672; Wed, 23 Sep 2009 12:08:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 982588FC1F; Wed, 23 Sep 2009 12:08:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NC88ij063281; Wed, 23 Sep 2009 12:08:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NC88sk063275; Wed, 23 Sep 2009 12:08:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909231208.n8NC88sk063275@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Sep 2009 12:08: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: r197428 - in head/sys: conf fs/procfs modules/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 12:08:08 -0000 Author: kib Date: Wed Sep 23 12:08:08 2009 New Revision: 197428 URL: http://svn.freebsd.org/changeset/base/197428 Log: Add per-process osrel node to the procfs, to allow read and set p_osrel value for the process. Approved by: des (procfs maintainer) MFC after: 3 weeks Added: head/sys/fs/procfs/procfs_osrel.c (contents, props changed) Modified: head/sys/conf/files head/sys/fs/procfs/procfs.c head/sys/fs/procfs/procfs.h head/sys/modules/procfs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Sep 23 10:12:58 2009 (r197427) +++ head/sys/conf/files Wed Sep 23 12:08:08 2009 (r197428) @@ -1792,6 +1792,7 @@ fs/procfs/procfs_ioctl.c optional procfs fs/procfs/procfs_map.c optional procfs fs/procfs/procfs_mem.c optional procfs fs/procfs/procfs_note.c optional procfs +fs/procfs/procfs_osrel.c optional procfs fs/procfs/procfs_regs.c optional procfs fs/procfs/procfs_rlimit.c optional procfs fs/procfs/procfs_status.c optional procfs Modified: head/sys/fs/procfs/procfs.c ============================================================================== --- head/sys/fs/procfs/procfs.c Wed Sep 23 10:12:58 2009 (r197427) +++ head/sys/fs/procfs/procfs.c Wed Sep 23 12:08:08 2009 (r197428) @@ -108,7 +108,8 @@ procfs_attr(PFS_ATTR_ARGS) else if (strcmp(pn->pn_name, "mem") == 0 || strcmp(pn->pn_name, "regs") == 0 || strcmp(pn->pn_name, "dbregs") == 0 || - strcmp(pn->pn_name, "fpregs") == 0) + strcmp(pn->pn_name, "fpregs") == 0 || + strcmp(pn->pn_name, "osrel") == 0) vap->va_mode = 0600; if (p != NULL) { @@ -186,6 +187,8 @@ procfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "status", procfs_doprocstatus, NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "osrel", procfs_doosrel, + procfs_attr, procfs_candebug, NULL, PFS_RDWR); pfs_create_link(dir, "file", procfs_doprocfile, NULL, procfs_notsystem, NULL, 0); Modified: head/sys/fs/procfs/procfs.h ============================================================================== --- head/sys/fs/procfs/procfs.h Wed Sep 23 10:12:58 2009 (r197427) +++ head/sys/fs/procfs/procfs.h Wed Sep 23 12:08:08 2009 (r197428) @@ -39,6 +39,7 @@ #ifdef _KERNEL int procfs_docurproc(PFS_FILL_ARGS); +int procfs_doosrel(PFS_FILL_ARGS); int procfs_doproccmdline(PFS_FILL_ARGS); int procfs_doprocctl(PFS_FILL_ARGS); int procfs_doprocdbregs(PFS_FILL_ARGS); Added: head/sys/fs/procfs/procfs_osrel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/procfs/procfs_osrel.c Wed Sep 23 12:08:08 2009 (r197428) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +int +procfs_doosrel(PFS_FILL_ARGS) +{ + const char *pp; + int ov, osrel, i; + + if (uio == NULL) + return (EOPNOTSUPP); + if (uio->uio_rw == UIO_READ) { + sbuf_printf(sb, "%d\n", p->p_osrel); + } else { + sbuf_trim(sb); + sbuf_finish(sb); + pp = sbuf_data(sb); + osrel = 0; + i = sbuf_len(sb); + while (i--) { + if (*pp < '0' || *pp > '9') + return (EINVAL); + ov = osrel * 10 + *pp++ - '0'; + if (ov < osrel) + return (EINVAL); + osrel = ov; + } + p->p_osrel = osrel; + } + return (0); +} Modified: head/sys/modules/procfs/Makefile ============================================================================== --- head/sys/modules/procfs/Makefile Wed Sep 23 10:12:58 2009 (r197427) +++ head/sys/modules/procfs/Makefile Wed Sep 23 12:08:08 2009 (r197428) @@ -13,6 +13,7 @@ SRCS+= procfs_ioctl.c SRCS+= procfs_map.c SRCS+= procfs_mem.c SRCS+= procfs_note.c +SRCS+= procfs_osrel.c SRCS+= procfs_regs.c SRCS+= procfs_rlimit.c SRCS+= procfs_status.c From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 12:10:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 209B1106566B; Wed, 23 Sep 2009 12:10:14 +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 0F8038FC08; Wed, 23 Sep 2009 12:10:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NCADNI063358; Wed, 23 Sep 2009 12:10:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NCADTM063356; Wed, 23 Sep 2009 12:10:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909231210.n8NCADTM063356@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Sep 2009 12:10: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: r197429 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 12:10:14 -0000 Author: kib Date: Wed Sep 23 12:10:13 2009 New Revision: 197429 URL: http://svn.freebsd.org/changeset/base/197429 Log: Document osrel node for procfs. Approved by: des (procfs maintainer) MFC after: 3 weeks Modified: head/share/man/man5/procfs.5 Modified: head/share/man/man5/procfs.5 ============================================================================== --- head/share/man/man5/procfs.5 Wed Sep 23 12:08:08 2009 (r197428) +++ head/share/man/man5/procfs.5 Wed Sep 23 12:10:13 2009 (r197429) @@ -2,7 +2,7 @@ .\" Written by Garrett Wollman .\" This file is in the public domain. .\" -.Dd July 9, 2009 +.Dd September 22, 2009 .Dt PROCFS 5 .Os .Sh NAME @@ -117,6 +117,12 @@ Not implemented. .It Pa notepg Used for sending signal to the process group. Not implemented. +.It Pa osrel +Allows read and write of the kernel osrel value assigned to the process. +It affects the compatibility shims that are turned on and off +depending on the value. +Initial process value is read from the ABI note tag in the executed ELF image, +and is zero if the tag not supported by binary format or was not found. .It Pa regs Allows read and write access to the process' register set. This file contains a binary data structure @@ -237,6 +243,8 @@ the complete virtual address space of th used for signaling the process .It Pa /proc/curproc/notepg used for signaling the process group +.It Pa /proc/curproc/osrel +the process osrel value .It Pa /proc/curproc/regs the process register set .It Pa /proc/curproc/rlimit From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 12:33:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59C41106566B; Wed, 23 Sep 2009 12:33:32 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 486D88FC16; Wed, 23 Sep 2009 12:33:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NCXWns063829; Wed, 23 Sep 2009 12:33:32 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NCXW80063827; Wed, 23 Sep 2009 12:33:32 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200909231233.n8NCXW80063827@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 23 Sep 2009 12:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197430 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 12:33:32 -0000 Author: stas Date: Wed Sep 23 12:33:32 2009 New Revision: 197430 URL: http://svn.freebsd.org/changeset/base/197430 Log: - Bump __FreeBSD_version to reflect the point when EVFILT_USER kevent filter has been implemented. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Sep 23 12:10:13 2009 (r197429) +++ head/sys/sys/param.h Wed Sep 23 12:33:32 2009 (r197430) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900001 /* Master, propagated to newvers */ +#define __FreeBSD_version 900002 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 13:49:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08380106566B; Wed, 23 Sep 2009 13:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E897C8FC14; Wed, 23 Sep 2009 13:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NDngjR065369; Wed, 23 Sep 2009 13:49:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NDng9i065368; Wed, 23 Sep 2009 13:49:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909231349.n8NDng9i065368@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Sep 2009 13:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197431 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 13:49:43 -0000 Author: kib Date: Wed Sep 23 13:49:41 2009 New Revision: 197431 URL: http://svn.freebsd.org/changeset/base/197431 Log: MFC r197348: For a.out and pre-8 ELF binaries, allow the mmap of zero length. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/vm/vm_mmap.c Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Wed Sep 23 12:33:32 2009 (r197430) +++ stable/8/sys/vm/vm_mmap.c Wed Sep 23 13:49:41 2009 (r197431) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -229,7 +230,8 @@ mmap(td, uap) fp = NULL; /* make sure mapping fits into numeric range etc */ - if (uap->len == 0 || + if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && + curproc->p_osrel >= 800104) || ((flags & MAP_ANON) && uap->fd != -1)) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 14:23:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681021065672; Wed, 23 Sep 2009 14:23:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 567AD8FC14; Wed, 23 Sep 2009 14:23:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NEN9wh066048; Wed, 23 Sep 2009 14:23:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NEN9cE066046; Wed, 23 Sep 2009 14:23:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909231423.n8NEN9cE066046@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Sep 2009 14:23: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: r197432 - head/tools/regression/sockets/accf_data_attach X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 14:23:09 -0000 Author: jhb Date: Wed Sep 23 14:23:09 2009 New Revision: 197432 URL: http://svn.freebsd.org/changeset/base/197432 Log: - Remove a bogus test: setsockopt() doesn't return a length, getsockopt() does. - Use %z to printf a size_t to fix compile on 64-bit platforms. Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c ============================================================================== --- head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Wed Sep 23 13:49:41 2009 (r197431) +++ head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Wed Sep 23 14:23:09 2009 (r197432) @@ -169,9 +169,6 @@ main(int argc, char *argv[]) if (ret != 0) errx(-1, "not ok 9 - setsockopt() after listen() failed with %d " "(%s)", errno, strerror(errno)); - if (len != sizeof(afa)) - errx(-1, "not ok 9 - setsockopt() after listen() returned wrong " - "size (%d vs expected %d)", len, sizeof(afa)); printf("ok 9 - setsockopt\n"); /* @@ -186,7 +183,7 @@ main(int argc, char *argv[]) "failed with %d (%s)", errno, strerror(errno)); if (len != sizeof(afa)) errx(-1, "not ok 10 - getsockopt() after setsockopet() after " - "listen() returned wrong size (got %d expected %d)", len, + "listen() returned wrong size (got %d expected %zd)", len, sizeof(afa)); if (strcmp(afa.af_name, ACCF_NAME) != 0) errx(-1, "not ok 10 - getsockopt() after setsockopt() after " From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 14:48:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905A01065679; Wed, 23 Sep 2009 14:48:13 +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 7F73C8FC13; Wed, 23 Sep 2009 14:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NEmDmh066500; Wed, 23 Sep 2009 14:48:13 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NEmDDr066498; Wed, 23 Sep 2009 14:48:13 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200909231448.n8NEmDDr066498@svn.freebsd.org> From: Max Laier Date: Wed, 23 Sep 2009 14:48: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: r197433 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 14:48:13 -0000 Author: mlaier Date: Wed Sep 23 14:48:13 2009 New Revision: 197433 URL: http://svn.freebsd.org/changeset/base/197433 Log: Improve on r197334: Find the most recently merged svn revision, too. If we get a svn revision that matches HEAD use rXXX=GIT otherwise use rXXX+GIT. Submitted by: avg MFC after: 3 days X-MFC: not stable/8 before 8.0 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Wed Sep 23 14:23:09 2009 (r197432) +++ head/sys/conf/newvers.sh Wed Sep 23 14:48:13 2009 (r197433) @@ -114,9 +114,16 @@ case "$d" in svn=`$git_cmd svn find-rev $git 2>/dev/null` if [ -n "$svn" ] ; then svn=" r${svn}" - git="-${git}" + git="=${git}" else - git=" ${git}" + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then + svn=" r${svn}" + git="+${git}" + else + git=" ${git}" + fi fi if $git_cmd --work-tree=${SRCDIR} diff-index \ --name-only HEAD | read dummy; then From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:06:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507011065679; Wed, 23 Sep 2009 15:06:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EE5C8FC08; Wed, 23 Sep 2009 15:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NF6qqu066950; Wed, 23 Sep 2009 15:06:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NF6q7E066948; Wed, 23 Sep 2009 15:06:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200909231506.n8NF6q7E066948@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 23 Sep 2009 15:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197434 - head/tools/regression/acltools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:06:52 -0000 Author: trasz Date: Wed Sep 23 15:06:51 2009 New Revision: 197434 URL: http://svn.freebsd.org/changeset/base/197434 Log: Add ACL fuzzer. It's not used by the regression tests right now, but I'd prefert to have it here, so it won't get lost. Added: head/tools/regression/acltools/aclfuzzer.sh (contents, props changed) Added: head/tools/regression/acltools/aclfuzzer.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/acltools/aclfuzzer.sh Wed Sep 23 15:06:51 2009 (r197434) @@ -0,0 +1,225 @@ +#!/bin/sh +# +# Copyright (c) 2008, 2009 Edward Tomasz NapieraÅ‚a +# 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$ +# + +# This is an NFSv4 ACL fuzzer. It expects to be run by non-root in a scratch +# directory on a filesystem with NFSv4 ACLs support. Output it generates +# is expected to be fed to /usr/src/tools/regression/acltools/run script. + +NUMBER_OF_COMMANDS=300 + +run_command() +{ + echo "\$ $1" + eval $1 2>&1 | sed 's/^/> /' +} + +rnd_from_0_to() +{ + max=`expr $1 + 1` + rnd=`jot -r 1` + rnd=`expr $rnd % $max` + + echo $rnd +} + +rnd_path() +{ + rnd=`rnd_from_0_to 3` + case $rnd in + 0) echo "$TMP/aaa" ;; + 1) echo "$TMP/bbb" ;; + 2) echo "$TMP/aaa/ccc" ;; + 3) echo "$TMP/bbb/ddd" ;; + esac +} + +f_prepend_random_acl_on() +{ + rnd=`rnd_from_0_to 4` + case $rnd in + 0) u="owner@" ;; + 1) u="group@" ;; + 2) u="everyone@" ;; + 3) u="u:1138" ;; + 4) u="g:1138" ;; + esac + + p="" + while :; do + rnd=`rnd_from_0_to 30` + if [ -n "$p" -a $rnd -ge 14 ]; then + break; + fi + + case $rnd in + 0) p="${p}r" ;; + 1) p="${p}w" ;; + 2) p="${p}x" ;; + 3) p="${p}p" ;; + 4) p="${p}d" ;; + 5) p="${p}D" ;; + 6) p="${p}a" ;; + 7) p="${p}A" ;; + 8) p="${p}R" ;; + 9) p="${p}W" ;; + 10) p="${p}R" ;; + 11) p="${p}c" ;; + 12) p="${p}C" ;; + 13) p="${p}o" ;; + 14) p="${p}s" ;; + esac + done + + f="" + while :; do + rnd=`rnd_from_0_to 10` + if [ $rnd -ge 6 ]; then + break; + fi + + case $rnd in + 0) f="${f}f" ;; + 1) f="${f}d" ;; + 2) f="${f}n" ;; + 3) f="${f}i" ;; + esac + done + + rnd=`rnd_from_0_to 1` + case $rnd in + 0) x="allow" ;; + 1) x="deny" ;; + esac + + acl="$u:$p:$f:$x" + + file=`rnd_path` + run_command "setfacl -a0 $acl $file" +} + +f_getfacl() +{ + file=`rnd_path` + run_command "getfacl -qn $file" +} + +f_ls_mode() +{ + file=`rnd_path` + run_command "ls -al $file | sed -n '2p' | cut -d' ' -f1" +} + +f_chmod() +{ + b1=`rnd_from_0_to 7` + b2=`rnd_from_0_to 7` + b3=`rnd_from_0_to 7` + b4=`rnd_from_0_to 7` + file=`rnd_path` + + run_command "chmod $b1$b2$b3$b4 $file $2" +} + +f_touch() +{ + file=`rnd_path` + run_command "touch $file" +} + +f_rm() +{ + file=`rnd_path` + run_command "rm -f $file" +} + +f_mkdir() +{ + file=`rnd_path` + run_command "mkdir $file" +} + +f_rmdir() +{ + file=`rnd_path` + run_command "rmdir $file" +} + +f_mv() +{ + from=`rnd_path` + to=`rnd_path` + run_command "mv -f $from $to" +} + +# XXX: To be implemented: chown(8), setting times with touch(1). + +switch_to_random_user() +{ + # XXX: To be implemented. +} + +execute_random_command() +{ + rnd=`rnd_from_0_to 20` + + case $rnd in + 0|10|11|12|13|15) cmd=f_prepend_random_acl_on ;; + 1) cmd=f_getfacl ;; + 2) cmd=f_ls_mode ;; + 3) cmd=f_chmod ;; + 4|18|19) cmd=f_touch ;; + 5) cmd=f_rm ;; + 6|16|17) cmd=f_mkdir ;; + 7) cmd=f_rmdir ;; + 8) cmd=f_mv ;; + esac + + $cmd "XXX" +} + +echo "# Fuzzing; will stop after $NUMBER_OF_COMMANDS commands." +TMP="aclfuzzer_`dd if=/dev/random bs=1k count=1 2>/dev/null | openssl md5`" + +run_command "whoami" +umask 022 +run_command "umask 022" +run_command "mkdir $TMP" + +i=0; +while [ "$i" -lt "$NUMBER_OF_COMMANDS" ]; do + switch_to_random_user + execute_random_command + i=`expr $i + 1` +done + +run_command "find $TMP -exec setfacl -a0 everyone@:rxd:allow {} \;" +run_command "rm -rfv $TMP" + +echo "# Fuzzed, thank you." + From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:09:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0411065676; Wed, 23 Sep 2009 15:09:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DAEF8FC0C; Wed, 23 Sep 2009 15:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NF9Y1g067027; Wed, 23 Sep 2009 15:09:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NF9YUp067025; Wed, 23 Sep 2009 15:09:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200909231509.n8NF9YUp067025@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 23 Sep 2009 15: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: r197435 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:09:34 -0000 Author: trasz Date: Wed Sep 23 15:09:34 2009 New Revision: 197435 URL: http://svn.freebsd.org/changeset/base/197435 Log: In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result in EINVAL, not EOPNOTSUPP. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 23 15:06:51 2009 (r197434) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 23 15:09:34 2009 (r197435) @@ -4860,7 +4860,7 @@ zfs_freebsd_getacl(ap) vsecattr_t vsecattr; if (ap->a_type != ACL_TYPE_NFS4) - return (EOPNOTSUPP); + return (EINVAL); vsecattr.vsa_mask = VSA_ACE | VSA_ACECNT; if (error = zfs_getsecattr(ap->a_vp, &vsecattr, 0, ap->a_cred, NULL)) @@ -4889,7 +4889,7 @@ zfs_freebsd_setacl(ap) aclent_t *aaclp; if (ap->a_type != ACL_TYPE_NFS4) - return (EOPNOTSUPP); + return (EINVAL); if (ap->a_aclp->acl_cnt < 1 || ap->a_aclp->acl_cnt > MAX_ACL_ENTRIES) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:12:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81085106566C; Wed, 23 Sep 2009 15:12:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF7B8FC1C; Wed, 23 Sep 2009 15:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NFCKFe067130; Wed, 23 Sep 2009 15:12:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NFCKZ1067126; Wed, 23 Sep 2009 15:12:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200909231512.n8NFCKZ1067126@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 23 Sep 2009 15:12: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: r197436 - head/tools/regression/acltools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:12:20 -0000 Author: trasz Date: Wed Sep 23 15:12:20 2009 New Revision: 197436 URL: http://svn.freebsd.org/changeset/base/197436 Log: Add cross-filesystem regression tests for ACLs. Added: head/tools/regression/acltools/03.t (contents, props changed) head/tools/regression/acltools/tools-crossfs.test (contents, props changed) Modified: head/tools/regression/acltools/00.t Modified: head/tools/regression/acltools/00.t ============================================================================== --- head/tools/regression/acltools/00.t Wed Sep 23 15:09:34 2009 (r197435) +++ head/tools/regression/acltools/00.t Wed Sep 23 15:12:20 2009 (r197436) @@ -27,7 +27,7 @@ # $FreeBSD$ # -# This is a wrapper script to run tools-posix.test. +# This is a wrapper script to run tools-posix.test on UFS filesystem. # # If any of the tests fails, here is how to debug it: go to # the directory with problematic filesystem mounted on it, Added: head/tools/regression/acltools/03.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/acltools/03.t Wed Sep 23 15:12:20 2009 (r197436) @@ -0,0 +1,110 @@ +#!/bin/sh +# +# Copyright (c) 2008, 2009 Edward Tomasz NapieraÅ‚a +# 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$ +# + +# This is a wrapper script to run tools-crossfs.test between UFS without +# ACLs, UFS with POSIX.1e ACLs, and ZFS with NFSv4 ACLs. +# +# WARNING: It uses hardcoded ZFS pool name "acltools" +# +# Output should be obvious. + +echo "1..5" + +if [ `whoami` != "root" ]; then + echo "not ok 1 - you need to be root to run this test." + exit 1 +fi + +TESTDIR=`dirname $0` +MNTROOT=`mktemp -dt acltools` + +# Set up the test filesystems. +MD1=`mdconfig -at swap -s 64m` +MNT1=$MNTROOT/nfs4 +mkdir $MNT1 +zpool create -R $MNT1 acltools /dev/$MD1 +if [ $? -ne 0 ]; then + echo "not ok 1 - 'zpool create' failed." + exit 1 +fi + +echo "ok 1" + +MD2=`mdconfig -at swap -s 10m` +MNT2=$MNTROOT/posix +mkdir $MNT2 +newfs /dev/$MD2 > /dev/null +mount -o acls /dev/$MD2 $MNT2 +if [ $? -ne 0 ]; then + echo "not ok 2 - mount failed." + exit 1 +fi + +echo "ok 2" + +MD3=`mdconfig -at swap -s 10m` +MNT3=$MNTROOT/none +mkdir $MNT3 +newfs /dev/$MD3 > /dev/null +mount /dev/$MD3 $MNT3 +if [ $? -ne 0 ]; then + echo "not ok 3 - mount failed." + exit 1 +fi + +echo "ok 3" + +cd $MNTROOT + +perl $TESTDIR/run $TESTDIR/tools-crossfs.test > /dev/null + +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +cd / + +umount -f $MNT3 +rmdir $MNT3 +mdconfig -du $MD3 + +umount -f $MNT2 +rmdir $MNT2 +mdconfig -du $MD2 + +zpool destroy -f acltools +rmdir $MNT1 +mdconfig -du $MD1 + +rmdir $MNTROOT + +echo "ok 5" + Added: head/tools/regression/acltools/tools-crossfs.test ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/acltools/tools-crossfs.test Wed Sep 23 15:12:20 2009 (r197436) @@ -0,0 +1,178 @@ +# Copyright (c) 2008, 2009 Edward Tomasz NapieraÅ‚a +# 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$ +# + +# This is a tools-level test intended to verify that cp(1) and mv(1) +# do the right thing with respect to ACLs. Run it as root using +# ACL-enabled kernel: +# +# /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-nfs4.test +# +# You need to have three subdirectories, named nfs4, posix and none, +# with filesystems with NFSv4 ACLs, POSIX.1e ACLs and no ACLs enabled, +# respectively, mounted on them, in your current directory. +# +# WARNING: Creates files in unsafe way. + +$ whoami +> root +$ umask 022 + +$ touch nfs4/xxx +$ getfacl -nq nfs4/xxx +> owner@:--x-----------:------:deny +> owner@:rw-p---A-W-Co-:------:allow +> group@:-wxp----------:------:deny +> group@:r-------------:------:allow +> everyone@:-wxp---A-W-Co-:------:deny +> everyone@:r-----a-R-c--s:------:allow + +$ touch posix/xxx +$ getfacl -nq posix/xxx +> user::rw- +> group::r-- +> other::r-- + +$ rm posix/xxx + +# mv without any ACLs. +$ chmod 456 nfs4/xxx +$ mv nfs4/xxx posix/ +$ ls -l posix/xxx | cut -d' ' -f1 +> -r--r-xrw- + +# mv with POSIX.1e ACLs. +$ setfacl -m u:42:x,g:43:w posix/xxx +$ rm -f posix/yyy +$ mv posix/xxx posix/yyy +$ getfacl -nq posix/yyy +> user::r-- +> user:42:--x +> group::r-x +> group:43:-w- +> mask::rwx +> other::rw- + +# mv from POSIX.1e to NFSv4. +$ rm -f nfs4/xxx +$ mv posix/yyy nfs4/xxx +> mv: failed to set acl entries for nfs4/xxx: Invalid argument +$ getfacl -nq nfs4/xxx +> owner@:-wxp----------:------:deny +> owner@:r------A-W-Co-:------:allow +> group@:--------------:------:deny +> group@:rwxp----------:------:allow +> everyone@:--x----A-W-Co-:------:deny +> everyone@:rw-p--a-R-c--s:------:allow + +# mv with NFSv4 ACLs. +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ rm -f nfs4/yyy +$ mv nfs4/xxx nfs4/yyy +$ getfacl -nq nfs4/yyy +> user:42:--x-----------:------:allow +> group:43:-w------------:------:allow +> owner@:-wxp----------:------:deny +> owner@:r------A-W-Co-:------:allow +> group@:--------------:------:deny +> group@:rwxp----------:------:allow +> everyone@:--x----A-W-Co-:------:deny +> everyone@:rw-p--a-R-c--s:------:allow + +# mv from NFSv4 to POSIX.1e. +$ rm -f posix/xxx +$ mv nfs4/yyy posix/xxx +> mv: failed to set acl entries for posix/xxx: Invalid argument +$ ls -l posix/xxx | cut -d' ' -f1 +> -r--rwxrw- + +# mv from POSIX.1e to none. +$ setfacl -m u:42:x,g:43:w posix/xxx +$ mv posix/xxx none/xxx +> mv: failed to set acl entries for none/xxx: Operation not supported +$ ls -l none/xxx | cut -d' ' -f1 +> -r--rwxrw- + +# cp with POSIX.1e ACLs. +$ rm -f posix/xxx +$ touch posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ getfacl -nq posix/xxx +> user::rw- +> user:42:--x +> group::r-- +> group:43:-w- +> mask::rwx +> other::r-- + +$ rm -f posix/yyy +$ cp posix/xxx posix/yyy +$ getfacl -nq posix/yyy +> user::rw- +> group::r-x +> other::r-- + +$ rm -f posix/yyy +$ cp -p posix/xxx posix/yyy +$ getfacl -nq posix/yyy +> user::rw- +> user:42:--x +> group::r-- +> group:43:-w- +> mask::rwx +> other::r-- + +# mv from POSIX.1e to NFSv4. +$ rm -f nfs4/xxx +$ cp -p posix/xxx nfs4/xxx +> cp: failed to set acl entries for nfs4/xxx: Invalid argument +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -rw-rwxr-- + +# cp with NFSv4 ACLs. +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ rm -f nfs4/yyy +$ cp -p nfs4/xxx nfs4/yyy +$ getfacl -nq nfs4/yyy +> user:42:--x-----------:------:allow +> group:43:-w------------:------:allow +> owner@:--x-----------:------:deny +> owner@:rw-p---A-W-Co-:------:allow +> group@:--------------:------:deny +> group@:rwxp----------:------:allow +> everyone@:-wxp---A-W-Co-:------:deny +> everyone@:r-----a-R-c--s:------:allow + +# cp from NFSv4 to POSIX.1e. +$ rm -f posix/xxx +$ cp -p nfs4/xxx posix/xxx +> cp: failed to set acl entries for posix/xxx: Invalid argument +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr-- + +$ cp -p nfs4/yyy none/xxx +> cp: failed to set acl entries for none/xxx: Operation not supported + From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:32:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2A651065670; Wed, 23 Sep 2009 15:32:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D20768FC0A; Wed, 23 Sep 2009 15:32:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NFWxKa067519; Wed, 23 Sep 2009 15:32:59 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NFWxqW067517; Wed, 23 Sep 2009 15:32:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909231532.n8NFWxqW067517@svn.freebsd.org> From: Ed Maste Date: Wed, 23 Sep 2009 15:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197437 - head/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:33:00 -0000 Author: emaste Date: Wed Sep 23 15:32:59 2009 New Revision: 197437 URL: http://svn.freebsd.org/changeset/base/197437 Log: Use %zu for size_t, not %zd. Submitted by: ru MFC after: 1 week Modified: head/usr.bin/gcore/elfcore.c Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Wed Sep 23 15:12:20 2009 (r197436) +++ head/usr.bin/gcore/elfcore.c Wed Sep 23 15:32:59 2009 (r197437) @@ -158,7 +158,7 @@ elf_coredump(int efd __unused, int fd, p err(1, "read from %s", memname); if ((size_t)ngot < nwant) errx(1, "short read from %s:" - " wanted %zd, got %zd", memname, + " wanted %zu, got %zd", memname, nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) @@ -414,7 +414,7 @@ readhdrinfo(pid_t pid, prstatus_t *statu if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1) err(1, "read error from %s", name); if ((size_t)n < sizeof(status->pr_reg)) - errx(1, "short read from %s: wanted %zd, got %d", name, + errx(1, "short read from %s: wanted %zu, got %d", name, sizeof status->pr_reg, n); close(fd); @@ -425,7 +425,7 @@ readhdrinfo(pid_t pid, prstatus_t *statu if ((n = read(fd, fpregset, sizeof *fpregset)) == -1) err(1, "read error from %s", name); if ((size_t)n < sizeof(*fpregset)) - errx(1, "short read from %s: wanted %zd, got %d", name, + errx(1, "short read from %s: wanted %zu, got %d", name, sizeof *fpregset, n); close(fd); From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:39:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30153106568D; Wed, 23 Sep 2009 15:39:55 +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 201378FC2A; Wed, 23 Sep 2009 15:39:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NFdtY2067695; Wed, 23 Sep 2009 15:39:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NFdtCm067693; Wed, 23 Sep 2009 15:39:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909231539.n8NFdtCm067693@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Sep 2009 15:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197438 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:39:55 -0000 Author: jhb Date: Wed Sep 23 15:39:54 2009 New Revision: 197438 URL: http://svn.freebsd.org/changeset/base/197438 Log: Uninline an instance of STAILQ_FOREACH_SAFE(). Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Wed Sep 23 15:32:59 2009 (r197437) +++ head/sys/dev/acpica/acpi_video.c Wed Sep 23 15:39:54 2009 (r197438) @@ -282,8 +282,7 @@ acpi_video_detach(device_t dev) acpi_video_notify_handler); ACPI_SERIAL_BEGIN(video); - for (vo = STAILQ_FIRST(&sc->vid_outputs); vo != NULL; vo = vn) { - vn = STAILQ_NEXT(vo, vo_next); + STAILQ_FOREACH_SAFE(vo, &sc->vid_outputs, vo_next, vn) { acpi_video_vo_destroy(vo); } ACPI_SERIAL_END(video); From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:42:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6EDF1065712; Wed, 23 Sep 2009 15:42:35 +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 C47AE8FC15; Wed, 23 Sep 2009 15:42:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NFgZZT067786; Wed, 23 Sep 2009 15:42:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NFgZsC067777; Wed, 23 Sep 2009 15:42:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909231542.n8NFgZsC067777@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Sep 2009 15:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197439 - in head/sys: amd64/acpica amd64/include dev/acpica i386/acpica i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:42:36 -0000 Author: jhb Date: Wed Sep 23 15:42:35 2009 New Revision: 197439 URL: http://svn.freebsd.org/changeset/base/197439 Log: Extract the code to find and map the MADT ACPI table during early kernel startup and genericize it so it can be reused to map other tables as well: - Add a routine to walk a list of ACPI subtables such as those used in the APIC and SRAT tables in the MI acpi(4) driver. - Move the routines for mapping and unmapping an ACPI table as well as mapping the RSDT or XSDT and searching for a table with a given signature out into acpica_machdep.c for both amd64 and i386. Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/amd64/acpica/madt.c head/sys/amd64/include/acpica_machdep.h head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_machdep.c head/sys/i386/acpica/madt.c head/sys/i386/include/acpica_machdep.h Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/amd64/acpica/acpi_machdep.c Wed Sep 23 15:42:35 2009 (r197439) @@ -32,8 +32,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include +#include +#include #include @@ -100,6 +104,246 @@ acpi_cpu_c1() } /* + * Support for mapping ACPI tables during early boot. Currently this + * uses the crashdump map to map each table. However, the crashdump + * map is created in pmap_bootstrap() right after the direct map, so + * we should be able to just use pmap_mapbios() here instead. + * + * This makes the following assumptions about how we use this KVA: + * pages 0 and 1 are used to map in the header of each table found via + * the RSDT or XSDT and pages 2 to n are used to map in the RSDT or + * XSDT. This has to use 2 pages for the table headers in case a + * header spans a page boundary. + * + * XXX: We don't ensure the table fits in the available address space + * in the crashdump map. + */ + +/* + * Map some memory using the crashdump map. 'offset' is an offset in + * pages into the crashdump map to use for the start of the mapping. + */ +static void * +table_map(vm_paddr_t pa, int offset, vm_offset_t length) +{ + vm_offset_t va, off; + void *data; + + off = pa & PAGE_MASK; + length = roundup(length + off, PAGE_SIZE); + pa = pa & PG_FRAME; + va = (vm_offset_t)pmap_kenter_temporary(pa, offset) + + (offset * PAGE_SIZE); + data = (void *)(va + off); + length -= PAGE_SIZE; + while (length > 0) { + va += PAGE_SIZE; + pa += PAGE_SIZE; + length -= PAGE_SIZE; + pmap_kenter(va, pa); + invlpg(va); + } + return (data); +} + +/* Unmap memory previously mapped with table_map(). */ +static void +table_unmap(void *data, vm_offset_t length) +{ + vm_offset_t va, off; + + va = (vm_offset_t)data; + off = va & PAGE_MASK; + length = roundup(length + off, PAGE_SIZE); + va &= ~PAGE_MASK; + while (length > 0) { + pmap_kremove(va); + invlpg(va); + va += PAGE_SIZE; + length -= PAGE_SIZE; + } +} + +/* + * Map a table at a given offset into the crashdump map. It first + * maps the header to determine the table length and then maps the + * entire table. + */ +static void * +map_table(vm_paddr_t pa, int offset, const char *sig) +{ + ACPI_TABLE_HEADER *header; + vm_offset_t length; + void *table; + + header = table_map(pa, offset, sizeof(ACPI_TABLE_HEADER)); + if (strncmp(header->Signature, sig, ACPI_NAME_SIZE) != 0) { + table_unmap(header, sizeof(ACPI_TABLE_HEADER)); + return (NULL); + } + length = header->Length; + table_unmap(header, sizeof(ACPI_TABLE_HEADER)); + table = table_map(pa, offset, length); + if (ACPI_FAILURE(AcpiTbChecksum(table, length))) { + if (bootverbose) + printf("ACPI: Failed checksum for table %s\n", sig); + table_unmap(table, length); + return (NULL); + } + return (table); +} + +/* + * See if a given ACPI table is the requested table. Returns the + * length of the able if it matches or zero on failure. + */ +static int +probe_table(vm_paddr_t address, const char *sig) +{ + ACPI_TABLE_HEADER *table; + + table = table_map(address, 0, sizeof(ACPI_TABLE_HEADER)); + if (table == NULL) { + if (bootverbose) + printf("ACPI: Failed to map table at 0x%jx\n", + (uintmax_t)address); + return (0); + } + if (bootverbose) + printf("Table '%.4s' at 0x%jx\n", table->Signature, + (uintmax_t)address); + + if (strncmp(table->Signature, sig, ACPI_NAME_SIZE) != 0) { + table_unmap(table, sizeof(ACPI_TABLE_HEADER)); + return (0); + } + table_unmap(table, sizeof(ACPI_TABLE_HEADER)); + return (1); +} + +/* + * Try to map a table at a given physical address previously returned + * by acpi_find_table(). + */ +void * +acpi_map_table(vm_paddr_t pa, const char *sig) +{ + + return (map_table(pa, 0, sig)); +} + +/* Unmap a table previously mapped via acpi_map_table(). */ +void +acpi_unmap_table(void *table) +{ + ACPI_TABLE_HEADER *header; + + header = (ACPI_TABLE_HEADER *)table; + table_unmap(table, header->Length); +} + +/* + * Return the physical address of the requested table or zero if one + * is not found. + */ +vm_paddr_t +acpi_find_table(const char *sig) +{ + ACPI_PHYSICAL_ADDRESS rsdp_ptr; + ACPI_TABLE_RSDP *rsdp; + ACPI_TABLE_RSDT *rsdt; + ACPI_TABLE_XSDT *xsdt; + ACPI_TABLE_HEADER *table; + vm_paddr_t addr; + int i, count; + + if (resource_disabled("acpi", 0)) + return (0); + + /* + * Map in the RSDP. Since ACPI uses AcpiOsMapMemory() which in turn + * calls pmap_mapbios() to find the RSDP, we assume that we can use + * pmap_mapbios() to map the RSDP. + */ + if ((rsdp_ptr = AcpiOsGetRootPointer()) == 0) + return (0); + rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP)); + if (rsdp == NULL) { + if (bootverbose) + printf("ACPI: Failed to map RSDP\n"); + return (0); + } + + /* + * For ACPI >= 2.0, use the XSDT if it is available. + * Otherwise, use the RSDT. We map the XSDT or RSDT at page 2 + * in the crashdump area. Pages 0 and 1 are used to map in the + * headers of candidate ACPI tables. + */ + addr = 0; + if (rsdp->Revision >= 2 && rsdp->XsdtPhysicalAddress != 0) { + /* + * AcpiOsGetRootPointer only verifies the checksum for + * the version 1.0 portion of the RSDP. Version 2.0 has + * an additional checksum that we verify first. + */ + if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { + if (bootverbose) + printf("ACPI: RSDP failed extended checksum\n"); + return (0); + } + xsdt = map_table(rsdp->XsdtPhysicalAddress, 2, ACPI_SIG_XSDT); + if (xsdt == NULL) { + if (bootverbose) + printf("ACPI: Failed to map XSDT\n"); + return (0); + } + count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / + sizeof(UINT64); + for (i = 0; i < count; i++) + if (probe_table(xsdt->TableOffsetEntry[i], sig)) { + addr = xsdt->TableOffsetEntry[i]; + break; + } + acpi_unmap_table(xsdt); + } else { + rsdt = map_table(rsdp->RsdtPhysicalAddress, 2, ACPI_SIG_RSDT); + if (rsdt == NULL) { + if (bootverbose) + printf("ACPI: Failed to map RSDT\n"); + return (0); + } + count = (rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / + sizeof(UINT32); + for (i = 0; i < count; i++) + if (probe_table(rsdt->TableOffsetEntry[i], sig)) { + addr = rsdt->TableOffsetEntry[i]; + break; + } + acpi_unmap_table(rsdt); + } + pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP)); + if (addr == 0) { + if (bootverbose) + printf("ACPI: No %s table found\n", sig); + return (0); + } + if (bootverbose) + printf("%s: Found table at 0x%jx\n", sig, (uintmax_t)addr); + + /* + * Verify that we can map the full table and that its checksum is + * correct, etc. + */ + table = map_table(addr, 0, sig); + if (table == NULL) + return (0); + acpi_unmap_table(table); + + return (addr); +} + +/* * ACPI nexus(4) driver. */ static int Modified: head/sys/amd64/acpica/madt.c ============================================================================== --- head/sys/amd64/acpica/madt.c Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/amd64/acpica/madt.c Wed Sep 23 15:42:35 2009 (r197439) @@ -36,27 +36,19 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include -#include #include #include -#include #include #include -#include -#include #include -#include #include #include #include -typedef void madt_entry_handler(ACPI_SUBTABLE_HEADER *entry, void *arg); - /* These two arrays are indexed by APIC IDs. */ struct ioapic_info { void *io_apic; @@ -79,8 +71,6 @@ static enum intr_polarity interrupt_pola static enum intr_trigger interrupt_trigger(UINT16 IntiFlags, UINT8 Source); static int madt_find_cpu(u_int acpi_id, u_int *apic_id); static int madt_find_interrupt(int intr, void **apic, u_int *pin); -static void *madt_map(vm_paddr_t pa, int offset, vm_offset_t length); -static void *madt_map_table(vm_paddr_t pa, int offset, const char *sig); static void madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *arg); static void madt_parse_interrupt_override( ACPI_MADT_INTERRUPT_OVERRIDE *intr); @@ -92,13 +82,10 @@ static int madt_probe(void); static int madt_probe_cpus(void); static void madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg __unused); -static int madt_probe_table(vm_paddr_t address); static void madt_register(void *dummy); static int madt_setup_local(void); static int madt_setup_io(void); -static void madt_unmap(void *data, vm_offset_t length); -static void madt_unmap_table(void *table); -static void madt_walk_table(madt_entry_handler *handler, void *arg); +static void madt_walk_table(acpi_subtable_handler *handler, void *arg); static struct apic_enumerator madt_enumerator = { "MADT", @@ -109,224 +96,30 @@ static struct apic_enumerator madt_enume }; /* - * Code to abuse the crashdump map to map in the tables for the early - * probe. We cheat and make the following assumptions about how we - * use this KVA: pages 0 and 1 are used to map in the header of each - * table found via the RSDT or XSDT and pages 2 to n are used to map - * in the RSDT or XSDT. We have to use 2 pages for the table headers - * in case a header spans a page boundary. The offset is in pages; - * the length is in bytes. - */ -static void * -madt_map(vm_paddr_t pa, int offset, vm_offset_t length) -{ - vm_offset_t va, off; - void *data; - - off = pa & PAGE_MASK; - length = roundup(length + off, PAGE_SIZE); - pa = pa & PG_FRAME; - va = (vm_offset_t)pmap_kenter_temporary(pa, offset) + - (offset * PAGE_SIZE); - data = (void *)(va + off); - length -= PAGE_SIZE; - while (length > 0) { - va += PAGE_SIZE; - pa += PAGE_SIZE; - length -= PAGE_SIZE; - pmap_kenter(va, pa); - invlpg(va); - } - return (data); -} - -static void -madt_unmap(void *data, vm_offset_t length) -{ - vm_offset_t va, off; - - va = (vm_offset_t)data; - off = va & PAGE_MASK; - length = roundup(length + off, PAGE_SIZE); - va &= ~PAGE_MASK; - while (length > 0) { - pmap_kremove(va); - invlpg(va); - va += PAGE_SIZE; - length -= PAGE_SIZE; - } -} - -static void * -madt_map_table(vm_paddr_t pa, int offset, const char *sig) -{ - ACPI_TABLE_HEADER *header; - vm_offset_t length; - void *table; - - header = madt_map(pa, offset, sizeof(ACPI_TABLE_HEADER)); - if (strncmp(header->Signature, sig, ACPI_NAME_SIZE) != 0) { - madt_unmap(header, sizeof(ACPI_TABLE_HEADER)); - return (NULL); - } - length = header->Length; - madt_unmap(header, sizeof(ACPI_TABLE_HEADER)); - table = madt_map(pa, offset, length); - if (ACPI_FAILURE(AcpiTbChecksum(table, length))) { - if (bootverbose) - printf("MADT: Failed checksum for table %s\n", sig); - madt_unmap(table, length); - return (NULL); - } - return (table); -} - -static void -madt_unmap_table(void *table) -{ - ACPI_TABLE_HEADER *header; - - header = (ACPI_TABLE_HEADER *)table; - madt_unmap(table, header->Length); -} - -/* * Look for an ACPI Multiple APIC Description Table ("APIC") */ static int madt_probe(void) { - ACPI_PHYSICAL_ADDRESS rsdp_ptr; - ACPI_TABLE_RSDP *rsdp; - ACPI_TABLE_RSDT *rsdt; - ACPI_TABLE_XSDT *xsdt; - int i, count; - - if (resource_disabled("acpi", 0)) - return (ENXIO); - /* - * Map in the RSDP. Since ACPI uses AcpiOsMapMemory() which in turn - * calls pmap_mapbios() to find the RSDP, we assume that we can use - * pmap_mapbios() to map the RSDP. - */ - if ((rsdp_ptr = AcpiOsGetRootPointer()) == 0) - return (ENXIO); - rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP)); - if (rsdp == NULL) { - if (bootverbose) - printf("MADT: Failed to map RSDP\n"); + madt_physaddr = acpi_find_table(ACPI_SIG_MADT); + if (madt_physaddr == 0) return (ENXIO); - } - - /* - * For ACPI >= 2.0, use the XSDT if it is available. - * Otherwise, use the RSDT. We map the XSDT or RSDT at page 1 - * in the crashdump area. Page 0 is used to map in the - * headers of candidate ACPI tables. - */ - if (rsdp->Revision >= 2 && rsdp->XsdtPhysicalAddress != 0) { - /* - * AcpiOsGetRootPointer only verifies the checksum for - * the version 1.0 portion of the RSDP. Version 2.0 has - * an additional checksum that we verify first. - */ - if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { - if (bootverbose) - printf("MADT: RSDP failed extended checksum\n"); - return (ENXIO); - } - xsdt = madt_map_table(rsdp->XsdtPhysicalAddress, 2, - ACPI_SIG_XSDT); - if (xsdt == NULL) { - if (bootverbose) - printf("MADT: Failed to map XSDT\n"); - return (ENXIO); - } - count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / - sizeof(UINT64); - for (i = 0; i < count; i++) - if (madt_probe_table(xsdt->TableOffsetEntry[i])) - break; - madt_unmap_table(xsdt); - } else { - rsdt = madt_map_table(rsdp->RsdtPhysicalAddress, 2, - ACPI_SIG_RSDT); - if (rsdt == NULL) { - if (bootverbose) - printf("MADT: Failed to map RSDT\n"); - return (ENXIO); - } - count = (rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / - sizeof(UINT32); - for (i = 0; i < count; i++) - if (madt_probe_table(rsdt->TableOffsetEntry[i])) - break; - madt_unmap_table(rsdt); - } - pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP)); - if (madt_physaddr == 0) { - if (bootverbose) - printf("MADT: No MADT table found\n"); - return (ENXIO); - } - if (bootverbose) - printf("MADT: Found table at 0x%jx\n", - (uintmax_t)madt_physaddr); - - /* - * Verify that we can map the full table and that its checksum is - * correct, etc. - */ - madt = madt_map_table(madt_physaddr, 0, ACPI_SIG_MADT); - if (madt == NULL) - return (ENXIO); - madt_unmap_table(madt); - madt = NULL; - return (0); } /* - * See if a given ACPI table is the MADT. - */ -static int -madt_probe_table(vm_paddr_t address) -{ - ACPI_TABLE_HEADER *table; - - table = madt_map(address, 0, sizeof(ACPI_TABLE_HEADER)); - if (table == NULL) { - if (bootverbose) - printf("MADT: Failed to map table at 0x%jx\n", - (uintmax_t)address); - return (0); - } - if (bootverbose) - printf("Table '%.4s' at 0x%jx\n", table->Signature, - (uintmax_t)address); - - if (strncmp(table->Signature, ACPI_SIG_MADT, ACPI_NAME_SIZE) != 0) { - madt_unmap(table, sizeof(ACPI_TABLE_HEADER)); - return (0); - } - madt_physaddr = address; - madt_length = table->Length; - madt_unmap(table, sizeof(ACPI_TABLE_HEADER)); - return (1); -} - -/* * Run through the MP table enumerating CPUs. */ static int madt_probe_cpus(void) { - madt = madt_map_table(madt_physaddr, 0, ACPI_SIG_MADT); + madt = acpi_map_table(madt_physaddr, ACPI_SIG_MADT); + madt_length = madt->Header.Length; KASSERT(madt != NULL, ("Unable to re-map MADT")); madt_walk_table(madt_probe_cpus_handler, NULL); - madt_unmap_table(madt); + acpi_unmap_table(madt); madt = NULL; return (0); } @@ -417,17 +210,11 @@ SYSINIT(madt_register, SI_SUB_TUNABLES - * Call the handler routine for each entry in the MADT table. */ static void -madt_walk_table(madt_entry_handler *handler, void *arg) +madt_walk_table(acpi_subtable_handler *handler, void *arg) { - ACPI_SUBTABLE_HEADER *entry; - u_char *p, *end; - end = (u_char *)(madt) + madt->Header.Length; - for (p = (u_char *)(madt + 1); p < end; ) { - entry = (ACPI_SUBTABLE_HEADER *)p; - handler(entry, arg); - p += entry->Length; - } + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + handler, arg); } static void Modified: head/sys/amd64/include/acpica_machdep.h ============================================================================== --- head/sys/amd64/include/acpica_machdep.h Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/amd64/include/acpica_machdep.h Wed Sep 23 15:42:35 2009 (r197439) @@ -77,5 +77,8 @@ extern int acpi_release_global_lock(uint void acpi_SetDefaultIntrModel(int model); void acpi_cpu_c1(void); +void *acpi_map_table(vm_paddr_t pa, const char *sig); +void acpi_unmap_table(void *table); +vm_paddr_t acpi_find_table(const char *sig); #endif /* __ACPICA_MACHDEP_H__ */ Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/dev/acpica/acpi.c Wed Sep 23 15:42:35 2009 (r197439) @@ -2244,6 +2244,28 @@ acpi_SetIntrModel(int model) } /* + * Walk subtables of a table and call a callback routine for each + * subtable. The caller should provide the first subtable and a + * pointer to the end of the table. This can be used to walk tables + * such as MADT and SRAT that use subtable entries. + */ +void +acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, + void *arg) +{ + ACPI_SUBTABLE_HEADER *entry; + + for (entry = first; (void *)entry < end; ) { + /* Avoid an infinite loop if we hit a bogus entry. */ + if (entry->Length < sizeof(ACPI_SUBTABLE_HEADER)) + return; + + handler(entry, arg); + entry = ACPI_ADD_PTR(ACPI_SUBTABLE_HEADER, entry, entry->Length); + } +} + +/* * DEPRECATED. This interface has serious deficiencies and will be * removed. * Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/dev/acpica/acpivar.h Wed Sep 23 15:42:35 2009 (r197439) @@ -307,6 +307,9 @@ void acpi_EnterDebugger(void); ACPI_DEVINFO_PRESENT(x, ACPI_STA_PRESENT | ACPI_STA_FUNCTIONAL | \ ACPI_STA_BATT_PRESENT) +/* Callback function type for walking subtables within a table. */ +typedef void acpi_subtable_handler(ACPI_SUBTABLE_HEADER *, void *); + BOOLEAN acpi_DeviceIsPresent(device_t dev); BOOLEAN acpi_BatteryIsPresent(device_t dev); ACPI_STATUS acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, @@ -340,6 +343,8 @@ void acpi_UserNotify(const char *subsys int acpi_bus_alloc_gas(device_t dev, int *type, int *rid, ACPI_GENERIC_ADDRESS *gas, struct resource **res, u_int flags); +void acpi_walk_subtables(void *first, void *end, + acpi_subtable_handler *handler, void *arg); struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); Modified: head/sys/i386/acpica/acpi_machdep.c ============================================================================== --- head/sys/i386/acpica/acpi_machdep.c Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/i386/acpica/acpi_machdep.c Wed Sep 23 15:42:35 2009 (r197439) @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -558,6 +560,244 @@ acpi_cpu_c1() } /* + * Support for mapping ACPI tables during early boot. This abuses the + * crashdump map because the kernel cannot allocate KVA in + * pmap_mapbios() when this is used. This makes the following + * assumptions about how we use this KVA: pages 0 and 1 are used to + * map in the header of each table found via the RSDT or XSDT and + * pages 2 to n are used to map in the RSDT or XSDT. This has to use + * 2 pages for the table headers in case a header spans a page + * boundary. + * + * XXX: We don't ensure the table fits in the available address space + * in the crashdump map. + */ + +/* + * Map some memory using the crashdump map. 'offset' is an offset in + * pages into the crashdump map to use for the start of the mapping. + */ +static void * +table_map(vm_paddr_t pa, int offset, vm_offset_t length) +{ + vm_offset_t va, off; + void *data; + + off = pa & PAGE_MASK; + length = roundup(length + off, PAGE_SIZE); + pa = pa & PG_FRAME; + va = (vm_offset_t)pmap_kenter_temporary(pa, offset) + + (offset * PAGE_SIZE); + data = (void *)(va + off); + length -= PAGE_SIZE; + while (length > 0) { + va += PAGE_SIZE; + pa += PAGE_SIZE; + length -= PAGE_SIZE; + pmap_kenter(va, pa); + invlpg(va); + } + return (data); +} + +/* Unmap memory previously mapped with table_map(). */ +static void +table_unmap(void *data, vm_offset_t length) +{ + vm_offset_t va, off; + + va = (vm_offset_t)data; + off = va & PAGE_MASK; + length = roundup(length + off, PAGE_SIZE); + va &= ~PAGE_MASK; + while (length > 0) { + pmap_kremove(va); + invlpg(va); + va += PAGE_SIZE; + length -= PAGE_SIZE; + } +} + +/* + * Map a table at a given offset into the crashdump map. It first + * maps the header to determine the table length and then maps the + * entire table. + */ +static void * +map_table(vm_paddr_t pa, int offset, const char *sig) +{ + ACPI_TABLE_HEADER *header; + vm_offset_t length; + void *table; + + header = table_map(pa, offset, sizeof(ACPI_TABLE_HEADER)); + if (strncmp(header->Signature, sig, ACPI_NAME_SIZE) != 0) { + table_unmap(header, sizeof(ACPI_TABLE_HEADER)); + return (NULL); + } + length = header->Length; + table_unmap(header, sizeof(ACPI_TABLE_HEADER)); + table = table_map(pa, offset, length); + if (ACPI_FAILURE(AcpiTbChecksum(table, length))) { + if (bootverbose) + printf("ACPI: Failed checksum for table %s\n", sig); + table_unmap(table, length); + return (NULL); + } + return (table); +} + +/* + * See if a given ACPI table is the requested table. Returns the + * length of the able if it matches or zero on failure. + */ +static int +probe_table(vm_paddr_t address, const char *sig) +{ + ACPI_TABLE_HEADER *table; + + table = table_map(address, 0, sizeof(ACPI_TABLE_HEADER)); + if (table == NULL) { + if (bootverbose) + printf("ACPI: Failed to map table at 0x%jx\n", + (uintmax_t)address); + return (0); + } + if (bootverbose) + printf("Table '%.4s' at 0x%jx\n", table->Signature, + (uintmax_t)address); + + if (strncmp(table->Signature, sig, ACPI_NAME_SIZE) != 0) { + table_unmap(table, sizeof(ACPI_TABLE_HEADER)); + return (0); + } + table_unmap(table, sizeof(ACPI_TABLE_HEADER)); + return (1); +} + +/* + * Try to map a table at a given physical address previously returned + * by acpi_find_table(). + */ +void * +acpi_map_table(vm_paddr_t pa, const char *sig) +{ + + return (map_table(pa, 0, sig)); +} + +/* Unmap a table previously mapped via acpi_map_table(). */ +void +acpi_unmap_table(void *table) +{ + ACPI_TABLE_HEADER *header; + + header = (ACPI_TABLE_HEADER *)table; + table_unmap(table, header->Length); +} + +/* + * Return the physical address of the requested table or zero if one + * is not found. + */ +vm_paddr_t +acpi_find_table(const char *sig) +{ + ACPI_PHYSICAL_ADDRESS rsdp_ptr; + ACPI_TABLE_RSDP *rsdp; + ACPI_TABLE_RSDT *rsdt; + ACPI_TABLE_XSDT *xsdt; + ACPI_TABLE_HEADER *table; + vm_paddr_t addr; + int i, count; + + if (resource_disabled("acpi", 0)) + return (0); + + /* + * Map in the RSDP. Since ACPI uses AcpiOsMapMemory() which in turn + * calls pmap_mapbios() to find the RSDP, we assume that we can use + * pmap_mapbios() to map the RSDP. + */ + if ((rsdp_ptr = AcpiOsGetRootPointer()) == 0) + return (0); + rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP)); + if (rsdp == NULL) { + if (bootverbose) + printf("ACPI: Failed to map RSDP\n"); + return (0); + } + + /* + * For ACPI >= 2.0, use the XSDT if it is available. + * Otherwise, use the RSDT. We map the XSDT or RSDT at page 2 + * in the crashdump area. Pages 0 and 1 are used to map in the + * headers of candidate ACPI tables. + */ + addr = 0; + if (rsdp->Revision >= 2 && rsdp->XsdtPhysicalAddress != 0) { + /* + * AcpiOsGetRootPointer only verifies the checksum for + * the version 1.0 portion of the RSDP. Version 2.0 has + * an additional checksum that we verify first. + */ + if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { + if (bootverbose) + printf("ACPI: RSDP failed extended checksum\n"); + return (0); + } + xsdt = map_table(rsdp->XsdtPhysicalAddress, 2, ACPI_SIG_XSDT); + if (xsdt == NULL) { + if (bootverbose) + printf("ACPI: Failed to map XSDT\n"); + return (0); + } + count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / + sizeof(UINT64); + for (i = 0; i < count; i++) + if (probe_table(xsdt->TableOffsetEntry[i], sig)) { + addr = xsdt->TableOffsetEntry[i]; + break; + } + acpi_unmap_table(xsdt); + } else { + rsdt = map_table(rsdp->RsdtPhysicalAddress, 2, ACPI_SIG_RSDT); + if (rsdt == NULL) { + if (bootverbose) + printf("ACPI: Failed to map RSDT\n"); + return (0); + } + count = (rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / + sizeof(UINT32); + for (i = 0; i < count; i++) + if (probe_table(rsdt->TableOffsetEntry[i], sig)) { + addr = rsdt->TableOffsetEntry[i]; + break; + } + acpi_unmap_table(rsdt); + } + pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP)); + if (addr == 0) { + if (bootverbose) + printf("ACPI: No %s table found\n", sig); + return (0); + } + if (bootverbose) + printf("%s: Found table at 0x%jx\n", sig, (uintmax_t)addr); + + /* + * Verify that we can map the full table and that its checksum is + * correct, etc. + */ + table = map_table(addr, 0, sig); + if (table == NULL) + return (0); + acpi_unmap_table(table); + + return (addr); +} + +/* * ACPI nexus(4) driver. */ static int Modified: head/sys/i386/acpica/madt.c ============================================================================== --- head/sys/i386/acpica/madt.c Wed Sep 23 15:39:54 2009 (r197438) +++ head/sys/i386/acpica/madt.c Wed Sep 23 15:42:35 2009 (r197439) @@ -36,27 +36,19 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include -#include #include #include -#include #include #include -#include -#include #include -#include #include #include #include -typedef void madt_entry_handler(ACPI_SUBTABLE_HEADER *entry, void *arg); - /* These two arrays are indexed by APIC IDs. */ struct ioapic_info { void *io_apic; @@ -79,8 +71,6 @@ static enum intr_polarity interrupt_pola static enum intr_trigger interrupt_trigger(UINT16 IntiFlags, UINT8 Source); static int madt_find_cpu(u_int acpi_id, u_int *apic_id); static int madt_find_interrupt(int intr, void **apic, u_int *pin); -static void *madt_map(vm_paddr_t pa, int offset, vm_offset_t length); -static void *madt_map_table(vm_paddr_t pa, int offset, const char *sig); static void madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *arg); static void madt_parse_interrupt_override( ACPI_MADT_INTERRUPT_OVERRIDE *intr); @@ -92,13 +82,10 @@ static int madt_probe(void); static int madt_probe_cpus(void); static void madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg __unused); -static int madt_probe_table(vm_paddr_t address); static void madt_register(void *dummy); static int madt_setup_local(void); static int madt_setup_io(void); -static void madt_unmap(void *data, vm_offset_t length); -static void madt_unmap_table(void *table); -static void madt_walk_table(madt_entry_handler *handler, void *arg); +static void madt_walk_table(acpi_subtable_handler *handler, void *arg); static struct apic_enumerator madt_enumerator = { "MADT", @@ -108,87 +95,6 @@ static struct apic_enumerator madt_enume madt_setup_io }; -/* - * Code to abuse the crashdump map to map in the tables for the early - * probe. We cheat and make the following assumptions about how we - * use this KVA: pages 0 and 1 are used to map in the header of each - * table found via the RSDT or XSDT and pages 2 to n are used to map - * in the RSDT or XSDT. We have to use 2 pages for the table headers - * in case a header spans a page boundary. The offset is in pages; - * the length is in bytes. - */ -static void * -madt_map(vm_paddr_t pa, int offset, vm_offset_t length) -{ - vm_offset_t va, off; - void *data; - - off = pa & PAGE_MASK; - length = roundup(length + off, PAGE_SIZE); - pa = pa & PG_FRAME; - va = (vm_offset_t)pmap_kenter_temporary(pa, offset) + - (offset * PAGE_SIZE); - data = (void *)(va + off); - length -= PAGE_SIZE; - while (length > 0) { - va += PAGE_SIZE; - pa += PAGE_SIZE; - length -= PAGE_SIZE; - pmap_kenter(va, pa); - invlpg(va); - } - return (data); -} - -static void -madt_unmap(void *data, vm_offset_t length) -{ - vm_offset_t va, off; - - va = (vm_offset_t)data; - off = va & PAGE_MASK; - length = roundup(length + off, PAGE_SIZE); - va &= ~PAGE_MASK; - while (length > 0) { - pmap_kremove(va); - invlpg(va); - va += PAGE_SIZE; - length -= PAGE_SIZE; - } -} - -static void * -madt_map_table(vm_paddr_t pa, int offset, const char *sig) -{ - ACPI_TABLE_HEADER *header; - vm_offset_t length; - void *table; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 15:56:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 770AE1065672; Wed, 23 Sep 2009 15:56:10 +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 649AC8FC0A; Wed, 23 Sep 2009 15:56:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NFuAbV068123; Wed, 23 Sep 2009 15:56:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NFuATY068121; Wed, 23 Sep 2009 15:56:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909231556.n8NFuATY068121@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Sep 2009 15:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197440 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/acpi_support dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 15:56:10 -0000 Author: jhb Date: Wed Sep 23 15:56:09 2009 New Revision: 197440 URL: http://svn.freebsd.org/changeset/base/197440 Log: MFC 197350: Re-remove the IBM0057 ID used for PS/2 mouse controllers. The asl for the 61p includes the hotkey device as IBM0068 and the mouse as IBM0057 similar to other systems. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/acpi_support/acpi_ibm.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/8/sys/dev/acpi_support/acpi_ibm.c Wed Sep 23 15:42:35 2009 (r197439) +++ stable/8/sys/dev/acpi_support/acpi_ibm.c Wed Sep 23 15:56:09 2009 (r197440) @@ -288,7 +288,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0057", "IBM0068", NULL}; +static char *ibm_ids[] = {"IBM0068", NULL}; static void ibm_led(void *softc, int onoff) From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 17:48:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39EC11065679; Wed, 23 Sep 2009 17:48:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4BE8FC23; Wed, 23 Sep 2009 17:48:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NHmHw1070321; Wed, 23 Sep 2009 17:48:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NHmHRj070319; Wed, 23 Sep 2009 17:48:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909231748.n8NHmHRj070319@svn.freebsd.org> From: Rui Paulo Date: Wed, 23 Sep 2009 17:48: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: r197441 - head/sys/dev/mwl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 17:48:17 -0000 Author: rpaulo Date: Wed Sep 23 17:48:16 2009 New Revision: 197441 URL: http://svn.freebsd.org/changeset/base/197441 Log: Replace 'can not' with 'cannot' so that we use 'cannot' everywhere. Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Wed Sep 23 15:56:09 2009 (r197440) +++ head/sys/dev/mwl/if_mwl.c Wed Sep 23 17:48:16 2009 (r197441) @@ -304,7 +304,7 @@ mwl_attach(uint16_t devid, struct mwl_so ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); + device_printf(sc->sc_dev, "cannot if_alloc()\n"); return ENOSPC; } ic = ifp->if_l2com; From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 20:13:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 096F7106566C; Wed, 23 Sep 2009 20:13:37 +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 EBCDE8FC1E; Wed, 23 Sep 2009 20:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NKDain073118; Wed, 23 Sep 2009 20:13:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NKDa7c073117; Wed, 23 Sep 2009 20:13:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909232013.n8NKDa7c073117@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 Sep 2009 20:13: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: r197442 - head/sys/dev/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 20:13:37 -0000 Author: jkim Date: Wed Sep 23 20:13:36 2009 New Revision: 197442 URL: http://svn.freebsd.org/changeset/base/197442 Log: - Use spin lock instead of default mutex for safety. INT/IRET instructions save/clear/restore flags but emulated flags have no effect on the host. I believe BIOS writers never meant to run their code in emulated environment with interrupt enabled. :-) - Use memcpy(3) instead of copying individual members. I believe struct x86regs was intentionally copied from the first half of struct x86emu_regs for this very purpose. - Fix some style nits and consistencies. Reviewed by: delphij, paradox (ddkprog yahoo com) Modified: head/sys/dev/x86bios/x86bios.c Modified: head/sys/dev/x86bios/x86bios.c ============================================================================== --- head/sys/dev/x86bios/x86bios.c Wed Sep 23 17:48:16 2009 (r197441) +++ head/sys/dev/x86bios/x86bios.c Wed Sep 23 20:13:36 2009 (r197442) @@ -9,16 +9,12 @@ __FBSDID("$FreeBSD$"); #include "opt_x86bios.h" #include -#include #include -#include #include +#include #include #include -#include -#include -#include #include #include @@ -32,39 +28,43 @@ static u_char *pbiosStack = NULL; int busySegMap[5]; -static struct x86emu xbios86emu; +static struct x86emu x86bios_emu; static struct mtx x86bios_lock; static uint8_t -vm86_emu_inb(struct x86emu *emu, uint16_t port) +x86bios_emu_inb(struct x86emu *emu, uint16_t port) { + if (port == 0xb2) /* APM scratch register */ - return 0; + return (0); if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inb(port); + return (0); + return (inb(port)); } static uint16_t -vm86_emu_inw(struct x86emu *emu, uint16_t port) +x86bios_emu_inw(struct x86emu *emu, uint16_t port) { + if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inw(port); + return (0); + return (inw(port)); } static uint32_t -vm86_emu_inl(struct x86emu *emu, uint16_t port) +x86bios_emu_inl(struct x86emu *emu, uint16_t port) { + if (port >= 0x80 && port < 0x88) /* POST status register */ - return 0; - return inl(port); + return (0); + return (inl(port)); } static void -vm86_emu_outb(struct x86emu *emu, uint16_t port, uint8_t val) +x86bios_emu_outb(struct x86emu *emu, uint16_t port, uint8_t val) { + if (port == 0xb2) /* APM scratch register */ return; if (port >= 0x80 && port < 0x88) /* POST status register */ @@ -73,16 +73,18 @@ vm86_emu_outb(struct x86emu *emu, uint16 } static void -vm86_emu_outw(struct x86emu *emu, uint16_t port, uint16_t val) +x86bios_emu_outw(struct x86emu *emu, uint16_t port, uint16_t val) { + if (port >= 0x80 && port < 0x88) /* POST status register */ return; outw(port, val); } static void -vm86_emu_outl(struct x86emu *emu, uint16_t port, uint32_t val) +x86bios_emu_outl(struct x86emu *emu, uint16_t port, uint32_t val) { + if (port >= 0x80 && port < 0x88) /* POST status register */ return; outl(port, val); @@ -91,59 +93,23 @@ vm86_emu_outl(struct x86emu *emu, uint16 void x86biosCall(struct x86regs *regs, int intno) { + if (intno < 0 || intno > 255) return; - mtx_lock(&x86bios_lock); - critical_enter(); + mtx_lock_spin(&x86bios_lock); - xbios86emu.x86.R_EAX = regs->R_EAX; - xbios86emu.x86.R_EBX = regs->R_EBX; - xbios86emu.x86.R_ECX = regs->R_ECX; - xbios86emu.x86.R_EDX = regs->R_EDX; - - xbios86emu.x86.R_ESP = regs->R_ESP; - xbios86emu.x86.R_EBP = regs->R_EBP; - xbios86emu.x86.R_ESI = regs->R_ESI; - xbios86emu.x86.R_EDI = regs->R_EDI; - xbios86emu.x86.R_EIP = regs->R_EIP; - xbios86emu.x86.R_EFLG = regs->R_EFLG; - - xbios86emu.x86.R_CS = regs->R_CS; - xbios86emu.x86.R_DS = regs->R_DS; - xbios86emu.x86.R_SS = regs->R_SS; - xbios86emu.x86.R_ES = regs->R_ES; - xbios86emu.x86.R_FS = regs->R_FS; - xbios86emu.x86.R_GS = regs->R_GS; - - x86emu_exec_intr(&xbios86emu, intno); - - regs->R_EAX = xbios86emu.x86.R_EAX; - regs->R_EBX = xbios86emu.x86.R_EBX; - regs->R_ECX = xbios86emu.x86.R_ECX; - regs->R_EDX = xbios86emu.x86.R_EDX; - - regs->R_ESP = xbios86emu.x86.R_ESP; - regs->R_EBP = xbios86emu.x86.R_EBP; - regs->R_ESI = xbios86emu.x86.R_ESI; - regs->R_EDI = xbios86emu.x86.R_EDI; - regs->R_EIP = xbios86emu.x86.R_EIP; - regs->R_EFLG = xbios86emu.x86.R_EFLG; - - regs->R_CS = xbios86emu.x86.R_CS; - regs->R_DS = xbios86emu.x86.R_DS; - regs->R_SS = xbios86emu.x86.R_SS; - regs->R_ES = xbios86emu.x86.R_ES; - regs->R_FS = xbios86emu.x86.R_FS; - regs->R_GS = xbios86emu.x86.R_GS; + memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + x86emu_exec_intr(&x86bios_emu, intno); + memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); - critical_exit(); - mtx_unlock(&x86bios_lock); + mtx_unlock_spin(&x86bios_lock); } void * x86biosOffs(uint32_t offs) { + return (pbiosMem + offs); } @@ -152,23 +118,23 @@ x86bios_init(void *arg __unused) { int offs; - mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_DEF); + mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_SPIN); /* Can pbiosMem be NULL here? */ pbiosMem = pmap_mapbios(0x0, MAPPED_MEMORY_SIZE); - memset(&xbios86emu, 0, sizeof(xbios86emu)); - x86emu_init_default(&xbios86emu); + memset(&x86bios_emu, 0, sizeof(x86bios_emu)); + x86emu_init_default(&x86bios_emu); - xbios86emu.emu_inb = vm86_emu_inb; - xbios86emu.emu_inw = vm86_emu_inw; - xbios86emu.emu_inl = vm86_emu_inl; - xbios86emu.emu_outb = vm86_emu_outb; - xbios86emu.emu_outw = vm86_emu_outw; - xbios86emu.emu_outl = vm86_emu_outl; + x86bios_emu.emu_inb = x86bios_emu_inb; + x86bios_emu.emu_inw = x86bios_emu_inw; + x86bios_emu.emu_inl = x86bios_emu_inl; + x86bios_emu.emu_outb = x86bios_emu_outb; + x86bios_emu.emu_outw = x86bios_emu_outw; + x86bios_emu.emu_outl = x86bios_emu_outl; - xbios86emu.mem_base = (char *)pbiosMem; - xbios86emu.mem_size = 1024 * 1024; + x86bios_emu.mem_base = (char *)pbiosMem; + x86bios_emu.mem_size = 1024 * 1024; memset(busySegMap, 0, sizeof(busySegMap)); @@ -178,6 +144,7 @@ x86bios_init(void *arg __unused) static void x86bios_uninit(void *arg __unused) { + x86biosFree(pbiosStack, 1); if (pbiosMem) @@ -215,4 +182,3 @@ static moduledata_t x86bios_mod = { DECLARE_MODULE(x86bios, x86bios_mod, SI_SUB_CPU, SI_ORDER_ANY); MODULE_VERSION(x86bios, 1); - From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 20:49:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFF56106566B; Wed, 23 Sep 2009 20:49:15 +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 AD6128FC1E; Wed, 23 Sep 2009 20:49:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NKnFxl074334; Wed, 23 Sep 2009 20:49:15 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NKnF7l074325; Wed, 23 Sep 2009 20:49:15 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909232049.n8NKnF7l074325@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 Sep 2009 20:49: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: r197444 - in head/sys: compat/x86bios conf dev/atkbdc dev/dpms dev/fb dev/x86bios modules/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 20:49:15 -0000 Author: jkim Date: Wed Sep 23 20:49:14 2009 New Revision: 197444 URL: http://svn.freebsd.org/changeset/base/197444 Log: Move sys/dev/x86bios to sys/compat/x86bios. It may not be optimal but it is clearly better than the old place. OK'ed by: delphij, paradox (ddkprog yahoo com) Added: head/sys/compat/x86bios/ - copied from r197442, head/sys/dev/x86bios/ Deleted: head/sys/dev/x86bios/ Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios_alloc.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/atkbdc/atkbd.c head/sys/dev/dpms/dpms.c head/sys/dev/fb/vesa.c head/sys/modules/x86bios/Makefile Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/dev/x86bios/x86bios.c Wed Sep 23 20:13:36 2009 (r197442) +++ head/sys/compat/x86bios/x86bios.c Wed Sep 23 20:49:14 2009 (r197444) @@ -21,7 +21,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include u_char *pbiosMem = NULL; static u_char *pbiosStack = NULL; Modified: head/sys/compat/x86bios/x86bios_alloc.c ============================================================================== --- head/sys/dev/x86bios/x86bios_alloc.c Wed Sep 23 20:13:36 2009 (r197442) +++ head/sys/compat/x86bios/x86bios_alloc.c Wed Sep 23 20:49:14 2009 (r197444) @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include extern u_char *pbiosMem; extern int busySegMap[5]; Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Sep 23 20:37:00 2009 (r197443) +++ head/sys/conf/files.amd64 Wed Sep 23 20:49:14 2009 (r197444) @@ -297,8 +297,7 @@ libkern/memset.c standard # # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa # -dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa - +compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Sep 23 20:37:00 2009 (r197443) +++ head/sys/conf/files.i386 Wed Sep 23 20:49:14 2009 (r197444) @@ -381,7 +381,7 @@ i386/xbox/pic16l.s optional xbox # # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa # -dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Wed Sep 23 20:37:00 2009 (r197443) +++ head/sys/dev/atkbdc/atkbd.c Wed Sep 23 20:49:14 2009 (r197444) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #if 0 #include #include -#include +#include #include #include Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Wed Sep 23 20:37:00 2009 (r197443) +++ head/sys/dev/dpms/dpms.c Wed Sep 23 20:49:14 2009 (r197444) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* * VESA DPMS States Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Sep 23 20:37:00 2009 (r197443) +++ head/sys/dev/fb/vesa.c Wed Sep 23 20:49:14 2009 (r197444) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #define VESA_VIA_CLE266 "VIA CLE266\r\n" Modified: head/sys/modules/x86bios/Makefile ============================================================================== --- head/sys/modules/x86bios/Makefile Wed Sep 23 20:37:00 2009 (r197443) +++ head/sys/modules/x86bios/Makefile Wed Sep 23 20:49:14 2009 (r197444) @@ -4,7 +4,7 @@ KMOD= x86bios SRCS= opt_x86bios.h .PATH: ${.CURDIR}/../../contrib/x86emu -.PATH: ${.CURDIR}/../../dev/x86bios +.PATH: ${.CURDIR}/../../compat/x86bios SRCS+= x86bios.c x86bios_alloc.c x86emu.c x86emu_util.c .include From owner-svn-src-all@FreeBSD.ORG Wed Sep 23 21:38:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FFE8106566C; Wed, 23 Sep 2009 21:38:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED608FC14; Wed, 23 Sep 2009 21:38:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NLcv4w075434; Wed, 23 Sep 2009 21:38:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8NLcvvS075433; Wed, 23 Sep 2009 21:38:57 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909232138.n8NLcvvS075433@svn.freebsd.org> From: Attilio Rao Date: Wed, 23 Sep 2009 21:38: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: r197445 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 21:38:58 -0000 Author: attilio Date: Wed Sep 23 21:38:57 2009 New Revision: 197445 URL: http://svn.freebsd.org/changeset/base/197445 Log: rwlock implemented from libthr need to fall through the 'hard path' and query umtx also if the shared waiters bit is set on a shared lock. The writer starvation avoidance technique, infact, can lead to shared waiters on a shared lock which can bring to a missed wakeup and thus to a deadlock if the right bit is not checked (a notable case is the writers counterpart to be handled through expired timeouts). Fix that by checking for the shared waiters bit also when unlocking the shared locks. That bug was causing a reported MySQL deadlock. Many thanks go to Nick Esborn and his employer DesertNet which provided time and machines to identify and fix this issue. PR: thread/135673 Reported by: Nick Esborn Tested by: Nick Esborn Reviewed by: jeff Modified: head/lib/libthr/thread/thr_umtx.h Modified: head/lib/libthr/thread/thr_umtx.h ============================================================================== --- head/lib/libthr/thread/thr_umtx.h Wed Sep 23 20:49:14 2009 (r197444) +++ head/lib/libthr/thread/thr_umtx.h Wed Sep 23 21:38:57 2009 (r197445) @@ -171,8 +171,11 @@ _thr_rwlock_unlock(struct urwlock *rwloc for (;;) { if (__predict_false(URWLOCK_READER_COUNT(state) == 0)) return (EPERM); - if (!((state & URWLOCK_WRITE_WAITERS) && URWLOCK_READER_COUNT(state) == 1)) { - if (atomic_cmpset_rel_32(&rwlock->rw_state, state, state-1)) + if (!((state & (URWLOCK_WRITE_WAITERS | + URWLOCK_READ_WAITERS)) && + URWLOCK_READER_COUNT(state) == 1)) { + if (atomic_cmpset_rel_32(&rwlock->rw_state, + state, state-1)) return (0); state = rwlock->rw_state; } else { From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 06:00:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 361FF106566B; Thu, 24 Sep 2009 06:00:52 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 255C48FC1F; Thu, 24 Sep 2009 06:00:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8O60pnc086367; Thu, 24 Sep 2009 06:00:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8O60o4A086366; Thu, 24 Sep 2009 06:00:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200909240600.n8O60o4A086366@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 Sep 2009 06:00: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: r197449 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 06:00:52 -0000 Author: marcel Date: Thu Sep 24 06:00:49 2009 New Revision: 197449 URL: http://svn.freebsd.org/changeset/base/197449 Log: Don't create more partitions than can fit in the table by checking that the index is within bounds. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Sep 24 02:15:05 2009 (r197448) +++ head/sys/geom/part/g_part.c Thu Sep 24 06:00:49 2009 (r197449) @@ -480,6 +480,10 @@ g_part_ctl_add(struct gctl_req *req, str gctl_error(req, "%d index '%d'", EEXIST, gpp->gpp_index); return (EEXIST); } + if (index > table->gpt_entries) { + gctl_error(req, "%d index '%d'", ENOSPC, index); + return (ENOSPC); + } entry = (delent == NULL) ? g_malloc(table->gpt_scheme->gps_entrysz, M_WAITOK | M_ZERO) : delent; From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 07:11:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77410106568F; Thu, 24 Sep 2009 07:11:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65F138FC19; Thu, 24 Sep 2009 07:11:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8O7BNE1087743; Thu, 24 Sep 2009 07:11:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8O7BNNM087741; Thu, 24 Sep 2009 07:11:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909240711.n8O7BNNM087741@svn.freebsd.org> From: Andriy Gapon Date: Thu, 24 Sep 2009 07:11: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: r197450 - in head/sys: amd64/pci dev/pci i386/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 07:11:24 -0000 Author: avg Date: Thu Sep 24 07:11:23 2009 New Revision: 197450 URL: http://svn.freebsd.org/changeset/base/197450 Log: number of cleanups in i386 and amd64 pci md code o introduce PCIE_REGMAX and use it instead of ad-hoc constant o where 'reg' parameter/variable is not already unsigned, cast it to unsigned before comparison with maximum value to cut off negative values o use PCI_SLOTMAX in several places where 31 or 32 were explicitly used o drop redundant check of 'bytes' in i386 pciereg_cfgread() - valid values are already checked in the subsequent switch Reviewed by: jhb MFC after: 1 week Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/dev/pci/pcireg.h head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- head/sys/amd64/pci/pci_cfgreg.c Thu Sep 24 06:00:49 2009 (r197449) +++ head/sys/amd64/pci/pci_cfgreg.c Thu Sep 24 07:11:23 2009 (r197450) @@ -181,9 +181,9 @@ pci_cfgenable(unsigned bus, unsigned slo { int dataport = 0; - if (bus <= PCI_BUSMAX && slot < 32 && func <= PCI_FUNCMAX && - reg <= PCI_REGMAX && bytes != 3 && (unsigned) bytes <= 4 && - (reg & (bytes - 1)) == 0) { + if (bus <= PCI_BUSMAX && slot <= PCI_SLOTMAX && func <= PCI_FUNCMAX && + (unsigned)reg <= PCI_REGMAX && bytes != 3 && + (unsigned)bytes <= 4 && (reg & (bytes - 1)) == 0) { outl(CONF1_ADDR_PORT, (1 << 31) | (bus << 16) | (slot << 11) | (func << 8) | (reg & ~0x03)); dataport = CONF1_DATA_PORT + (reg & 0x03); @@ -281,7 +281,7 @@ pcie_cfgregopen(uint64_t base, uint8_t m * fall back to using type 1 config access instead. */ if (pci_cfgregopen() != 0) { - for (slot = 0; slot < 32; slot++) { + for (slot = 0; slot <= PCI_SLOTMAX; slot++) { val1 = pcireg_cfgread(0, slot, 0, 0, 4); if (val1 == 0xffffffff) continue; @@ -309,8 +309,8 @@ pciereg_cfgread(int bus, unsigned slot, volatile vm_offset_t va; int data = -1; - if (bus < pcie_minbus || bus > pcie_maxbus || slot >= 32 || - func > PCI_FUNCMAX || reg >= 0x1000) + if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || + func > PCI_FUNCMAX || reg > PCIE_REGMAX) return (-1); va = PCIE_VADDR(pcie_base, reg, bus, slot, func); @@ -336,8 +336,8 @@ pciereg_cfgwrite(int bus, unsigned slot, { volatile vm_offset_t va; - if (bus < pcie_minbus || bus > pcie_maxbus || slot >= 32 || - func > PCI_FUNCMAX || reg >= 0x1000) + if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || + func > PCI_FUNCMAX || reg > PCIE_REGMAX) return; va = PCIE_VADDR(pcie_base, reg, bus, slot, func); Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Thu Sep 24 06:00:49 2009 (r197449) +++ head/sys/dev/pci/pcireg.h Thu Sep 24 07:11:23 2009 (r197450) @@ -44,6 +44,7 @@ #define PCI_SLOTMAX 31 /* highest supported slot number */ #define PCI_FUNCMAX 7 /* highest supported function number */ #define PCI_REGMAX 255 /* highest supported config register addr. */ +#define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 /* PCI config header registers for all devices */ Modified: head/sys/i386/pci/pci_cfgreg.c ============================================================================== --- head/sys/i386/pci/pci_cfgreg.c Thu Sep 24 06:00:49 2009 (r197449) +++ head/sys/i386/pci/pci_cfgreg.c Thu Sep 24 07:11:23 2009 (r197450) @@ -299,9 +299,9 @@ pci_cfgenable(unsigned bus, unsigned slo if (bus <= PCI_BUSMAX && slot < devmax && func <= PCI_FUNCMAX - && reg <= PCI_REGMAX + && (unsigned)reg <= PCI_REGMAX && bytes != 3 - && (unsigned) bytes <= 4 + && (unsigned)bytes <= 4 && (reg & (bytes - 1)) == 0) { switch (cfgmech) { case CFGMECH_PCIE: @@ -595,7 +595,7 @@ pcie_cfgregopen(uint64_t base, uint8_t m * fall back to using type 1 config access instead. */ if (pci_cfgregopen() != 0) { - for (slot = 0; slot < 32; slot++) { + for (slot = 0; slot <= PCI_SLOTMAX; slot++) { val1 = pcireg_cfgread(0, slot, 0, 0, 4); if (val1 == 0xffffffff) continue; @@ -661,8 +661,8 @@ pciereg_cfgread(int bus, unsigned slot, vm_paddr_t pa, papage; int data = -1; - if (bus < pcie_minbus || bus > pcie_maxbus || slot >= 32 || - func > PCI_FUNCMAX || reg >= 0x1000 || bytes > 4 || bytes == 3) + if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || + func > PCI_FUNCMAX || reg > PCIE_REGMAX) return (-1); critical_enter(); @@ -695,8 +695,8 @@ pciereg_cfgwrite(int bus, unsigned slot, volatile vm_offset_t va; vm_paddr_t pa, papage; - if (bus < pcie_minbus || bus > pcie_maxbus || slot >= 32 || - func > PCI_FUNCMAX || reg >= 0x1000) + if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || + func > PCI_FUNCMAX || reg > PCIE_REGMAX) return; critical_enter(); From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 07:40:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 703D0106566C; Thu, 24 Sep 2009 07:40:25 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id E76878FC16; Thu, 24 Sep 2009 07:40:24 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 411EE45CA6; Thu, 24 Sep 2009 09:40:23 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E6D2F45C9F; Thu, 24 Sep 2009 09:40:16 +0200 (CEST) Date: Thu, 24 Sep 2009 09:40:20 +0200 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20090924074020.GC1604@garage.freebsd.pl> References: <200909231423.n8NEN9cE066046@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3siQDZowHQqNOShm" Content-Disposition: inline In-Reply-To: <200909231423.n8NEN9cE066046@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197432 - head/tools/regression/sockets/accf_data_attach X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 07:40:25 -0000 --3siQDZowHQqNOShm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 23, 2009 at 02:23:09PM +0000, John Baldwin wrote: > Author: jhb > Date: Wed Sep 23 14:23:09 2009 > New Revision: 197432 > URL: http://svn.freebsd.org/changeset/base/197432 >=20 > Log: > - Remove a bogus test: setsockopt() doesn't return a length, getsockopt= () > does. > - Use %z to printf a size_t to fix compile on 64-bit platforms. [...] > - "listen() returned wrong size (got %d expected %d)", len, > + "listen() returned wrong size (got %d expected %zd)", len, > sizeof(afa)); Actually, you want %zu for size_t. %zd is for ssize_t (which is signed). --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --3siQDZowHQqNOShm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKuyJkForvXbEpPzQRAp/TAKDowyxgqT+6NwYnG5u9gYYuIPRrOQCgxDoa fVX8WMAw9g/aU9RHyMhK4b0= =lA2p -----END PGP SIGNATURE----- --3siQDZowHQqNOShm-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 08:35:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5512A106566C; Thu, 24 Sep 2009 08:35:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42E1A8FC13; Thu, 24 Sep 2009 08:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8O8ZI4x090124; Thu, 24 Sep 2009 08:35:18 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8O8ZIeI090122; Thu, 24 Sep 2009 08:35:18 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909240835.n8O8ZIeI090122@svn.freebsd.org> From: Attilio Rao Date: Thu, 24 Sep 2009 08:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197452 - in stable/8/lib/libthr: . thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 08:35:18 -0000 Author: attilio Date: Thu Sep 24 08:35:17 2009 New Revision: 197452 URL: http://svn.freebsd.org/changeset/base/197452 Log: MFC r197445: Let fall down in the hard path (thus handling shared waiters wakeup correctly) for the shared waiters also in the rwlock held in shared mode as well, fixing possible deadlocks. Please note that this is a special condition as we want this fix in before RC2 as we assume it is critical and so it has been handled as an instant-merge. For the STABLE_7 branch, 1 week before the MFC is assumed. Approved by: re (kib) Modified: stable/8/lib/libthr/ (props changed) stable/8/lib/libthr/thread/thr_umtx.h Modified: stable/8/lib/libthr/thread/thr_umtx.h ============================================================================== --- stable/8/lib/libthr/thread/thr_umtx.h Thu Sep 24 08:16:12 2009 (r197451) +++ stable/8/lib/libthr/thread/thr_umtx.h Thu Sep 24 08:35:17 2009 (r197452) @@ -171,8 +171,11 @@ _thr_rwlock_unlock(struct urwlock *rwloc for (;;) { if (__predict_false(URWLOCK_READER_COUNT(state) == 0)) return (EPERM); - if (!((state & URWLOCK_WRITE_WAITERS) && URWLOCK_READER_COUNT(state) == 1)) { - if (atomic_cmpset_rel_32(&rwlock->rw_state, state, state-1)) + if (!((state & (URWLOCK_WRITE_WAITERS | + URWLOCK_READ_WAITERS)) && + URWLOCK_READER_COUNT(state) == 1)) { + if (atomic_cmpset_rel_32(&rwlock->rw_state, + state, state-1)) return (0); state = rwlock->rw_state; } else { From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 09:08:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523A8106566B; Thu, 24 Sep 2009 09:08:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 400448FC19; Thu, 24 Sep 2009 09:08:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8O98NVR091258; Thu, 24 Sep 2009 09:08:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8O98Ncg091256; Thu, 24 Sep 2009 09:08:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909240908.n8O98Ncg091256@svn.freebsd.org> From: Attilio Rao Date: Thu, 24 Sep 2009 09:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197453 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 09:08:23 -0000 Author: attilio Date: Thu Sep 24 09:08:22 2009 New Revision: 197453 URL: http://svn.freebsd.org/changeset/base/197453 Log: MFC r197223: Fix a deadlock in sched_switch_migrate given by the runqueues being not locked at once together when doing the switch. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/sched_ule.c Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Sep 24 08:35:17 2009 (r197452) +++ stable/7/sys/kern/sched_ule.c Thu Sep 24 09:08:22 2009 (r197453) @@ -1822,18 +1822,24 @@ sched_switch_migrate(struct tdq *tdq, st */ spinlock_enter(); thread_block_switch(td); /* This releases the lock on tdq. */ - TDQ_LOCK(tdn); - tdq_add(tdn, td, flags); - tdq_notify(td->td_sched); - /* - * After we unlock tdn the new cpu still can't switch into this - * thread until we've unblocked it in cpu_switch(). The lock - * pointers may match in the case of HTT cores. Don't unlock here - * or we can deadlock when the other CPU runs the IPI handler. + + /* + * Acquire both run-queue locks before placing the thread on the new + * run-queue to avoid deadlocks created by placing a thread with a + * blocked lock on the run-queue of a remote processor. The deadlock + * occurs when a third processor attempts to lock the two queues in + * question while the target processor is spinning with its own + * run-queue lock held while waiting for the blocked lock to clear. */ - if (TDQ_LOCKPTR(tdn) != TDQ_LOCKPTR(tdq)) { - TDQ_UNLOCK(tdn); + if (TDQ_LOCKPTR(tdn) == TDQ_LOCKPTR(tdq)) { TDQ_LOCK(tdq); + tdq_add(tdn, td, flags); + tdq_notify(td->td_sched); + } else { + tdq_lock_pair(tdn, tdq); + tdq_add(tdn, td, flags); + tdq_notify(td->td_sched); + TDQ_UNLOCK(tdn); } spinlock_exit(); #endif From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 11:11:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E355106566B; Thu, 24 Sep 2009 11:11:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CED28FC0A; Thu, 24 Sep 2009 11:11:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OBB1ft095478; Thu, 24 Sep 2009 11:11:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OBB1V0095476; Thu, 24 Sep 2009 11:11:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909241111.n8OBB1V0095476@svn.freebsd.org> From: Rui Paulo Date: Thu, 24 Sep 2009 11:11: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: r197454 - head/tools/tools/mwl/mwlstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 11:11:01 -0000 Author: rpaulo Date: Thu Sep 24 11:11:00 2009 New Revision: 197454 URL: http://svn.freebsd.org/changeset/base/197454 Log: Update the includes to two more levels of subdirs. MFC after: 1 week Modified: head/tools/tools/mwl/mwlstats/mwlstats.c Modified: head/tools/tools/mwl/mwlstats/mwlstats.c ============================================================================== --- head/tools/tools/mwl/mwlstats/mwlstats.c Thu Sep 24 09:08:22 2009 (r197453) +++ head/tools/tools/mwl/mwlstats/mwlstats.c Thu Sep 24 11:11:00 2009 (r197454) @@ -47,8 +47,8 @@ #include #include -#include "../../sys/net80211/ieee80211_ioctl.h" -#include "../../sys/net80211/ieee80211_radiotap.h" +#include "../../../../sys/net80211/ieee80211_ioctl.h" +#include "../../../../sys/net80211/ieee80211_radiotap.h" /* * Get Hardware Statistics. From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 14:26:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3F30106566C; Thu, 24 Sep 2009 14:26:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37948FC25; Thu, 24 Sep 2009 14:26:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OEQgJ6099166; Thu, 24 Sep 2009 14:26:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OEQgKf099164; Thu, 24 Sep 2009 14:26:42 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909241426.n8OEQgKf099164@svn.freebsd.org> From: Ed Maste Date: Thu, 24 Sep 2009 14:26: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: r197455 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 14:26:43 -0000 Author: emaste Date: Thu Sep 24 14:26:42 2009 New Revision: 197455 URL: http://svn.freebsd.org/changeset/base/197455 Log: Add a backtrace to the "fpudna in kernel mode!" case, to help track down where this comes from. Reviewed by: bde Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Sep 24 11:11:00 2009 (r197454) +++ head/sys/amd64/amd64/trap.c Thu Sep 24 14:26:42 2009 (r197455) @@ -505,8 +505,11 @@ trap(struct trapframe *frame) * XXX this should be fatal unless the kernel has * registered such use. */ - fpudna(); printf("fpudna in kernel mode!\n"); +#ifdef KDB + kdb_backtrace(); +#endif + fpudna(); goto out; case T_STKFLT: /* stack fault */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 14:30:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A4AA1065670; Thu, 24 Sep 2009 14:30: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 4F4A08FC13; Thu, 24 Sep 2009 14:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OEUHof099334; Thu, 24 Sep 2009 14:30:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OEUHDl099333; Thu, 24 Sep 2009 14:30:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909241430.n8OEUHDl099333@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Sep 2009 14:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197456 - stable/7/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 14:30:17 -0000 Author: jhb Date: Thu Sep 24 14:30:17 2009 New Revision: 197456 URL: http://svn.freebsd.org/changeset/base/197456 Log: Manually remove mergeinfo from this file. For some reason svn didn't elide this automatically as it should have during the previous revision. Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 15:34:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F81510656A4; Thu, 24 Sep 2009 15:34:19 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5668FC29; Thu, 24 Sep 2009 15:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OFYJp5000572; Thu, 24 Sep 2009 15:34:19 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OFYJLN000570; Thu, 24 Sep 2009 15:34:19 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909241534.n8OFYJLN000570@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 24 Sep 2009 15:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197457 - stable/8/lib/libdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 15:34:19 -0000 Author: nyan Date: Thu Sep 24 15:34:18 2009 New Revision: 197457 URL: http://svn.freebsd.org/changeset/base/197457 Log: MFC: r197322 and r197374 Revision: 197322 Log: Correct BIOS header sanitizing on pc98. Revision: 197374 Log: Disable a check on a disk size because it's too strict. This change is to avoid using incorrect geometry. It seems that this is the same problem in g_part_bsd_read()@g_part_bsd.c. Reviewed by: rink Approved by: re (kib) Modified: stable/8/lib/libdisk/ (props changed) stable/8/lib/libdisk/change.c Modified: stable/8/lib/libdisk/change.c ============================================================================== --- stable/8/lib/libdisk/change.c Thu Sep 24 14:30:17 2009 (r197456) +++ stable/8/lib/libdisk/change.c Thu Sep 24 15:34:18 2009 (r197457) @@ -36,17 +36,22 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_cyl >= 65536) sane = 0; - if (disk->bios_hd > 256) - sane = 0; #ifdef PC98 + if (disk->bios_hd >= 256) + sane = 0; if (disk->bios_sect >= 256) + sane = 0; #else + if (disk->bios_hd > 256) + sane = 0; if (disk->bios_sect > 63) -#endif sane = 0; +#endif +#if 0 /* Disable a check on a disk size. It's too strict. */ if (disk->bios_cyl * disk->bios_hd * disk->bios_sect != disk->chunks->size) sane = 0; +#endif if (sane) return; From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 15:49:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB861065697; Thu, 24 Sep 2009 15:49:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587BF8FC19; Thu, 24 Sep 2009 15:49:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OFnF90000885; Thu, 24 Sep 2009 15:49:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OFnF3L000883; Thu, 24 Sep 2009 15:49:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909241549.n8OFnF3L000883@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 24 Sep 2009 15:49: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: r197458 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 15:49:15 -0000 Author: pjd Date: Thu Sep 24 15:49:15 2009 New Revision: 197458 URL: http://svn.freebsd.org/changeset/base/197458 Log: Close race in zfs_zget(). We have to increase usecount first and then check for VI_DOOMED flag. Before this change vnode could be reclaimed between checking for the flag and increasing usecount. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Sep 24 15:34:18 2009 (r197457) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Sep 24 15:49:15 2009 (r197458) @@ -890,17 +890,25 @@ again: if (zp->z_unlinked) { err = ENOENT; } else { - if ((vp = ZTOV(zp)) != NULL) { - VI_LOCK(vp); + int dying = 0; + + vp = ZTOV(zp); + if (vp == NULL) + dying = 1; + else { + VN_HOLD(vp); if ((vp->v_iflag & VI_DOOMED) != 0) { - VI_UNLOCK(vp); - vp = NULL; - } else - VI_UNLOCK(vp); + dying = 1; + /* + * Don't VN_RELE() vnode here, because + * it can call vn_lock() which creates + * LOR between vnode lock and znode + * lock. We will VN_RELE() the vnode + * after droping znode lock. + */ + } } - if (vp != NULL) - VN_HOLD(vp); - else { + if (dying) { if (first) { ZFS_LOG(1, "dying znode detected (zp=%p)", zp); first = 0; @@ -912,6 +920,8 @@ again: dmu_buf_rele(db, NULL); mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + if (vp != NULL) + VN_RELE(vp); tsleep(zp, 0, "zcollide", 1); goto again; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 15:56:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF67106566B; Thu, 24 Sep 2009 15:56:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1D258FC1C; Thu, 24 Sep 2009 15:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OFuQa8001089; Thu, 24 Sep 2009 15:56:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OFuQjD001086; Thu, 24 Sep 2009 15:56:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909241556.n8OFuQjD001086@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 24 Sep 2009 15:56: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: r197459 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 15:56:26 -0000 Author: pjd Date: Thu Sep 24 15:56:26 2009 New Revision: 197459 URL: http://svn.freebsd.org/changeset/base/197459 Log: Before calling vflush(FORCECLOSE) mark file system as unmounted so the following vnops will fail. This is very important, because without this change vnode could be reclaimed at any point, even if we increased usecount. The only way to ensure that vnode won't be reclaimed was to lock it, which would be very hard to do in ZFS without changing a lot of code. With this change simply increasing usecount is enough to be sure vnode won't be reclaimed from under us. To be precise it can still be reclaimed but we won't be able to see it, because every try to enter ZFS through VFS will result in EIO. The only function that cannot return EIO, because it is needed for vflush() is zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks z_teardown_lock and never returns EIO. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Sep 24 15:49:15 2009 (r197458) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Sep 24 15:56:26 2009 (r197459) @@ -255,6 +255,7 @@ VTOZ(vnode_t *vp) /* * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. + * ZFS_ENTER_NOERROR() is called when we can't return EIO. * ZFS_EXIT() must be called before exitting the vop. * ZFS_VERIFY_ZP() verifies the znode is valid. */ @@ -267,6 +268,9 @@ VTOZ(vnode_t *vp) } \ } +#define ZFS_ENTER_NOERROR(zfsvfs) \ + rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) + #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) #define ZFS_VERIFY_ZP(zp) \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Sep 24 15:49:15 2009 (r197458) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Sep 24 15:56:26 2009 (r197459) @@ -864,7 +864,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t znode_t *rootzp; int error; - ZFS_ENTER(zfsvfs); + ZFS_ENTER_NOERROR(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) { @@ -1030,6 +1030,17 @@ zfs_umount(vfs_t *vfsp, int fflag) ASSERT(zfsvfs->z_ctldir == NULL); } + if (fflag & MS_FORCE) { + /* + * Mark file system as unmounted before calling + * vflush(FORCECLOSE). This way we ensure no future vnops + * will be called and risk operating on DOOMED vnodes. + */ + rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + zfsvfs->z_unmounted = B_TRUE; + rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + } + /* * Flush all the files. */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 16:51:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D2B1065676; Thu, 24 Sep 2009 16:51:56 +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 477D78FC19; Thu, 24 Sep 2009 16:51:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OGpunm002197; Thu, 24 Sep 2009 16:51:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OGpuxZ002195; Thu, 24 Sep 2009 16:51:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909241651.n8OGpuxZ002195@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Sep 2009 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197460 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 16:51:56 -0000 Author: jhb Date: Thu Sep 24 16:51:56 2009 New Revision: 197460 URL: http://svn.freebsd.org/changeset/base/197460 Log: Remove unnecessary locking from attach(). This fixes a LOR between the acpi_ibm lock and the sysctl lock. MFC after: 3 days Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Thu Sep 24 15:56:26 2009 (r197459) +++ head/sys/dev/acpi_support/acpi_ibm.c Thu Sep 24 16:51:56 2009 (r197460) @@ -356,8 +356,6 @@ acpi_ibm_attach(device_t dev) } sc->ec_handle = acpi_get_handle(sc->ec_dev); - ACPI_SERIAL_BEGIN(ibm); - /* Get the sysctl tree */ sc->sysctl_ctx = device_get_sysctl_ctx(dev); sc->sysctl_tree = device_get_sysctl_tree(dev); @@ -404,8 +402,6 @@ acpi_ibm_attach(device_t dev) "Thermal zones"); } - ACPI_SERIAL_END(ibm); - /* Handle notifies */ AcpiInstallNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, acpi_ibm_notify, dev); From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 16:57:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AE61065670; Thu, 24 Sep 2009 16:57:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36E558FC1A; Thu, 24 Sep 2009 16:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OGvZhZ002368; Thu, 24 Sep 2009 16:57:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OGvZfA002365; Thu, 24 Sep 2009 16:57:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909241657.n8OGvZfA002365@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 24 Sep 2009 16:57: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: r197461 - head/sys/dev/de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 16:57:36 -0000 Author: yongari Date: Thu Sep 24 16:57:35 2009 New Revision: 197461 URL: http://svn.freebsd.org/changeset/base/197461 Log: Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply alignment fixup code for received frames on strict alignment architectures. Modified: head/sys/dev/de/if_de.c head/sys/dev/de/if_devar.h Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Thu Sep 24 16:51:56 2009 (r197460) +++ head/sys/dev/de/if_de.c Thu Sep 24 16:57:35 2009 (r197461) @@ -3488,7 +3488,7 @@ tulip_rx_intr(tulip_softc_t * const sc) struct mbuf *m0; KASSERT(ms != NULL, ("no packet to accept")); -#if defined(TULIP_COPY_RXDATA) +#ifndef __NO_STRICT_ALIGNMENT /* * Copy the data into a new mbuf that is properly aligned. If * we fail to allocate a new mbuf, then drop the packet. We will @@ -3527,7 +3527,7 @@ tulip_rx_intr(tulip_softc_t * const sc) */ ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); -#if defined(TULIP_COPY_RXDATA) +#ifndef __NO_STRICT_ALIGNMENT skip_input: #endif if (ms == NULL) { Modified: head/sys/dev/de/if_devar.h ============================================================================== --- head/sys/dev/de/if_devar.h Thu Sep 24 16:51:56 2009 (r197460) +++ head/sys/dev/de/if_devar.h Thu Sep 24 16:57:35 2009 (r197461) @@ -134,9 +134,6 @@ typedef struct { * architecture which can't handle unaligned accesses) because with * 100Mb/s cards the copying is just too much of a hit. */ -#if !defined(__i386__) -#define TULIP_COPY_RXDATA 1 -#endif #define TULIP_DATA_PER_DESC 2032 #define TULIP_TXTIMER 4 From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 17:03:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB3D106566B; Thu, 24 Sep 2009 17:03:32 +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 9B5148FC1A; Thu, 24 Sep 2009 17:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OH3WEu002542; Thu, 24 Sep 2009 17:03:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OH3WMe002540; Thu, 24 Sep 2009 17:03:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909241703.n8OH3WMe002540@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Sep 2009 17:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197462 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 17:03:32 -0000 Author: mav Date: Thu Sep 24 17:03:32 2009 New Revision: 197462 URL: http://svn.freebsd.org/changeset/base/197462 Log: Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on driver load. This fixes crash on atapicam module load on systems, where some ata channels (usually ata1) was probed, but failed to attach. Reviewed by: jhb, imp Tested by: many Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Sep 24 16:57:35 2009 (r197461) +++ head/sys/kern/subr_bus.c Thu Sep 24 17:03:32 2009 (r197462) @@ -1017,7 +1017,7 @@ devclass_driver_added(devclass_t dc, dri * Call BUS_DRIVER_ADDED for any existing busses in this class. */ for (i = 0; i < dc->maxunit; i++) - if (dc->devices[i]) + if (dc->devices[i] && device_is_attached(dc->devices[i])) BUS_DRIVER_ADDED(dc->devices[i], driver); /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 17:07:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 672DF1065670; Thu, 24 Sep 2009 17:07:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 565E08FC08; Thu, 24 Sep 2009 17:07:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OH74pU002645; Thu, 24 Sep 2009 17:07:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OH74aQ002642; Thu, 24 Sep 2009 17:07:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909241707.n8OH74aQ002642@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 24 Sep 2009 17:07: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: r197463 - head/sys/dev/de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 17:07:04 -0000 Author: yongari Date: Thu Sep 24 17:07:04 2009 New Revision: 197463 URL: http://svn.freebsd.org/changeset/base/197463 Log: Consistently use bus_addr_t. Modified: head/sys/dev/de/if_de.c head/sys/dev/de/if_devar.h Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Thu Sep 24 17:03:32 2009 (r197462) +++ head/sys/dev/de/if_de.c Thu Sep 24 17:07:04 2009 (r197463) @@ -160,7 +160,7 @@ static void tulip_dma_map_rxbuf(void *, static void tulip_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - u_int32_t *paddr; + bus_addr_t *paddr; if (error) return; @@ -182,7 +182,7 @@ tulip_dma_map_rxbuf(void *arg, bus_dma_s KASSERT(nseg == 1, ("too many DMA segments")); KASSERT(segs[0].ds_len >= TULIP_RX_BUFLEN, ("receive buffer too small")); - desc->d_addr1 = segs[0].ds_addr; + desc->d_addr1 = segs[0].ds_addr & 0xffffffff; desc->d_length1 = TULIP_RX_BUFLEN; #ifdef not_needed /* These should already always be zero. */ @@ -3171,8 +3171,8 @@ tulip_reset(tulip_softc_t * const sc) sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr); - TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr); + TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr & 0xffffffff); + TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr & 0xffffffff); TULIP_CSR_WRITE(sc, csr_busmode, (1 << (3 /*pci_max_burst_len*/ + 8)) |TULIP_BUSMODE_CACHE_ALIGN8 @@ -4016,9 +4016,9 @@ tulip_txput(tulip_softc_t * const sc, st eop = nextout; eop->di_desc->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN; eop->di_desc->d_status = d_status; - eop->di_desc->d_addr1 = segs[segcnt].ds_addr; + eop->di_desc->d_addr1 = segs[segcnt].ds_addr & 0xffffffff; eop->di_desc->d_length1 = segs[segcnt].ds_len; - eop->di_desc->d_addr2 = segs[segcnt+1].ds_addr; + eop->di_desc->d_addr2 = segs[segcnt+1].ds_addr & 0xffffffff; eop->di_desc->d_length2 = segs[segcnt+1].ds_len; d_status = TULIP_DSTS_OWNER; if (++nextout == ri->ri_last) @@ -4028,7 +4028,7 @@ tulip_txput(tulip_softc_t * const sc, st eop = nextout; eop->di_desc->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN; eop->di_desc->d_status = d_status; - eop->di_desc->d_addr1 = segs[segcnt].ds_addr; + eop->di_desc->d_addr1 = segs[segcnt].ds_addr & 0xffffffff; eop->di_desc->d_length1 = segs[segcnt].ds_len; eop->di_desc->d_addr2 = 0; eop->di_desc->d_length2 = 0; @@ -4194,7 +4194,7 @@ tulip_txput_setup(tulip_softc_t * const nextout->d_length2 = 0; nextout->d_addr2 = 0; nextout->d_length1 = sizeof(sc->tulip_setupdata); - nextout->d_addr1 = sc->tulip_setup_dma_addr; + nextout->d_addr1 = sc->tulip_setup_dma_addr & 0xffffffff; bus_dmamap_sync(sc->tulip_setup_tag, sc->tulip_setup_map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); TULIP_TXDESC_PRESYNC(ri); Modified: head/sys/dev/de/if_devar.h ============================================================================== --- head/sys/dev/de/if_devar.h Thu Sep 24 17:03:32 2009 (r197462) +++ head/sys/dev/de/if_devar.h Thu Sep 24 17:07:04 2009 (r197463) @@ -104,7 +104,7 @@ typedef struct { tulip_descinfo_t *ri_descinfo; bus_dma_tag_t ri_ring_tag; bus_dmamap_t ri_ring_map; - uint32_t ri_dma_addr; + bus_addr_t ri_dma_addr; bus_dma_tag_t ri_data_tag; bus_dmamap_t *ri_data_maps; } tulip_ringinfo_t; @@ -557,7 +557,7 @@ struct tulip_softc { */ bus_dma_tag_t tulip_setup_tag; bus_dmamap_t tulip_setup_map; - uint32_t tulip_setup_dma_addr; + bus_addr_t tulip_setup_dma_addr; u_int32_t *tulip_setupbuf; u_int32_t tulip_setupdata[192 / sizeof(u_int32_t)]; char tulip_boardid[24]; From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 17:11:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB0C1065698; Thu, 24 Sep 2009 17:11: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 BF2758FC23; Thu, 24 Sep 2009 17:11:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OHBfxF002784; Thu, 24 Sep 2009 17:11:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OHBfI6002782; Thu, 24 Sep 2009 17:11:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909241711.n8OHBfI6002782@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 24 Sep 2009 17:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197464 - head/sys/dev/de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 17:11:41 -0000 Author: yongari Date: Thu Sep 24 17:11:41 2009 New Revision: 197464 URL: http://svn.freebsd.org/changeset/base/197464 Log: Destroy dmamap in dma cleanup. Modified: head/sys/dev/de/if_de.c Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Thu Sep 24 17:07:04 2009 (r197463) +++ head/sys/dev/de/if_de.c Thu Sep 24 17:11:41 2009 (r197464) @@ -4563,6 +4563,7 @@ tulip_busdma_cleanup(tulip_softc_t * con if (sc->tulip_setupbuf != NULL) { bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf, sc->tulip_setup_map); + bus_dmamap_destroy(sc->tulip_setup_tag, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 17:53:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39ABD106568B; Thu, 24 Sep 2009 17:53:01 +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 2846B8FC28; Thu, 24 Sep 2009 17:53:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OHr1ZX003647; Thu, 24 Sep 2009 17:53:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OHr0lj003644; Thu, 24 Sep 2009 17:53:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909241753.n8OHr0lj003644@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 24 Sep 2009 17:53: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: r197465 - head/sys/dev/de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 17:53:01 -0000 Author: yongari Date: Thu Sep 24 17:53:00 2009 New Revision: 197465 URL: http://svn.freebsd.org/changeset/base/197465 Log: Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE. Also align setup descriptor on 32 bytes boundary. Tx buffer have no alignment limitation so create dmamap without alignment restriction[1]. Rx buffer still seems to require 4 bytes alignment limitation but we can simply use MCLBYTES for size to map the buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated with m_getcl(9). de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers, increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES. While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore. This should fix de(4) breakage introduced after r176206. Submitted by: jhb [1] Reported by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp > Tested by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >, Takahashi Yoshihiro < nyan <> jp dot freebsd dot org > Modified: head/sys/dev/de/if_de.c head/sys/dev/de/if_devar.h Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Thu Sep 24 17:11:41 2009 (r197464) +++ head/sys/dev/de/if_de.c Thu Sep 24 17:53:00 2009 (r197465) @@ -4491,7 +4491,7 @@ tulip_busdma_freering(tulip_ringinfo_t * /* Allocate memory for a single descriptor ring. */ static int tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count, - bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri, const char *name) + bus_size_t align, int nsegs, tulip_ringinfo_t *ri, const char *name) { size_t size; int error, i; @@ -4499,7 +4499,7 @@ tulip_busdma_allocring(device_t dev, tul /* First, setup a tag. */ ri->ri_max = count; size = count * sizeof(tulip_desc_t); - error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ri->ri_ring_tag); if (error) { @@ -4527,9 +4527,9 @@ tulip_busdma_allocring(device_t dev, tul } /* Allocate a tag for the data buffers. */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, align, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - maxsize, nsegs, TULIP_DATA_PER_DESC, 0, NULL, NULL, &ri->ri_data_tag); + MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag); if (error) { device_printf(dev, "failed to allocate %s buffer dma tag\n", name); return (error); @@ -4587,8 +4587,8 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate space and dmamap for transmit ring. */ - error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, TULIP_DATA_PER_DESC, - TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit"); + error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, 1, TULIP_MAX_TXSEG, + &sc->tulip_txinfo, "transmit"); if (error) return (error); @@ -4599,7 +4599,7 @@ tulip_busdma_init(device_t dev, tulip_so * a waste in practice though as an ethernet frame can easily fit * in TULIP_RX_BUFLEN bytes. */ - error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, MCLBYTES, 1, + error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, 4, 1, &sc->tulip_rxinfo, "receive"); if (error) return (error); @@ -4607,7 +4607,7 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate a DMA tag, memory, and map for setup descriptor */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0, NULL, NULL, &sc->tulip_setup_tag); Modified: head/sys/dev/de/if_devar.h ============================================================================== --- head/sys/dev/de/if_devar.h Thu Sep 24 17:11:41 2009 (r197464) +++ head/sys/dev/de/if_devar.h Thu Sep 24 17:53:00 2009 (r197465) @@ -135,7 +135,6 @@ typedef struct { * 100Mb/s cards the copying is just too much of a hit. */ -#define TULIP_DATA_PER_DESC 2032 #define TULIP_TXTIMER 4 #define TULIP_RXDESCS 48 #define TULIP_TXDESCS 128 From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 19:24:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCED61065697; Thu, 24 Sep 2009 19:24:42 +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 A9B728FC12; Thu, 24 Sep 2009 19:24:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OJOgBO005471; Thu, 24 Sep 2009 19:24:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OJOgMx005464; Thu, 24 Sep 2009 19:24:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909241924.n8OJOgMx005464@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 Sep 2009 19:24: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: r197466 - in head/sys: compat/x86bios dev/atkbdc dev/dpms dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 19:24:42 -0000 Author: jkim Date: Thu Sep 24 19:24:42 2009 New Revision: 197466 URL: http://svn.freebsd.org/changeset/base/197466 Log: - Use FreeBSD function naming convention. - Change x86biosCall() to more appropriate x86bios_intr().[1] Discussed with: delphij, paradox (ddkprog yahoo com) Submitted by: paradox (ddkprog yahoo com)[1] Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h head/sys/compat/x86bios/x86bios_alloc.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/dpms/dpms.c head/sys/dev/fb/vesa.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Thu Sep 24 17:53:00 2009 (r197465) +++ head/sys/compat/x86bios/x86bios.c Thu Sep 24 19:24:42 2009 (r197466) @@ -91,7 +91,7 @@ x86bios_emu_outl(struct x86emu *emu, uin } void -x86biosCall(struct x86regs *regs, int intno) +x86bios_intr(struct x86regs *regs, int intno) { if (intno < 0 || intno > 255) @@ -107,7 +107,7 @@ x86biosCall(struct x86regs *regs, int in } void * -x86biosOffs(uint32_t offs) +x86bios_offset(uint32_t offs) { return (pbiosMem + offs); @@ -138,14 +138,14 @@ x86bios_init(void *arg __unused) memset(busySegMap, 0, sizeof(busySegMap)); - pbiosStack = x86biosAlloc(1, &offs); + pbiosStack = x86bios_alloc(1, &offs); } static void x86bios_uninit(void *arg __unused) { - x86biosFree(pbiosStack, 1); + x86bios_free(pbiosStack, 1); if (pbiosMem) pmap_unmapdev((vm_offset_t)pbiosMem, Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Thu Sep 24 17:53:00 2009 (r197465) +++ head/sys/compat/x86bios/x86bios.h Thu Sep 24 19:24:42 2009 (r197466) @@ -129,10 +129,10 @@ typedef struct x86regs x86regs_t; #define PAGE_RESERV (4096*5) __BEGIN_DECLS -void x86biosCall(struct x86regs *regs, int intno); -void *x86biosAlloc(int count, int *segs); -void x86biosFree(void *pbuf, int count); -void *x86biosOffs(uint32_t offs); +void *x86bios_alloc(int count, int *segs); +void x86bios_free(void *pbuf, int count); +void x86bios_intr(struct x86regs *regs, int intno); +void *x86bios_offset(uint32_t offs); __END_DECLS #endif /* !_X86BIOS_H_ */ Modified: head/sys/compat/x86bios/x86bios_alloc.c ============================================================================== --- head/sys/compat/x86bios/x86bios_alloc.c Thu Sep 24 17:53:00 2009 (r197465) +++ head/sys/compat/x86bios/x86bios_alloc.c Thu Sep 24 19:24:42 2009 (r197466) @@ -33,7 +33,7 @@ extern u_char *pbiosMem; extern int busySegMap[5]; void * -x86biosAlloc(int count, int *segs) +x86bios_alloc(int count, int *segs) { int i; int j; @@ -69,7 +69,7 @@ x86biosAlloc(int count, int *segs) } void -x86biosFree(void *pbuf, int count) +x86bios_free(void *pbuf, int count) { int i; int busySeg; Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Thu Sep 24 17:53:00 2009 (r197465) +++ head/sys/dev/atkbdc/atkbd.c Thu Sep 24 19:24:42 2009 (r197466) @@ -1098,18 +1098,18 @@ get_typematic(keyboard_t *kbd) vm_offset_t p; regs.R_AX = 0xc000; - x86biosCall(®s, 0x15); + x86bios_intr(®s, 0x15); if ((regs.R_EFLG & PSL_C) || regs.R_AH) return ENODEV; p = BIOS_PADDRTOVADDR((regs.R_ES << 4) + regs.R_BX); if ((readb(p + 6) & 0x40) == 0) /* int 16, function 0x09 supported? */ return ENODEV; regs.R_AX = 0x0900; - x86biosCall(®s, 0x16); + x86bios_intr(®s, 0x16); if ((regs.R_AL & 0x08) == 0) /* int 16, function 0x0306 supported? */ return ENODEV; regs.R_AX = 0x0306; - x86biosCall(®s, 0x16); + x86bios_intr(®s, 0x16); kbd->kb_delay1 = typematic_delay(regs.R_BH << 5); kbd->kb_delay2 = typematic_rate(regs.R_BL); return 0; Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Thu Sep 24 17:53:00 2009 (r197465) +++ head/sys/dev/dpms/dpms.c Thu Sep 24 19:24:42 2009 (r197466) @@ -197,7 +197,7 @@ dpms_call_bios(int subfunction, int *bh) regs.R_BH = *bh; regs.R_ES = 0; regs.R_DI = 0; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_EAX & 0xffff) != 0x004f) return (ENXIO); Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Sep 24 17:53:00 2009 (r197465) +++ head/sys/dev/fb/vesa.c Thu Sep 24 19:24:42 2009 (r197466) @@ -224,7 +224,7 @@ int10_set_mode(int mode) bzero(®s, sizeof(regs)); regs.R_EAX = 0x0000 | mode; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); return 0; } @@ -241,21 +241,21 @@ vesa_bios_get_mode(int mode, struct vesa regs.R_EAX = 0x4f01; regs.R_ECX = mode; - buf = (u_char *)x86biosAlloc(1, &offs); + buf = (u_char *)x86bios_alloc(1, &offs); regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) { - x86biosFree(buf, 1); + x86bios_free(buf, 1); return 1; } bcopy(buf, vmode, sizeof(*vmode)); - x86biosFree(buf, 1); + x86bios_free(buf, 1); return 0; } @@ -269,7 +269,7 @@ vesa_bios_set_mode(int mode) regs.R_EAX = 0x4f02; regs.R_EBX = mode; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); return ((regs.R_AX & 0xff) != 0x4f); } @@ -283,7 +283,7 @@ vesa_bios_get_dac(void) regs.R_EAX = 0x4f08; regs.R_EBX = 1; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return 6; @@ -300,7 +300,7 @@ vesa_bios_set_dac(int bits) regs.R_EAX = 0x4f08; regs.R_EBX = (bits << 8); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return 6; @@ -322,16 +322,16 @@ vesa_bios_save_palette(int start, int co regs.R_ECX = colors; regs.R_EDX = start; - p = (u_char *)x86biosAlloc(1, &offs); + p = (u_char *)x86bios_alloc(1, &offs); regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) { - x86biosFree(p, 1); + x86bios_free(p, 1); return 1; } @@ -342,7 +342,7 @@ vesa_bios_save_palette(int start, int co palette[i*3 + 2] = p[i*4] << bits; } - x86biosFree(p, 1); + x86bios_free(p, 1); return 0; } @@ -361,16 +361,16 @@ vesa_bios_save_palette2(int start, int c regs.R_ECX = colors; regs.R_EDX = start; - p = (u_char *)x86biosAlloc(1, &offs); + p = (u_char *)x86bios_alloc(1, &offs); regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) { - x86biosFree(p, 1); + x86bios_free(p, 1); return 1; } @@ -381,7 +381,7 @@ vesa_bios_save_palette2(int start, int c b[i] = p[i*4] << bits; } - x86biosFree(p, 1); + x86bios_free(p, 1); return 0; } @@ -393,7 +393,7 @@ vesa_bios_load_palette(int start, int co u_char *p; int i; - p = (u_char *)x86biosAlloc(1, &offs); + p = (u_char *)x86bios_alloc(1, &offs); bits = 8 - bits; for (i = 0; i < colors; ++i) { @@ -412,9 +412,9 @@ vesa_bios_load_palette(int start, int co regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); - x86biosFree(p, 1); + x86bios_free(p, 1); return ((regs.R_AX & 0xff) != 0x4f); } @@ -429,7 +429,7 @@ vesa_bios_load_palette2(int start, int c u_char *p; int i; - p = (u_char *)x86biosAlloc(1, &offs); + p = (u_char *)x86bios_alloc(1, &offs); bits = 8 - bits; for (i = 0; i < colors; ++i) { @@ -448,9 +448,9 @@ vesa_bios_load_palette2(int start, int c regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); - x86biosFree(p, 1); + x86bios_free(p, 1); return ((regs.R_AX & 0xff) != 0x4f); } @@ -466,7 +466,7 @@ vesa_bios_state_buf_size(void) regs.R_ECX = STATE_ALL; regs.R_EDX = STATE_SIZE; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return 0; @@ -489,18 +489,18 @@ vesa_bios_save_restore(int code, void *p regs.R_ECX = STATE_ALL; regs.R_EDX = code; - buf = (u_char *)x86biosAlloc(1, &offs); + buf = (u_char *)x86bios_alloc(1, &offs); regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); bcopy(p, buf, size); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); bcopy(buf, p, size); - x86biosFree(p, 1); + x86bios_free(p, 1); return ((regs.R_AX & 0xff) != 0x4f); } @@ -514,7 +514,7 @@ vesa_bios_get_line_length(void) regs.R_EAX = 0x4f06; regs.R_EBX = 1; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return -1; @@ -532,7 +532,7 @@ vesa_bios_set_line_length(int pixel, int regs.R_EBX = 0; regs.R_ECX = pixel; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); #if VESA_DEBUG > 1 printf("bx:%d, cx:%d, dx:%d\n", regs.R_BX, regs.R_CX, regs.R_DX); @@ -558,7 +558,7 @@ vesa_bios_get_start(int *x, int *y) regs.R_EAX = 0x4f07; regs.R_EBX = 1; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return -1; @@ -581,7 +581,7 @@ vesa_bios_set_start(int x, int y) regs.R_EDX = y; regs.R_ECX = x; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); return ((regs.R_AX & 0xff) != 0x4f); } @@ -674,7 +674,7 @@ vesa_bios_init(void) vesa_vmode_max = 0; vesa_vmode[0].vi_mode = EOT; - vmbuf = (u_char *)x86biosAlloc(1, &offs); + vmbuf = (u_char *)x86bios_alloc(1, &offs); bcopy("VBE2", vmbuf, 4); /* try for VBE2 data */ bzero(®s, sizeof(regs)); @@ -682,7 +682,7 @@ vesa_bios_init(void) regs.R_ES = SEG_ADDR(offs); regs.R_DI = SEG_OFF(offs); - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if (((regs.R_AX & 0xff) != 0x4f) || bcmp("VESA", vmbuf, 4)) return 1; @@ -704,17 +704,17 @@ vesa_bios_init(void) return 1; } - vesa_oemstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_oemstr)); + vesa_oemstr = (char *)x86bios_offset(FARP(vesa_adp_info->v_oemstr)); is_via_cle266 = strcmp(vesa_oemstr, VESA_VIA_CLE266) == 0; if (vesa_adp_info->v_version >= 0x0200) { - vesa_venderstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_venderstr)); - vesa_prodstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_prodstr)); - vesa_revstr = (char *)x86biosOffs(FARP(vesa_adp_info->v_revstr)); + vesa_venderstr = (char *)x86bios_offset(FARP(vesa_adp_info->v_venderstr)); + vesa_prodstr = (char *)x86bios_offset(FARP(vesa_adp_info->v_prodstr)); + vesa_revstr = (char *)x86bios_offset(FARP(vesa_adp_info->v_revstr)); } - vesa_vmodetab = (uint16_t *)x86biosOffs(FARP(vesa_adp_info->v_modetable)); + vesa_vmodetab = (uint16_t *)x86bios_offset(FARP(vesa_adp_info->v_modetable)); if (vesa_vmodetab == NULL) return 1; @@ -841,7 +841,7 @@ vesa_bios_init(void) } vesa_vmode[modes].vi_mode = EOT; - x86biosFree(vmbuf, 1); + x86bios_free(vmbuf, 1); if (bootverbose) printf("VESA: %d mode(s) found\n", modes); @@ -1282,7 +1282,7 @@ vesa_get_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 0x10; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return 1; @@ -1317,7 +1317,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 0; regs.R_EDX = offset / adp->va_window_gran; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); if ((regs.R_AX & 0xff) != 0x4f) return 1; @@ -1326,7 +1326,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_EAX = 0x4f05; regs.R_EBX = 1; regs.R_EDX = offset / adp->va_window_gran; - x86biosCall(®s, 0x10); + x86bios_intr(®s, 0x10); adp->va_window_orig = (offset/adp->va_window_gran)*adp->va_window_gran; return 0; /* XXX */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 19:42:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDBD81065672; Thu, 24 Sep 2009 19:42:56 +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 DCDFF8FC0C; Thu, 24 Sep 2009 19:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OJguYi005856; Thu, 24 Sep 2009 19:42:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OJguod005853; Thu, 24 Sep 2009 19:42:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909241942.n8OJguod005853@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 Sep 2009 19:42: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: r197467 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 19:42:57 -0000 Author: jkim Date: Thu Sep 24 19:42:56 2009 New Revision: 197467 URL: http://svn.freebsd.org/changeset/base/197467 Log: r197444 unnecessarily changed positions of these files. Re-sort. Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Sep 24 19:24:42 2009 (r197466) +++ head/sys/conf/files.amd64 Thu Sep 24 19:42:56 2009 (r197467) @@ -297,7 +297,7 @@ libkern/memset.c standard # # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa # -contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa compat/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Sep 24 19:24:42 2009 (r197466) +++ head/sys/conf/files.i386 Thu Sep 24 19:42:56 2009 (r197467) @@ -381,7 +381,7 @@ i386/xbox/pic16l.s optional xbox # # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa # -contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa compat/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 20:10:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B725106566B; Thu, 24 Sep 2009 20:10:06 +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 2A2FC8FC29; Thu, 24 Sep 2009 20:10:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OKA0D4006439; Thu, 24 Sep 2009 20:10:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OKA0nl006437; Thu, 24 Sep 2009 20:10:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909242010.n8OKA0nl006437@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 Sep 2009 20:10: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: r197468 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 20:10:06 -0000 Author: jkim Date: Thu Sep 24 20:10:00 2009 New Revision: 197468 URL: http://svn.freebsd.org/changeset/base/197468 Log: Some broken VESA BIOSes, e.g., IBM T23, return wrong value from vesa_bios_get_line_length() in graphics mode. Always calculate the value from known video info instead. Submitted by: paradox (ddkprog yahoo com) Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Sep 24 19:42:56 2009 (r197467) +++ head/sys/dev/fb/vesa.c Thu Sep 24 20:10:00 2009 (r197468) @@ -1132,10 +1132,8 @@ vesa_set_mode(video_adapter_t *adp, int vesa_adp->va_window_gran = info.vi_window_gran; } vesa_adp->va_window_orig = 0; - len = vesa_bios_get_line_length(); - if (len > 0) { - vesa_adp->va_line_width = len; - } else if (info.vi_flags & V_INFO_GRAPHICS) { + + if (info.vi_flags & V_INFO_GRAPHICS) { switch (info.vi_depth/info.vi_planes) { case 1: vesa_adp->va_line_width = info.vi_width/8; @@ -1161,6 +1159,9 @@ vesa_set_mode(video_adapter_t *adp, int } } else { vesa_adp->va_line_width = info.vi_width; + len = vesa_bios_get_line_length(); + if (len > 0) + vesa_adp->va_line_width = len; } vesa_adp->va_disp_start.x = 0; vesa_adp->va_disp_start.y = 0; From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 20:23:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE63106566B; Thu, 24 Sep 2009 20:23:24 +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 7E08E8FC18; Thu, 24 Sep 2009 20:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OKNO9P006720; Thu, 24 Sep 2009 20:23:24 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OKNO9T006718; Thu, 24 Sep 2009 20:23:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909242023.n8OKNO9T006718@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 Sep 2009 20:23: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: r197469 - head/sys/dev/dpms X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 20:23:24 -0000 Author: jkim Date: Thu Sep 24 20:23:24 2009 New Revision: 197469 URL: http://svn.freebsd.org/changeset/base/197469 Log: Initialize registers to zero before calling the interrupt handlers inside emulator as we did in r197424 for vesa. Submitted by: paradox (ddkprog yahoo com) Modified: head/sys/dev/dpms/dpms.c Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Thu Sep 24 20:10:00 2009 (r197468) +++ head/sys/dev/dpms/dpms.c Thu Sep 24 20:23:24 2009 (r197469) @@ -192,6 +192,7 @@ dpms_call_bios(int subfunction, int *bh) { x86regs_t regs; + bzero(®s, sizeof(regs)); regs.R_AX = VBE_DPMS_FUNCTION; regs.R_BL = subfunction; regs.R_BH = *bh; From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 20:33:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B181106566B; Thu, 24 Sep 2009 20:33:14 +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 59F628FC14; Thu, 24 Sep 2009 20:33:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OKXE5P006935; Thu, 24 Sep 2009 20:33:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OKXEEs006930; Thu, 24 Sep 2009 20:33:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909242033.n8OKXEEs006930@svn.freebsd.org> From: Ed Schouten Date: Thu, 24 Sep 2009 20:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197470 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 20:33:14 -0000 Author: ed Date: Thu Sep 24 20:33:14 2009 New Revision: 197470 URL: http://svn.freebsd.org/changeset/base/197470 Log: Make SCS work in 8-bit mode. This means we can finally do things like VT100 box drawing when using Syscons (8-bit characters). As far as I know, the only remaining issue is the absense of proper escape sequences for special keyboard characters (cursor, F1 to F12, etc) and xterm emulation should be ready for general use. Enabling xterm would have the following advantages: - Easier possible migration to Unicode. cons25 termcap entries are very 8-bit centric. They use things like CP437 characters for box drawing, etc. - Better support for SSH'ing to other operating systems/devices. Most switches use VT100-style admin interfaces. - Reduced bandwidth, because applications can now use things like scrolling regions. - You can finally use applications like dtach(1) on both the console and inside an xterm. Modified: head/sys/teken/teken.c head/sys/teken/teken.h head/sys/teken/teken_scs.h head/sys/teken/teken_subr.h Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Thu Sep 24 20:23:24 2009 (r197469) +++ head/sys/teken/teken.c Thu Sep 24 20:33:14 2009 (r197470) @@ -48,10 +48,6 @@ static FILE *df; #endif /* __FreeBSD__ && _KERNEL */ -#include "teken.h" -#include "teken_wcwidth.h" -#include "teken_scs.h" - /* Private flags for t_stateflags. */ #define TS_FIRSTDIGIT 0x01 /* First numeric digit in escape sequence. */ #define TS_INSERT 0x02 /* Insert mode. */ @@ -64,6 +60,10 @@ static FILE *df; /* Character that blanks a cell. */ #define BLANK ' ' +#include "teken.h" +#include "teken_wcwidth.h" +#include "teken_scs.h" + static teken_state_t teken_state_init; /* Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Thu Sep 24 20:23:24 2009 (r197469) +++ head/sys/teken/teken.h Thu Sep 24 20:33:14 2009 (r197470) @@ -109,7 +109,7 @@ typedef struct { tf_respond_t *tf_respond; } teken_funcs_t; -typedef teken_char_t teken_scs_t(teken_char_t); +typedef teken_char_t teken_scs_t(teken_t *, teken_char_t); /* * Terminal state. Modified: head/sys/teken/teken_scs.h ============================================================================== --- head/sys/teken/teken_scs.h Thu Sep 24 20:23:24 2009 (r197469) +++ head/sys/teken/teken_scs.h Thu Sep 24 20:33:14 2009 (r197470) @@ -58,39 +58,49 @@ static teken_char_t teken_scs_process(teken_t *t, teken_char_t c) { - return (t->t_scs[t->t_curscs](c)); + return (t->t_scs[t->t_curscs](t, c)); } /* Unicode points for VT100 box drawing. */ -static const uint16_t teken_boxdrawing[31] = { +static const uint16_t teken_boxdrawing_unicode[31] = { 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7 }; +/* CP437 points for VT100 box drawing. */ +static const uint8_t teken_boxdrawing_8bit[31] = { + 0x04, 0xb1, 0x48, 0x46, 0x43, 0x4c, 0xf8, 0xf1, + 0x4e, 0x56, 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0xc4, + 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0xb4, 0xc1, 0xc2, + 0xb3, 0xf3, 0xf2, 0xe3, 0xd8, 0x9c, 0xfa, +}; + static teken_char_t -teken_scs_special_graphics(teken_char_t c) +teken_scs_special_graphics(teken_t *t, teken_char_t c) { /* Box drawing. */ if (c >= '`' && c <= '~') - return (teken_boxdrawing[c - '`']); + return (t->t_stateflags & TS_8BIT ? + teken_boxdrawing_8bit[c - '`'] : + teken_boxdrawing_unicode[c - '`']); return (c); } static teken_char_t -teken_scs_uk_national(teken_char_t c) +teken_scs_uk_national(teken_t *t, teken_char_t c) { /* Pound sign. */ if (c == '#') - return (0xa3); + return (t->t_stateflags & TS_8BIT ? 0x9c : 0xa3); return (c); } static teken_char_t -teken_scs_us_ascii(teken_char_t c) +teken_scs_us_ascii(teken_t *t, teken_char_t c) { /* No processing. */ Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Thu Sep 24 20:23:24 2009 (r197469) +++ head/sys/teken/teken_subr.h Thu Sep 24 20:33:14 2009 (r197470) @@ -802,8 +802,9 @@ teken_subr_regular_character(teken_t *t, int width; if (t->t_stateflags & TS_8BIT) { - if (!(t->t_stateflags & TS_CONS25) && c <= 0x1B) + if (!(t->t_stateflags & TS_CONS25) && (c <= 0x1b || c == 0x7f)) return; + c = teken_scs_process(t, c); width = 1; } else { c = teken_scs_process(t, c); From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 20:34:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DB05106566B; Thu, 24 Sep 2009 20:34:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D4078FC18; Thu, 24 Sep 2009 20:34:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OKYjNm006993; Thu, 24 Sep 2009 20:34:45 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OKYjcD006991; Thu, 24 Sep 2009 20:34:45 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909242034.n8OKYjcD006991@svn.freebsd.org> From: Ed Schouten Date: Thu, 24 Sep 2009 20:34: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: r197471 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 20:34:45 -0000 Author: ed Date: Thu Sep 24 20:34:44 2009 New Revision: 197471 URL: http://svn.freebsd.org/changeset/base/197471 Log: Add __unused. It turns out my previous commit does survive a buildkernel, but not compilation of the individual test tools that use WARNS=6. Modified: head/sys/teken/teken_scs.h Modified: head/sys/teken/teken_scs.h ============================================================================== --- head/sys/teken/teken_scs.h Thu Sep 24 20:33:14 2009 (r197470) +++ head/sys/teken/teken_scs.h Thu Sep 24 20:34:44 2009 (r197471) @@ -100,7 +100,7 @@ teken_scs_uk_national(teken_t *t, teken_ } static teken_char_t -teken_scs_us_ascii(teken_t *t, teken_char_t c) +teken_scs_us_ascii(teken_t *t __unused, teken_char_t c) { /* No processing. */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 20:43:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FE1A1065692; Thu, 24 Sep 2009 20:43:08 +0000 (UTC) (envelope-from sepotvin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF6D8FC26; Thu, 24 Sep 2009 20:43:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OKh8t4007221; Thu, 24 Sep 2009 20:43:08 GMT (envelope-from sepotvin@svn.freebsd.org) Received: (from sepotvin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OKh8Yl007218; Thu, 24 Sep 2009 20:43:08 GMT (envelope-from sepotvin@svn.freebsd.org) Message-Id: <200909242043.n8OKh8Yl007218@svn.freebsd.org> From: "Stephane E. Potvin" Date: Thu, 24 Sep 2009 20:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197472 - stable/8/gnu/usr.bin/patch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 20:43:08 -0000 Author: sepotvin Date: Thu Sep 24 20:43:08 2009 New Revision: 197472 URL: http://svn.freebsd.org/changeset/base/197472 Log: MFC r197259 The buffer returned by fgetln is not a "C" string and might not be NUL terminated. Make sure that it is before using it. Reviewed by: marck@ Approved by: re (kib) Modified: stable/8/gnu/usr.bin/patch/ (props changed) stable/8/gnu/usr.bin/patch/common.h stable/8/gnu/usr.bin/patch/pch.c Modified: stable/8/gnu/usr.bin/patch/common.h ============================================================================== --- stable/8/gnu/usr.bin/patch/common.h Thu Sep 24 20:34:44 2009 (r197471) +++ stable/8/gnu/usr.bin/patch/common.h Thu Sep 24 20:43:08 2009 (r197472) @@ -34,6 +34,7 @@ #define Strcpy (void)strcpy #define Strcat (void)strcat #define Strlcpy (void)strlcpy +#define Strncpy (void)strncpy #define Strlcat (void)strlcat /* NeXT declares malloc and realloc incompatibly from us in some of Modified: stable/8/gnu/usr.bin/patch/pch.c ============================================================================== --- stable/8/gnu/usr.bin/patch/pch.c Thu Sep 24 20:34:44 2009 (r197471) +++ stable/8/gnu/usr.bin/patch/pch.c Thu Sep 24 20:43:08 2009 (r197472) @@ -1152,7 +1152,8 @@ pgets(bool do_indent) indent++; } } - Strlcpy(buf, line, len + 1 - skipped); + Strncpy(buf, line, len - skipped); + buf[len - skipped] = '\0'; } return len; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 21:32:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 548DC1065670; Thu, 24 Sep 2009 21:32:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 415398FC1C; Thu, 24 Sep 2009 21:32:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OLWvAN008156; Thu, 24 Sep 2009 21:32:57 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OLWvOJ008154; Thu, 24 Sep 2009 21:32:57 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200909242132.n8OLWvOJ008154@svn.freebsd.org> From: Brooks Davis Date: Thu, 24 Sep 2009 21:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197473 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 21:32:57 -0000 Author: brooks Date: Thu Sep 24 21:32:56 2009 New Revision: 197473 URL: http://svn.freebsd.org/changeset/base/197473 Log: MFC r197269: Allocate space for the group array in a static credential used in the quota code. One case was correctly handled in r194498, but this one was missed. PR: kern/138657 Tested by: PR submitter MFC after: 3 days Approved by: re@ (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/ufs/ufs/ufs_vnops.c Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Thu Sep 24 20:43:08 2009 (r197472) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Thu Sep 24 21:32:56 2009 (r197473) @@ -1449,6 +1449,7 @@ ufs_mkdir(ap) { #ifdef QUOTA struct ucred ucred, *ucp; + gid_t ucred_group; ucp = cnp->cn_cred; #endif /* @@ -1476,6 +1477,7 @@ ufs_mkdir(ap) refcount_init(&ucred.cr_ref, 1); ucred.cr_uid = ip->i_uid; ucred.cr_ngroups = 1; + ucred.cr_groups = &ucred_group; ucred.cr_groups[0] = dp->i_gid; ucp = &ucred; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 21:35:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3044A106568F; Thu, 24 Sep 2009 21:35:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE11D8FC14; Thu, 24 Sep 2009 21:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OLZDQf008258; Thu, 24 Sep 2009 21:35:13 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OLZDnY008256; Thu, 24 Sep 2009 21:35:13 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200909242135.n8OLZDnY008256@svn.freebsd.org> From: Brooks Davis Date: Thu, 24 Sep 2009 21:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197474 - stable/8/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 21:35:14 -0000 Author: brooks Date: Thu Sep 24 21:35:13 2009 New Revision: 197474 URL: http://svn.freebsd.org/changeset/base/197474 Log: MFC r196990: cr_groups is no longer embedded in struct ucred and is instead stored in a seperate array. As such we need to use kvm_read rather than bcopy to populate the ki_groups field. This fixes a crash when running ps -ax on a coredump. Reported by: brucec Tested by: brucec MFC after: 3 days Approved by: re@ (kib) Modified: stable/8/lib/libkvm/ (props changed) stable/8/lib/libkvm/kvm_proc.c Modified: stable/8/lib/libkvm/kvm_proc.c ============================================================================== --- stable/8/lib/libkvm/kvm_proc.c Thu Sep 24 21:32:56 2009 (r197473) +++ stable/8/lib/libkvm/kvm_proc.c Thu Sep 24 21:35:13 2009 (r197474) @@ -151,7 +151,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcn kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; } kp->ki_ngroups = ucred.cr_ngroups; - bcopy(ucred.cr_groups, kp->ki_groups, + kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups, kp->ki_ngroups * sizeof(gid_t)); kp->ki_uid = ucred.cr_uid; if (ucred.cr_prison != NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 22:42:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB1931065670; Thu, 24 Sep 2009 22:42:35 +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 9A88B8FC17; Thu, 24 Sep 2009 22:42:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OMgZk9009517; Thu, 24 Sep 2009 22:42:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OMgZeE009515; Thu, 24 Sep 2009 22:42:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909242242.n8OMgZeE009515@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 Sep 2009 22:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197475 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 22:42:35 -0000 Author: jkim Date: Thu Sep 24 22:42:35 2009 New Revision: 197475 URL: http://svn.freebsd.org/changeset/base/197475 Log: Dump real mode registers under bootverbose to help debugging BIOS emulator. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Thu Sep 24 21:35:13 2009 (r197474) +++ head/sys/compat/x86bios/x86bios.c Thu Sep 24 22:42:35 2009 (r197475) @@ -97,6 +97,11 @@ x86bios_intr(struct x86regs *regs, int i if (intno < 0 || intno > 255) return; + if (bootverbose) + printf("Calling real mode int 0x%x " + "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX); + mtx_lock_spin(&x86bios_lock); memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); @@ -104,6 +109,11 @@ x86bios_intr(struct x86regs *regs, int i memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); + + if (bootverbose) + printf("Exiting real mode int 0x%x " + "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX); } void * From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 00:03:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D151065676; Fri, 25 Sep 2009 00:03:13 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8845E8FC12; Fri, 25 Sep 2009 00:03:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P03DJ4011117; Fri, 25 Sep 2009 00:03:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8P03Dgx011115; Fri, 25 Sep 2009 00:03:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200909250003.n8P03Dgx011115@svn.freebsd.org> From: David Xu Date: Fri, 25 Sep 2009 00: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: r197476 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 00:03:13 -0000 Author: davidxu Date: Fri Sep 25 00:03:13 2009 New Revision: 197476 URL: http://svn.freebsd.org/changeset/base/197476 Log: In function do_rw_wrlock, when a writer got an error and before returning, check if there are readers blocked by us via URWLOCK_WRITE_WAITERS flag, and resume the readers. The error must be EAGAIN, otherwise there must have memory problem, and nobody can rescue the buggy application. The revision 197445 might be reverted. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Thu Sep 24 22:42:35 2009 (r197475) +++ head/sys/kern/kern_umtx.c Fri Sep 25 00:03:13 2009 (r197476) @@ -2556,6 +2556,7 @@ do_rw_wrlock(struct thread *td, struct u uint32_t flags; int32_t state, oldstate; int32_t blocked_writers; + int32_t blocked_readers; int error; uq = td->td_umtxq; @@ -2564,6 +2565,7 @@ do_rw_wrlock(struct thread *td, struct u if (error != 0) return (error); + blocked_readers = 0; for (;;) { state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); while (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { @@ -2575,8 +2577,18 @@ do_rw_wrlock(struct thread *td, struct u state = oldstate; } - if (error) + if (error) { + if (!(state & (URWLOCK_WRITE_OWNER|URWLOCK_WRITE_WAITERS)) && + blocked_readers != 0) { + umtxq_lock(&uq->uq_key); + umtxq_busy(&uq->uq_key); + umtxq_signal_queue(&uq->uq_key, INT_MAX, UMTX_SHARED_QUEUE); + umtxq_unbusy(&uq->uq_key); + umtxq_unlock(&uq->uq_key); + } + break; + } /* grab monitor lock */ umtxq_lock(&uq->uq_key); @@ -2627,7 +2639,9 @@ sleep: break; state = oldstate; } - } + blocked_readers = fuword32(&rwlock->rw_blocked_readers); + } else + blocked_readers = 0; umtxq_lock(&uq->uq_key); umtxq_unbusy(&uq->uq_key); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 00:15:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE74106566B; Fri, 25 Sep 2009 00:15:30 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4628FC18; Fri, 25 Sep 2009 00:15:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P0FU4o011379; Fri, 25 Sep 2009 00:15:30 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8P0FUFx011377; Fri, 25 Sep 2009 00:15:30 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200909250015.n8P0FUFx011377@svn.freebsd.org> From: David Xu Date: Fri, 25 Sep 2009 00:15: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: r197477 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 00:15:30 -0000 Author: davidxu Date: Fri Sep 25 00:15:30 2009 New Revision: 197477 URL: http://svn.freebsd.org/changeset/base/197477 Log: don't report error if key was deleted. PR: threads/135462 Modified: head/lib/libthr/thread/thr_spec.c Modified: head/lib/libthr/thread/thr_spec.c ============================================================================== --- head/lib/libthr/thread/thr_spec.c Fri Sep 25 00:03:13 2009 (r197476) +++ head/lib/libthr/thread/thr_spec.c Fri Sep 25 00:15:30 2009 (r197477) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 02:19:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 521F0106566C; Fri, 25 Sep 2009 02:19:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27CCC8FC08; Fri, 25 Sep 2009 02:19:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P2Jw07013954; Fri, 25 Sep 2009 02:19:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8P2JwWT013952; Fri, 25 Sep 2009 02:19:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909250219.n8P2JwWT013952@svn.freebsd.org> From: Xin LI Date: Fri, 25 Sep 2009 02:19: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: r197478 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 02:19:58 -0000 Author: delphij Date: Fri Sep 25 02:19:57 2009 New Revision: 197478 URL: http://svn.freebsd.org/changeset/base/197478 Log: Fix LINT build. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Fri Sep 25 00:15:30 2009 (r197477) +++ head/sys/dev/fb/vesa.c Fri Sep 25 02:19:57 2009 (r197478) @@ -1049,7 +1049,7 @@ static int vesa_set_mode(video_adapter_t *adp, int mode) { video_info_t info; - int len; + int len = 0; if (adp != vesa_adp) return (*prevvidsw->set_mode)(adp, mode); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 07:57:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 697F01065749; Fri, 25 Sep 2009 07:57:29 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DAAB8FC18; Fri, 25 Sep 2009 07:57:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P7vT5Z021748; Fri, 25 Sep 2009 07:57:29 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8P7vTih021746; Fri, 25 Sep 2009 07:57:29 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <200909250757.n8P7vTih021746@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 25 Sep 2009 07:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197479 - in stable/7/sys: . cddl/contrib/opensolaris/uts/common/fs/zfs contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 07:57:29 -0000 Author: marck (doc committer) Date: Fri Sep 25 07:57:28 2009 New Revision: 197479 URL: http://svn.freebsd.org/changeset/base/197479 Log: MFC r197150: There is a bug where mze_insert() can trigger an assert() of inserting the same entry twice. This bug is not fixed yet, but leads to situation where when try to access corrupted directory the kernel will panic. Until the bug is properly fixed, try to recover from it and log that it happened. OpenSolaris bug: 6709336 Approved by: pjd Modified: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Sep 25 02:19:57 2009 (r197478) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Sep 25 07:57:28 2009 (r197479) @@ -181,10 +181,11 @@ mze_compare(const void *arg1, const void return (0); } -static void +static int mze_insert(zap_t *zap, int chunkid, uint64_t hash, mzap_ent_phys_t *mzep) { mzap_ent_t *mze; + avl_index_t idx; ASSERT(zap->zap_ismicro); ASSERT(RW_WRITE_HELD(&zap->zap_rwlock)); @@ -194,7 +195,12 @@ mze_insert(zap_t *zap, int chunkid, uint mze->mze_chunkid = chunkid; mze->mze_hash = hash; mze->mze_phys = *mzep; - avl_add(&zap->zap_m.zap_avl, mze); + if (avl_find(&zap->zap_m.zap_avl, mze, &idx) != NULL) { + kmem_free(mze, sizeof (mzap_ent_t)); + return (EEXIST); + } + avl_insert(&zap->zap_m.zap_avl, mze, idx); + return (0); } static mzap_ent_t * @@ -329,10 +335,15 @@ mzap_open(objset_t *os, uint64_t obj, dm if (mze->mze_name[0]) { zap_name_t *zn; - zap->zap_m.zap_num_entries++; zn = zap_name_alloc(zap, mze->mze_name, MT_EXACT); - mze_insert(zap, i, zn->zn_hash, mze); + if (mze_insert(zap, i, zn->zn_hash, mze) == 0) + zap->zap_m.zap_num_entries++; + else { + printf("ZFS WARNING: Duplicated ZAP " + "entry detected (%s).", + mze->mze_name); + } zap_name_free(zn); } } @@ -771,7 +782,7 @@ again: if (zap->zap_m.zap_alloc_next == zap->zap_m.zap_num_chunks) zap->zap_m.zap_alloc_next = 0; - mze_insert(zap, i, zn->zn_hash, mze); + VERIFY(0 == mze_insert(zap, i, zn->zn_hash, mze)); return; } } From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 11:58:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B29A2106568D; Fri, 25 Sep 2009 11:58:51 +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 A1AC08FC13; Fri, 25 Sep 2009 11:58:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PBwpoJ028051; Fri, 25 Sep 2009 11:58:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PBwpbI028049; Fri, 25 Sep 2009 11:58:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909251158.n8PBwpbI028049@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 Sep 2009 11:58: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: r197480 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 11:58:51 -0000 Author: ed Date: Fri Sep 25 11:58:51 2009 New Revision: 197480 URL: http://svn.freebsd.org/changeset/base/197480 Log: Conformance: ignore {delete,insert} line while outside the scrolling region. I noticed a small inconsistency in delete and insert line between xterm and libteken. libteken allows these actions to happen while the cursor is placed outside the scrolling region, while xterm does not. This behaviour seems to be VT100-like. Confirmation: http://www.vt100.net/docs/vt102-ug/chapter5.html "This sequence is ignored when cursor is outside scrolling region." MFC after: 1 month Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Fri Sep 25 07:57:28 2009 (r197479) +++ head/sys/teken/teken_subr.h Fri Sep 25 11:58:51 2009 (r197480) @@ -397,6 +397,11 @@ teken_subr_delete_line(teken_t *t, unsig { teken_rect_t tr; + /* Ignore if outside scrolling region. */ + if (t->t_cursor.tp_row < t->t_scrollreg.ts_begin || + t->t_cursor.tp_row >= t->t_scrollreg.ts_end) + return; + tr.tr_begin.tp_col = 0; tr.tr_end.tp_row = t->t_scrollreg.ts_end; tr.tr_end.tp_col = t->t_winsize.tp_col; @@ -656,6 +661,11 @@ teken_subr_insert_line(teken_t *t, unsig { teken_rect_t tr; + /* Ignore if outside scrolling region. */ + if (t->t_cursor.tp_row < t->t_scrollreg.ts_begin || + t->t_cursor.tp_row >= t->t_scrollreg.ts_end) + return; + tr.tr_begin.tp_row = t->t_cursor.tp_row; tr.tr_begin.tp_col = 0; tr.tr_end.tp_col = t->t_winsize.tp_col; From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 13:51:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4835A1065672; Fri, 25 Sep 2009 13:51:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3720D8FC17; Fri, 25 Sep 2009 13:51:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PDp2Pd030235; Fri, 25 Sep 2009 13:51:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PDp2xx030232; Fri, 25 Sep 2009 13:51:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909251351.n8PDp2xx030232@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 Sep 2009 13:51: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: r197481 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 13:51:02 -0000 Author: ed Date: Fri Sep 25 13:51:01 2009 New Revision: 197481 URL: http://svn.freebsd.org/changeset/base/197481 Log: Add a new escape sequence to switch between cons25 and xterm. Just run this to switch to xterm: printf '\e[=T' If you get bored and want to switch back to cons25, run this: printf '\e[=1T' I can now send an email to the lists, asking whether people are interested in trying the xterm emulator. Modified: head/sys/teken/sequences head/sys/teken/teken_subr_compat.h Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Fri Sep 25 11:58:51 2009 (r197480) +++ head/sys/teken/sequences Fri Sep 25 13:51:01 2009 (r197481) @@ -104,6 +104,7 @@ C25ADBG Cons25 set adapter background ^ C25ADFG Cons25 set adapter foreground ^[ [ = F r C25BLPD Cons25 set bell pitch duration ^[ [ = B r r C25CURS Cons25 set cursor type ^[ [ = S r +C25MODE Cons25 set terminal mode ^[ [ = T r C25VTSW Cons25 switch virtual terminal ^[ [ z r # VT52 compatibility Modified: head/sys/teken/teken_subr_compat.h ============================================================================== --- head/sys/teken/teken_subr_compat.h Fri Sep 25 11:58:51 2009 (r197480) +++ head/sys/teken/teken_subr_compat.h Fri Sep 25 13:51:01 2009 (r197481) @@ -87,6 +87,20 @@ teken_subr_cons25_set_bell_pitch_duratio (duration & 0xffff)); } +static void +teken_subr_cons25_set_terminal_mode(teken_t *t, unsigned int mode) +{ + + switch (mode) { + case 0: /* Switch terminal to xterm. */ + t->t_stateflags &= ~TS_CONS25; + break; + case 1: /* Switch terminal to cons25. */ + t->t_stateflags |= TS_CONS25; + break; + } +} + #if 0 static void teken_subr_vt52_decid(teken_t *t) From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 14:58:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 313441065757; Fri, 25 Sep 2009 14:58:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04A8D8FC24; Fri, 25 Sep 2009 14:58:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PEw0RL031660; Fri, 25 Sep 2009 14:58:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PEw0sn031658; Fri, 25 Sep 2009 14:58:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251458.n8PEw0sn031658@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 14:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197482 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/pci dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 14:58:01 -0000 Author: jhb Date: Fri Sep 25 14:58:00 2009 New Revision: 197482 URL: http://svn.freebsd.org/changeset/base/197482 Log: MFC 197406: Don't reread the command register to see if enabling I/O or memory decoding "took". Other OS's that I checked do not do this and it breaks some amdpm(4) devices. Prior to 7.2 we did not honor the error returned when this failed anyway, so this in effect restores previous behavior. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/pci/pci.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Sep 25 13:51:01 2009 (r197481) +++ stable/8/sys/dev/pci/pci.c Fri Sep 25 14:58:00 2009 (r197482) @@ -2149,62 +2149,38 @@ pci_disable_busmaster_method(device_t de int pci_enable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_set_command_bit(dev, child, bit); - /* Some devices seem to need a brief stall here, what do to? */ - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) - return (0); - device_printf(child, "failed to enable %s mapping!\n", error); - return (ENXIO); + return (0); } int pci_disable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_clear_command_bit(dev, child, bit); - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) { - device_printf(child, "failed to disable %s mapping!\n", error); - return (ENXIO); - } return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 14:58:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89A201065670; Fri, 25 Sep 2009 14:58: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 E52598FC1A; Fri, 25 Sep 2009 14:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PEwUtH031717; Fri, 25 Sep 2009 14:58:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PEwURd031715; Fri, 25 Sep 2009 14:58:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251458.n8PEwURd031715@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 14:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197483 - in stable/7/sys: . contrib/pf dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 14:58:31 -0000 Author: jhb Date: Fri Sep 25 14:58:30 2009 New Revision: 197483 URL: http://svn.freebsd.org/changeset/base/197483 Log: MFC 197406: Don't reread the command register to see if enabling I/O or memory decoding "took". Other OS's that I checked do not do this and it breaks some amdpm(4) devices. Prior to 7.2 we did not honor the error returned when this failed anyway, so this in effect restores previous behavior. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pci.c Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Fri Sep 25 14:58:00 2009 (r197482) +++ stable/7/sys/dev/pci/pci.c Fri Sep 25 14:58:30 2009 (r197483) @@ -2134,62 +2134,38 @@ pci_disable_busmaster_method(device_t de int pci_enable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_set_command_bit(dev, child, bit); - /* Some devices seem to need a brief stall here, what do to? */ - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) - return (0); - device_printf(child, "failed to enable %s mapping!\n", error); - return (ENXIO); + return (0); } int pci_disable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_clear_command_bit(dev, child, bit); - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) { - device_printf(child, "failed to disable %s mapping!\n", error); - return (ENXIO); - } return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 15:08:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18381065697; Fri, 25 Sep 2009 15:08:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC4B8FC0C; Fri, 25 Sep 2009 15:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PF8QGK031984; Fri, 25 Sep 2009 15:08:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PF8QQP031981; Fri, 25 Sep 2009 15:08:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251508.n8PF8QQP031981@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 15:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197484 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 15:08:26 -0000 Author: jhb Date: Fri Sep 25 15:08:26 2009 New Revision: 197484 URL: http://svn.freebsd.org/changeset/base/197484 Log: MFC 197410: - Split the logic to parse an SMAP entry out into a separate function on amd64 similar to i386. This fixes a bug on amd64 where overlapping entries would not cause the SMAP parsing to stop. - Change the SMAP parsing code to do a sorted insertion into physmap[] instead of an append to support systems with out-of-order SMAP entries. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/i386/i386/machdep.c Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Fri Sep 25 14:58:30 2009 (r197483) +++ stable/8/sys/amd64/amd64/machdep.c Fri Sep 25 15:08:26 2009 (r197484) @@ -1192,6 +1192,77 @@ isa_irq_pending(void) u_int basemem; +static int +add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +{ + int i, insert_idx, physmap_idx; + + physmap_idx = *physmap_idxp; + + if (boothowto & RB_VERBOSE) + printf("SMAP type=%02x base=%016lx len=%016lx\n", + smap->type, smap->base, smap->length); + + if (smap->type != SMAP_TYPE_MEMORY) + return (1); + + if (smap->length == 0) + return (0); + + /* + * Find insertion point while checking for overlap. Start off by + * assuming the new entry will be added to the end. + */ + insert_idx = physmap_idx + 2; + for (i = 0; i <= physmap_idx; i += 2) { + if (smap->base < physmap[i + 1]) { + if (smap->base + smap->length <= physmap[i]) { + insert_idx = i; + break; + } + if (boothowto & RB_VERBOSE) + printf( + "Overlapping memory regions, ignoring second region\n"); + return (1); + } + } + + /* See if we can prepend to the next entry. */ + if (insert_idx <= physmap_idx && + smap->base + smap->length == physmap[insert_idx]) { + physmap[insert_idx] = smap->base; + return (1); + } + + /* See if we can append to the previous entry. */ + if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += smap->length; + return (1); + } + + physmap_idx += 2; + *physmap_idxp = physmap_idx; + if (physmap_idx == PHYSMAP_SIZE) { + printf( + "Too many segments in the physical address map, giving up\n"); + return (0); + } + + /* + * Move the last 'N' entries down to make room for the new + * entry if needed. + */ + for (i = physmap_idx; i > insert_idx; i -= 2) { + physmap[i] = physmap[i - 2]; + physmap[i + 1] = physmap[i - 1]; + } + + /* Insert the new entry. */ + physmap[insert_idx] = smap->base; + physmap[insert_idx + 1] = smap->base + smap->length; + return (1); +} + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -1235,40 +1306,9 @@ getmemsize(caddr_t kmdp, u_int64_t first smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); - for (smap = smapbase; smap < smapend; smap++) { - if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016lx len=%016lx\n", - smap->type, smap->base, smap->length); - - if (smap->type != SMAP_TYPE_MEMORY) - continue; - - if (smap->length == 0) - continue; - - for (i = 0; i <= physmap_idx; i += 2) { - if (smap->base < physmap[i + 1]) { - if (boothowto & RB_VERBOSE) - printf( - "Overlapping or non-monotonic memory region, ignoring second region\n"); - continue; - } - } - - if (smap->base == physmap[physmap_idx + 1]) { - physmap[physmap_idx + 1] += smap->length; - continue; - } - - physmap_idx += 2; - if (physmap_idx == PHYSMAP_SIZE) { - printf( - "Too many segments in the physical address map, giving up\n"); + for (smap = smapbase; smap < smapend; smap++) + if (!add_smap_entry(smap, physmap, &physmap_idx)) break; - } - physmap[physmap_idx] = smap->base; - physmap[physmap_idx + 1] = smap->base + smap->length; - } /* * Find the 'base memory' segment for SMP Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Fri Sep 25 14:58:30 2009 (r197483) +++ stable/8/sys/i386/i386/machdep.c Fri Sep 25 15:08:26 2009 (r197484) @@ -1946,7 +1946,7 @@ sdtossd(sd, ssd) static int add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) { - int i, physmap_idx; + int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; @@ -1968,17 +1968,34 @@ add_smap_entry(struct bios_smap *smap, v } #endif + /* + * Find insertion point while checking for overlap. Start off by + * assuming the new entry will be added to the end. + */ + insert_idx = physmap_idx + 2; for (i = 0; i <= physmap_idx; i += 2) { if (smap->base < physmap[i + 1]) { + if (smap->base + smap->length <= physmap[i]) { + insert_idx = i; + break; + } if (boothowto & RB_VERBOSE) printf( - "Overlapping or non-monotonic memory region, ignoring second region\n"); + "Overlapping memory regions, ignoring second region\n"); return (1); } } - if (smap->base == physmap[physmap_idx + 1]) { - physmap[physmap_idx + 1] += smap->length; + /* See if we can prepend to the next entry. */ + if (insert_idx <= physmap_idx && + smap->base + smap->length == physmap[insert_idx]) { + physmap[insert_idx] = smap->base; + return (1); + } + + /* See if we can append to the previous entry. */ + if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += smap->length; return (1); } @@ -1989,8 +2006,19 @@ add_smap_entry(struct bios_smap *smap, v "Too many segments in the physical address map, giving up\n"); return (0); } - physmap[physmap_idx] = smap->base; - physmap[physmap_idx + 1] = smap->base + smap->length; + + /* + * Move the last 'N' entries down to make room for the new + * entry if needed. + */ + for (i = physmap_idx; i > insert_idx; i -= 2) { + physmap[i] = physmap[i - 2]; + physmap[i + 1] = physmap[i - 1]; + } + + /* Insert the new entry. */ + physmap[insert_idx] = smap->base; + physmap[insert_idx + 1] = smap->base + smap->length; return (1); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 15:08:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59D31065670; Fri, 25 Sep 2009 15:08:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D35148FC1A; Fri, 25 Sep 2009 15:08:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PF8pIQ032027; Fri, 25 Sep 2009 15:08:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PF8p0G032024; Fri, 25 Sep 2009 15:08:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251508.n8PF8p0G032024@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 15:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197485 - in stable/7/sys: . amd64/amd64 contrib/pf i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 15:08:52 -0000 Author: jhb Date: Fri Sep 25 15:08:51 2009 New Revision: 197485 URL: http://svn.freebsd.org/changeset/base/197485 Log: MFC 197410: - Split the logic to parse an SMAP entry out into a separate function on amd64 similar to i386. This fixes a bug on amd64 where overlapping entries would not cause the SMAP parsing to stop. - Change the SMAP parsing code to do a sorted insertion into physmap[] instead of an append to support systems with out-of-order SMAP entries. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/machdep.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/i386/machdep.c Modified: stable/7/sys/amd64/amd64/machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/machdep.c Fri Sep 25 15:08:26 2009 (r197484) +++ stable/7/sys/amd64/amd64/machdep.c Fri Sep 25 15:08:51 2009 (r197485) @@ -862,6 +862,77 @@ isa_irq_pending(void) u_int basemem; +static int +add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +{ + int i, insert_idx, physmap_idx; + + physmap_idx = *physmap_idxp; + + if (boothowto & RB_VERBOSE) + printf("SMAP type=%02x base=%016lx len=%016lx\n", + smap->type, smap->base, smap->length); + + if (smap->type != SMAP_TYPE_MEMORY) + return (1); + + if (smap->length == 0) + return (0); + + /* + * Find insertion point while checking for overlap. Start off by + * assuming the new entry will be added to the end. + */ + insert_idx = physmap_idx + 2; + for (i = 0; i <= physmap_idx; i += 2) { + if (smap->base < physmap[i + 1]) { + if (smap->base + smap->length <= physmap[i]) { + insert_idx = i; + break; + } + if (boothowto & RB_VERBOSE) + printf( + "Overlapping memory regions, ignoring second region\n"); + return (1); + } + } + + /* See if we can prepend to the next entry. */ + if (insert_idx <= physmap_idx && + smap->base + smap->length == physmap[insert_idx]) { + physmap[insert_idx] = smap->base; + return (1); + } + + /* See if we can append to the previous entry. */ + if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += smap->length; + return (1); + } + + physmap_idx += 2; + *physmap_idxp = physmap_idx; + if (physmap_idx == PHYSMAP_SIZE) { + printf( + "Too many segments in the physical address map, giving up\n"); + return (0); + } + + /* + * Move the last 'N' entries down to make room for the new + * entry if needed. + */ + for (i = physmap_idx; i > insert_idx; i -= 2) { + physmap[i] = physmap[i - 2]; + physmap[i + 1] = physmap[i - 1]; + } + + /* Insert the new entry. */ + physmap[insert_idx] = smap->base; + physmap[insert_idx + 1] = smap->base + smap->length; + return (1); +} + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -905,40 +976,9 @@ getmemsize(caddr_t kmdp, u_int64_t first smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); - for (smap = smapbase; smap < smapend; smap++) { - if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016lx len=%016lx\n", - smap->type, smap->base, smap->length); - - if (smap->type != SMAP_TYPE_MEMORY) - continue; - - if (smap->length == 0) - continue; - - for (i = 0; i <= physmap_idx; i += 2) { - if (smap->base < physmap[i + 1]) { - if (boothowto & RB_VERBOSE) - printf( - "Overlapping or non-monotonic memory region, ignoring second region\n"); - continue; - } - } - - if (smap->base == physmap[physmap_idx + 1]) { - physmap[physmap_idx + 1] += smap->length; - continue; - } - - physmap_idx += 2; - if (physmap_idx == PHYSMAP_SIZE) { - printf( - "Too many segments in the physical address map, giving up\n"); + for (smap = smapbase; smap < smapend; smap++) + if (!add_smap_entry(smap, physmap, &physmap_idx)) break; - } - physmap[physmap_idx] = smap->base; - physmap[physmap_idx + 1] = smap->base + smap->length; - } /* * Find the 'base memory' segment for SMP Modified: stable/7/sys/i386/i386/machdep.c ============================================================================== --- stable/7/sys/i386/i386/machdep.c Fri Sep 25 15:08:26 2009 (r197484) +++ stable/7/sys/i386/i386/machdep.c Fri Sep 25 15:08:51 2009 (r197485) @@ -1653,7 +1653,7 @@ sdtossd(sd, ssd) static int add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) { - int i, physmap_idx; + int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; @@ -1675,17 +1675,34 @@ add_smap_entry(struct bios_smap *smap, v } #endif + /* + * Find insertion point while checking for overlap. Start off by + * assuming the new entry will be added to the end. + */ + insert_idx = physmap_idx + 2; for (i = 0; i <= physmap_idx; i += 2) { if (smap->base < physmap[i + 1]) { + if (smap->base + smap->length <= physmap[i]) { + insert_idx = i; + break; + } if (boothowto & RB_VERBOSE) printf( - "Overlapping or non-monotonic memory region, ignoring second region\n"); + "Overlapping memory regions, ignoring second region\n"); return (1); } } - if (smap->base == physmap[physmap_idx + 1]) { - physmap[physmap_idx + 1] += smap->length; + /* See if we can prepend to the next entry. */ + if (insert_idx <= physmap_idx && + smap->base + smap->length == physmap[insert_idx]) { + physmap[insert_idx] = smap->base; + return (1); + } + + /* See if we can append to the previous entry. */ + if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += smap->length; return (1); } @@ -1696,8 +1713,19 @@ add_smap_entry(struct bios_smap *smap, v "Too many segments in the physical address map, giving up\n"); return (0); } - physmap[physmap_idx] = smap->base; - physmap[physmap_idx + 1] = smap->base + smap->length; + + /* + * Move the last 'N' entries down to make room for the new + * entry if needed. + */ + for (i = physmap_idx; i > insert_idx; i -= 2) { + physmap[i] = physmap[i - 2]; + physmap[i + 1] = physmap[i - 1]; + } + + /* Insert the new entry. */ + physmap[insert_idx] = smap->base; + physmap[insert_idx + 1] = smap->base + smap->length; return (1); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 15:14:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DBF810656B1; Fri, 25 Sep 2009 15:14:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E50758FC16; Fri, 25 Sep 2009 15:14:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PFEB4H032186; Fri, 25 Sep 2009 15:14:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PFEBOv032184; Fri, 25 Sep 2009 15:14:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251514.n8PFEBOv032184@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 15:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197486 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/acpi_support dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 15:14:12 -0000 Author: jhb Date: Fri Sep 25 15:14:11 2009 New Revision: 197486 URL: http://svn.freebsd.org/changeset/base/197486 Log: MFC 197415: The elements in the component arrays may be direct Package objects rather than references to objects. In that case, simply use the Package directly. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/acpi_support/acpi_aiboost.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpi_support/acpi_aiboost.c ============================================================================== --- stable/8/sys/dev/acpi_support/acpi_aiboost.c Fri Sep 25 15:08:51 2009 (r197485) +++ stable/8/sys/dev/acpi_support/acpi_aiboost.c Fri Sep 25 15:14:11 2009 (r197486) @@ -46,7 +46,6 @@ ACPI_MODULE_NAME("AIBOOST") #define DESCSTRLEN 32 struct acpi_aiboost_element{ - ACPI_HANDLE h; uint32_t id; char desc[DESCSTRLEN]; }; @@ -127,22 +126,23 @@ static ACPI_STATUS acpi_aiboost_getcompo for(i = 1 ; i < o->Package.Count; i++){ elem = &o->Package.Elements[i]; - if(elem->Type != ACPI_TYPE_ANY){ - printf("NOREF\n"); - goto error; - } - c->elem[ i - 1].h = elem->Reference.Handle; - - buf2.Pointer = NULL; - buf2.Length = ACPI_ALLOCATE_BUFFER; - - status = AcpiEvaluateObject(c->elem[i - 1].h, NULL, NULL, - &buf2); - if(ACPI_FAILURE(status)){ - printf("FETCH OBJECT\n"); + if (elem->Type == ACPI_TYPE_ANY) { + buf2.Pointer = NULL; + buf2.Length = ACPI_ALLOCATE_BUFFER; + + status = AcpiEvaluateObject(elem->Reference.Handle, + NULL, NULL, &buf2); + if (ACPI_FAILURE(status)){ + printf("FETCH OBJECT\n"); + goto error; + } + subobj = buf2.Pointer; + } else if (elem->Type == ACPI_TYPE_PACKAGE) + subobj = elem; + else { + printf("NO PACKAGE\n"); goto error; } - subobj = buf2.Pointer; if(ACPI_FAILURE(acpi_PkgInt32(subobj,0, &c->elem[i -1].id))){ printf("ID FAILED\n"); goto error; @@ -151,15 +151,17 @@ static ACPI_STATUS acpi_aiboost_getcompo sizeof(c->elem[i - 1].desc)); if(ACPI_FAILURE(status)){ if(status == E2BIG){ - c->elem[i-1].desc[DESCSTRLEN-1] = 0; + c->elem[i - 1].desc[DESCSTRLEN-1] = 0; }else{ printf("DESC FAILED %d\n", i-1); goto error; } } - if(buf2.Pointer) - AcpiOsFree(buf2.Pointer); + if (buf2.Pointer) { + AcpiOsFree(buf2.Pointer); + buf2.Pointer = NULL; + } } if(buf.Pointer) From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 15:14:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBE04106568D; Fri, 25 Sep 2009 15:14:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12D98FC18; Fri, 25 Sep 2009 15:14:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PFEXcK032227; Fri, 25 Sep 2009 15:14:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PFEXRK032225; Fri, 25 Sep 2009 15:14:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251514.n8PFEXRK032225@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 15:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197487 - in stable/7/sys: . contrib/pf dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 15:14:33 -0000 Author: jhb Date: Fri Sep 25 15:14:33 2009 New Revision: 197487 URL: http://svn.freebsd.org/changeset/base/197487 Log: MFC 197415: The elements in the component arrays may be direct Package objects rather than references to objects. In that case, simply use the Package directly. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpi_support/acpi_aiboost.c Modified: stable/7/sys/dev/acpi_support/acpi_aiboost.c ============================================================================== --- stable/7/sys/dev/acpi_support/acpi_aiboost.c Fri Sep 25 15:14:11 2009 (r197486) +++ stable/7/sys/dev/acpi_support/acpi_aiboost.c Fri Sep 25 15:14:33 2009 (r197487) @@ -44,7 +44,6 @@ ACPI_MODULE_NAME("AIBOOST") #define DESCSTRLEN 32 struct acpi_aiboost_element{ - ACPI_HANDLE h; uint32_t id; char desc[DESCSTRLEN]; }; @@ -125,22 +124,23 @@ static ACPI_STATUS acpi_aiboost_getcompo for(i = 1 ; i < o->Package.Count; i++){ elem = &o->Package.Elements[i]; - if(elem->Type != ACPI_TYPE_ANY){ - printf("NOREF\n"); - goto error; - } - c->elem[ i - 1].h = elem->Reference.Handle; - - buf2.Pointer = NULL; - buf2.Length = ACPI_ALLOCATE_BUFFER; - - status = AcpiEvaluateObject(c->elem[i - 1].h, NULL, NULL, - &buf2); - if(ACPI_FAILURE(status)){ - printf("FETCH OBJECT\n"); + if (elem->Type == ACPI_TYPE_ANY) { + buf2.Pointer = NULL; + buf2.Length = ACPI_ALLOCATE_BUFFER; + + status = AcpiEvaluateObject(elem->Reference.Handle, + NULL, NULL, &buf2); + if (ACPI_FAILURE(status)){ + printf("FETCH OBJECT\n"); + goto error; + } + subobj = buf2.Pointer; + } else if (elem->Type == ACPI_TYPE_PACKAGE) + subobj = elem; + else { + printf("NO PACKAGE\n"); goto error; } - subobj = buf2.Pointer; if(ACPI_FAILURE(acpi_PkgInt32(subobj,0, &c->elem[i -1].id))){ printf("ID FAILED\n"); goto error; @@ -149,15 +149,17 @@ static ACPI_STATUS acpi_aiboost_getcompo sizeof(c->elem[i - 1].desc)); if(ACPI_FAILURE(status)){ if(status == E2BIG){ - c->elem[i-1].desc[DESCSTRLEN-1] = 0; + c->elem[i - 1].desc[DESCSTRLEN-1] = 0; }else{ printf("DESC FAILED %d\n", i-1); goto error; } } - if(buf2.Pointer) - AcpiOsFree(buf2.Pointer); + if (buf2.Pointer) { + AcpiOsFree(buf2.Pointer); + buf2.Pointer = NULL; + } } if(buf.Pointer) From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 16:45:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DAF2106566B; Fri, 25 Sep 2009 16:45:27 +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 8A3F48FC1E; Fri, 25 Sep 2009 16:45:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PGjR8E034002; Fri, 25 Sep 2009 16:45:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PGjR5u034000; Fri, 25 Sep 2009 16:45:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909251645.n8PGjR5u034000@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 16:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197488 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata/chipsets dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 16:45:27 -0000 Author: marius Date: Fri Sep 25 16:45:27 2009 New Revision: 197488 URL: http://svn.freebsd.org/changeset/base/197488 Log: - Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously the work area was totally unsynchronized which means this driver only had a chance of working on x86 when no bounce buffers were involved, which isn't that likely given that support for 64-bit DMA is currently broken throughout ata(4). - Add necessary little-endian conversion of accesses to the work area, making this driver work on big-endian hosts. While at it, use the alignment-agnostic byte order encoders in order to be on the safe side. - Clear the reserved member of the SG list entries in order to be on the safe side. [1] Submitted by: yongari [1] Reviewed by: yongari Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/chipsets/ata-marvell.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Fri Sep 25 15:14:33 2009 (r197487) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Fri Sep 25 16:45:27 2009 (r197488) @@ -227,6 +227,8 @@ ata_marvell_edma_ch_attach(device_t dev) work = ch->dma.work_bus; /* clear work area */ bzero(ch->dma.work, 1024+256); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* set legacy ATA resources */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { @@ -310,7 +312,11 @@ ata_marvell_edma_ch_attach(device_t dev) static int ata_marvell_edma_ch_detach(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ch->dma.work_tag && ch->dma.work_map) + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); ata_dmafini(dev); return (0); } @@ -344,8 +350,6 @@ ata_marvell_edma_begin_transaction(struc struct ata_channel *ch = device_get_softc(request->parent); u_int32_t req_in; u_int8_t *bytep; - u_int16_t *wordp; - u_int32_t *quadp; int i; int error, slot; @@ -374,13 +378,14 @@ ata_marvell_edma_begin_transaction(struc slot = (((req_in & ~0xfffffc00) >> 5) + 0) & 0x1f; bytep = (u_int8_t *)(ch->dma.work); bytep += (slot << 5); - wordp = (u_int16_t *)bytep; - quadp = (u_int32_t *)bytep; /* fill in this request */ - quadp[0] = (long)request->dma->sg_bus & 0xffffffff; - quadp[1] = (u_int64_t)request->dma->sg_bus >> 32; - wordp[4] = (request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag<<1); + le32enc(bytep + 0 * sizeof(u_int32_t), + request->dma->sg_bus & 0xffffffff); + le32enc(bytep + 1 * sizeof(u_int32_t), + (u_int64_t)request->dma->sg_bus >> 32); + le16enc(bytep + 4 * sizeof(u_int16_t), + (request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag << 1)); i = 10; bytep[i++] = (request->u.ata.count >> 8) & 0xff; @@ -409,6 +414,9 @@ ata_marvell_edma_begin_transaction(struc bytep[i++] = request->u.ata.command; bytep[i++] = 0x90 | ATA_COMMAND; + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* enable EDMA machinery if needed */ if (!(ATA_INL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch)) & 0x00000001)) { ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001); @@ -451,6 +459,8 @@ ata_marvell_edma_end_transaction(struct slot = (((rsp_in & ~0xffffff00) >> 3)) & 0x1f; rsp_out &= 0xffffff00; rsp_out += (slot << 3); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); response = (struct ata_marvell_response *) (ch->dma.work + 1024 + (slot << 3)); @@ -525,6 +535,7 @@ ata_marvell_edma_dmasetprd(void *xsc, bu prd[i].addrlo = htole32(segs[i].ds_addr); prd[i].count = htole32(segs[i].ds_len); prd[i].addrhi = htole32((u_int64_t)segs[i].ds_addr >> 32); + prd[i].reserved = 0; } prd[i - 1].count |= htole32(ATA_DMA_EOT); KASSERT(nsegs <= ATA_DMA_ENTRIES, ("too many DMA segment entries\n")); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 17:07:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 411D31065676; Fri, 25 Sep 2009 17:07:44 +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 2F6AA8FC12; Fri, 25 Sep 2009 17:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PH7iXi034477; Fri, 25 Sep 2009 17:07:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PH7iJu034475; Fri, 25 Sep 2009 17:07:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909251707.n8PH7iJu034475@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 17:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197489 - in stable/7/sys: . contrib/pf dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 17:07:44 -0000 Author: marius Date: Fri Sep 25 17:07:43 2009 New Revision: 197489 URL: http://svn.freebsd.org/changeset/base/197489 Log: MFC: 197402 - Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously the work area was totally unsynchronized which means this driver only had a chance of working on x86 when no bounce buffers were involved, which isn't that likely given that support for 64-bit DMA is currently broken throughout ata(4). - Add necessary little-endian conversion of accesses to the work area, making this driver work on big-endian hosts. While at it, use the alignment-agnostic byte order encoders in order to be on the safe side. - Clear the reserved member of the SG list entries in order to be on the safe side. [1] Submitted by: yongari [1] Reviewed by: yongari Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/ata-chipset.c Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Fri Sep 25 16:45:27 2009 (r197488) +++ stable/7/sys/dev/ata/ata-chipset.c Fri Sep 25 17:07:43 2009 (r197489) @@ -2690,6 +2690,8 @@ ata_marvell_edma_allocate(device_t dev) /* clear work area */ bzero(ch->dma->work, 1024+256); + bus_dmamap_sync(ch->dma->work_tag, ch->dma->work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* set legacy ATA resources */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { @@ -2799,8 +2801,6 @@ ata_marvell_edma_begin_transaction(struc struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); u_int32_t req_in; u_int8_t *bytep; - u_int16_t *wordp; - u_int32_t *quadp; int i, tag = 0x07; int dummy, error, slot; @@ -2831,13 +2831,14 @@ ata_marvell_edma_begin_transaction(struc slot = (((req_in & ~0xfffffc00) >> 5) + 0) & 0x1f; bytep = (u_int8_t *)(ch->dma->work); bytep += (slot << 5); - wordp = (u_int16_t *)bytep; - quadp = (u_int32_t *)bytep; /* fill in this request */ - quadp[0] = (long)ch->dma->sg_bus & 0xffffffff; - quadp[1] = (u_int64_t)ch->dma->sg_bus >> 32; - wordp[4] = (request->flags & ATA_R_READ ? 0x01 : 0x00) | (tag<<1); + le32enc(bytep + 0 * sizeof(u_int32_t), + ch->dma->sg_bus & 0xffffffff); + le32enc(bytep + 1 * sizeof(u_int32_t), + (u_int64_t)ch->dma->sg_bus >> 32); + le16enc(bytep + 4 * sizeof(u_int16_t), + (request->flags & ATA_R_READ ? 0x01 : 0x00) | (tag << 1)); i = 10; bytep[i++] = (request->u.ata.count >> 8) & 0xff; @@ -2866,6 +2867,9 @@ ata_marvell_edma_begin_transaction(struc bytep[i++] = request->u.ata.command; bytep[i++] = 0x90 | ATA_COMMAND; + bus_dmamap_sync(ch->dma->work_tag, ch->dma->work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* enable EDMA machinery if needed */ if (!(ATA_INL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch)) & 0x00000001)) { ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001); @@ -2908,6 +2912,8 @@ ata_marvell_edma_end_transaction(struct slot = (((rsp_in & ~0xffffff00) >> 3)) & 0x1f; rsp_out &= 0xffffff00; rsp_out += (slot << 3); + bus_dmamap_sync(ch->dma->work_tag, ch->dma->work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); response = (struct ata_marvell_response *) (ch->dma->work + 1024 + (slot << 3)); @@ -2982,6 +2988,7 @@ ata_marvell_edma_dmasetprd(void *xsc, bu prd[i].addrlo = htole32(segs[i].ds_addr); prd[i].count = htole32(segs[i].ds_len); prd[i].addrhi = htole32((u_int64_t)segs[i].ds_addr >> 32); + prd[i].reserved = 0; } prd[i - 1].count |= htole32(ATA_DMA_EOT); KASSERT(nsegs <= ATA_DMA_ENTRIES, ("too many DMA segment entries\n")); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 17:08:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3BA1065670; Fri, 25 Sep 2009 17:08:51 +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 4AEF08FC17; Fri, 25 Sep 2009 17:08:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PH8prH034535; Fri, 25 Sep 2009 17:08:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PH8pM9034533; Fri, 25 Sep 2009 17:08:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909251708.n8PH8pM9034533@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 17:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197490 - head/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 17:08:51 -0000 Author: marius Date: Fri Sep 25 17:08:51 2009 New Revision: 197490 URL: http://svn.freebsd.org/changeset/base/197490 Log: Merge r194204 from amd64/i386: Enable PRINTF_BUFR_SIZE by default. PR: 139134 MFC after: 3 days Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Sep 25 17:07:43 2009 (r197489) +++ head/sys/sparc64/conf/GENERIC Fri Sep 25 17:08:51 2009 (r197490) @@ -68,6 +68,7 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 17:48:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06531065672; Fri, 25 Sep 2009 17:48:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA488FC0A; Fri, 25 Sep 2009 17:48:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PHmUxi035404; Fri, 25 Sep 2009 17:48:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PHmUfs035402; Fri, 25 Sep 2009 17:48:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200909251748.n8PHmUfs035402@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 25 Sep 2009 17:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197491 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 17:48:30 -0000 Author: marcel Date: Fri Sep 25 17:48:30 2009 New Revision: 197491 URL: http://svn.freebsd.org/changeset/base/197491 Log: MFC rev 197449: Don't create more partitions than can fit in the table by checking that the index is within bounds. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/part/g_part.c Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Fri Sep 25 17:08:51 2009 (r197490) +++ stable/8/sys/geom/part/g_part.c Fri Sep 25 17:48:30 2009 (r197491) @@ -480,6 +480,10 @@ g_part_ctl_add(struct gctl_req *req, str gctl_error(req, "%d index '%d'", EEXIST, gpp->gpp_index); return (EEXIST); } + if (index > table->gpt_entries) { + gctl_error(req, "%d index '%d'", ENOSPC, index); + return (ENOSPC); + } entry = (delent == NULL) ? g_malloc(table->gpt_scheme->gps_entrysz, M_WAITOK | M_ZERO) : delent; From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 17:56:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CC2C1065672; Fri, 25 Sep 2009 17:56:14 +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 20FF98FC12; Fri, 25 Sep 2009 17:56:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PHuEWx035619; Fri, 25 Sep 2009 17:56:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PHuDDl035617; Fri, 25 Sep 2009 17:56:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909251756.n8PHuDDl035617@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 17:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197492 - in stable/6/sys: . conf contrib/pf dev/ata dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 17:56:14 -0000 Author: marius Date: Fri Sep 25 17:56:13 2009 New Revision: 197492 URL: http://svn.freebsd.org/changeset/base/197492 Log: MFC: r197402 - Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously the work area was totally unsynchronized which means this driver only had a chance of working on x86 when no bounce buffers were involved, which isn't that likely given that support for 64-bit DMA is currently broken throughout ata(4). - Add necessary little-endian conversion of accesses to the work area, making this driver work on big-endian hosts. While at it, use the alignment-agnostic byte order encoders in order to be on the safe side. - Clear the reserved member of the SG list entries in order to be on the safe side. [1] Submitted by: yongari [1] Reviewed by: yongari Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/ata/ata-chipset.c stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/6/sys/dev/ata/ata-chipset.c Fri Sep 25 17:48:30 2009 (r197491) +++ stable/6/sys/dev/ata/ata-chipset.c Fri Sep 25 17:56:13 2009 (r197492) @@ -2578,6 +2578,8 @@ ata_marvell_edma_allocate(device_t dev) /* clear work area */ bzero(ch->dma->work, 1024+256); + bus_dmamap_sync(ch->dma->work_tag, ch->dma->work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* set legacy ATA resources */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { @@ -2687,8 +2689,6 @@ ata_marvell_edma_begin_transaction(struc struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); u_int32_t req_in; u_int8_t *bytep; - u_int16_t *wordp; - u_int32_t *quadp; int i, tag = 0x07; int dummy, error, slot; @@ -2719,13 +2719,14 @@ ata_marvell_edma_begin_transaction(struc slot = (((req_in & ~0xfffffc00) >> 5) + 0) & 0x1f; bytep = (u_int8_t *)(ch->dma->work); bytep += (slot << 5); - wordp = (u_int16_t *)bytep; - quadp = (u_int32_t *)bytep; /* fill in this request */ - quadp[0] = (long)ch->dma->sg_bus & 0xffffffff; - quadp[1] = (u_int64_t)ch->dma->sg_bus >> 32; - wordp[4] = (request->flags & ATA_R_READ ? 0x01 : 0x00) | (tag<<1); + le32enc(bytep + 0 * sizeof(u_int32_t), + ch->dma->sg_bus & 0xffffffff); + le32enc(bytep + 1 * sizeof(u_int32_t), + (u_int64_t)ch->dma->sg_bus >> 32); + le16enc(bytep + 4 * sizeof(u_int16_t), + (request->flags & ATA_R_READ ? 0x01 : 0x00) | (tag << 1)); i = 10; bytep[i++] = (request->u.ata.count >> 8) & 0xff; @@ -2754,6 +2755,9 @@ ata_marvell_edma_begin_transaction(struc bytep[i++] = request->u.ata.command; bytep[i++] = 0x90 | ATA_COMMAND; + bus_dmamap_sync(ch->dma->work_tag, ch->dma->work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* enable EDMA machinery if needed */ if (!(ATA_INL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch)) & 0x00000001)) { ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001); @@ -2796,6 +2800,8 @@ ata_marvell_edma_end_transaction(struct slot = (((rsp_in & ~0xffffff00) >> 3)) & 0x1f; rsp_out &= 0xffffff00; rsp_out += (slot << 3); + bus_dmamap_sync(ch->dma->work_tag, ch->dma->work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); response = (struct ata_marvell_response *) (ch->dma->work + 1024 + (slot << 3)); @@ -2870,6 +2876,7 @@ ata_marvell_edma_dmasetprd(void *xsc, bu prd[i].addrlo = htole32(segs[i].ds_addr); prd[i].count = htole32(segs[i].ds_len); prd[i].addrhi = htole32((u_int64_t)segs[i].ds_addr >> 32); + prd[i].reserved = 0; } prd[i - 1].count |= htole32(ATA_DMA_EOT); KASSERT(nsegs <= ATA_DMA_ENTRIES, ("too many DMA segment entries\n")); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 17:56:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 356FD1065783; Fri, 25 Sep 2009 17:56:33 +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 24CBC8FC15; Fri, 25 Sep 2009 17:56:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PHuXSo035662; Fri, 25 Sep 2009 17:56:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PHuXMv035659; Fri, 25 Sep 2009 17:56:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909251756.n8PHuXMv035659@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 Sep 2009 17:56: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: r197493 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 17:56:33 -0000 Author: jkim Date: Fri Sep 25 17:56:32 2009 New Revision: 197493 URL: http://svn.freebsd.org/changeset/base/197493 Log: - Reduce BIOS memory mapping. We want 1MB of physical memory, not 12MB[1]. - Remove CS and IP registers from x86bios.h. They have no use for us. - Adjust register dump to make it little bit more useful for debugging. Submitted by: paradox (ddkprog yahoo com)[1] (initial version) Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Fri Sep 25 17:56:13 2009 (r197492) +++ head/sys/compat/x86bios/x86bios.c Fri Sep 25 17:56:32 2009 (r197493) @@ -98,9 +98,10 @@ x86bios_intr(struct x86regs *regs, int i return; if (bootverbose) - printf("Calling real mode int 0x%x " - "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n", - intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX); + printf("Calling int 0x%x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); mtx_lock_spin(&x86bios_lock); @@ -111,9 +112,10 @@ x86bios_intr(struct x86regs *regs, int i mtx_unlock_spin(&x86bios_lock); if (bootverbose) - printf("Exiting real mode int 0x%x " - "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n", - intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX); + printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); } void * @@ -144,7 +146,7 @@ x86bios_init(void *arg __unused) x86bios_emu.emu_outl = x86bios_emu_outl; x86bios_emu.mem_base = (char *)pbiosMem; - x86bios_emu.mem_size = 1024 * 1024; + x86bios_emu.mem_size = MAPPED_MEMORY_SIZE; memset(busySegMap, 0, sizeof(busySegMap)); Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Fri Sep 25 17:56:13 2009 (r197492) +++ head/sys/compat/x86bios/x86bios.h Fri Sep 25 17:56:32 2009 (r197493) @@ -54,7 +54,7 @@ union x86_register { }; struct x86regs { - uint16_t register_cs; + uint16_t padding; /* CS is unused. */ uint16_t register_ds; uint16_t register_es; uint16_t register_fs; @@ -70,7 +70,6 @@ struct x86regs { union x86_register register_bp; union x86_register register_si; union x86_register register_di; - union x86_register register_ip; }; typedef struct x86regs x86regs_t; @@ -102,7 +101,6 @@ typedef struct x86regs x86regs_t; #define R_BP register_bp.I16_reg.x_reg #define R_SI register_si.I16_reg.x_reg #define R_DI register_di.I16_reg.x_reg -#define R_IP register_ip.I16_reg.x_reg #define R_FLG register_flags /* special registers */ @@ -110,11 +108,9 @@ typedef struct x86regs x86regs_t; #define R_EBP register_bp.I32_reg.e_reg #define R_ESI register_si.I32_reg.e_reg #define R_EDI register_di.I32_reg.e_reg -#define R_EIP register_ip.I32_reg.e_reg #define R_EFLG register_flags /* segment registers */ -#define R_CS register_cs #define R_DS register_ds #define R_SS register_ss #define R_ES register_es @@ -125,8 +121,8 @@ typedef struct x86regs x86regs_t; #define SEG_OFF(x) ((x) & 0x0FFFF) #define FARP(x) ((le32toh(x) & 0xffff) + ((le32toh(x) >> 12) & 0xffff00)) -#define MAPPED_MEMORY_SIZE 0xc00000 -#define PAGE_RESERV (4096*5) +#define MAPPED_MEMORY_SIZE (1024 * 1024) +#define PAGE_RESERV (4096 * 5) __BEGIN_DECLS void *x86bios_alloc(int count, int *segs); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 18:04:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 413BA106566C; Fri, 25 Sep 2009 18:04:56 +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 2EB7B8FC21; Fri, 25 Sep 2009 18:04:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PI4uB8035939; Fri, 25 Sep 2009 18:04:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PI4unk035937; Fri, 25 Sep 2009 18:04:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909251804.n8PI4unk035937@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 Sep 2009 18:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197494 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 18:04:56 -0000 Author: mav Date: Fri Sep 25 18:04:55 2009 New Revision: 197494 URL: http://svn.freebsd.org/changeset/base/197494 Log: MFC rev. 197462: Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on driver load. This fixes crash on atapicam module load on systems, where some ata channels (usually ata1) was probed, but failed to attach. Reviewed by: jhb, imp Tested by: many Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_bus.c Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Fri Sep 25 17:56:32 2009 (r197493) +++ stable/8/sys/kern/subr_bus.c Fri Sep 25 18:04:55 2009 (r197494) @@ -1017,7 +1017,7 @@ devclass_driver_added(devclass_t dc, dri * Call BUS_DRIVER_ADDED for any existing busses in this class. */ for (i = 0; i < dc->maxunit; i++) - if (dc->devices[i]) + if (dc->devices[i] && device_is_attached(dc->devices[i])) BUS_DRIVER_ADDED(dc->devices[i], driver); /* From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 18:07:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DADA106566C; Fri, 25 Sep 2009 18:07: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 5B0868FC31; Fri, 25 Sep 2009 18:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PI7O7h036059; Fri, 25 Sep 2009 18:07:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PI7OTL036057; Fri, 25 Sep 2009 18:07:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909251807.n8PI7OTL036057@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 Sep 2009 18:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197495 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 18:07:24 -0000 Author: mav Date: Fri Sep 25 18:07:23 2009 New Revision: 197495 URL: http://svn.freebsd.org/changeset/base/197495 Log: Remove constraint, requiring request data to fulfill controller's alignment requirements. It is busdma task, to manage proper alignment by loading data to bounce buffers. PR: kern/127316 Reviewed by: current@ Tested by: Ryan Rogers Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ata-dma.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-dma.c ============================================================================== --- stable/8/sys/dev/ata/ata-dma.c Fri Sep 25 18:04:55 2009 (r197494) +++ stable/8/sys/dev/ata/ata-dma.c Fri Sep 25 18:07:23 2009 (r197495) @@ -272,10 +272,10 @@ ata_dmaload(struct ata_request *request, "FAILURE - zero length DMA transfer attempted\n"); return EIO; } - if (((uintptr_t)(request->data) & (ch->dma.alignment - 1)) || - (request->bytecount & (ch->dma.alignment - 1))) { + if (request->bytecount & (ch->dma.alignment - 1)) { device_printf(request->dev, - "FAILURE - non aligned DMA transfer attempted\n"); + "FAILURE - odd-sized DMA transfer attempt %d %% %d\n", + request->bytecount, ch->dma.alignment); return EIO; } if (request->bytecount > ch->dma.max_iosize) { From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 18:08:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71F8D1065676; Fri, 25 Sep 2009 18:08:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 617548FC18; Fri, 25 Sep 2009 18:08:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PI8cRk036123; Fri, 25 Sep 2009 18:08:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PI8cOf036121; Fri, 25 Sep 2009 18:08:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909251808.n8PI8cOf036121@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 Sep 2009 18:08: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: r197496 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 18:08:38 -0000 Author: jkim Date: Fri Sep 25 18:08:38 2009 New Revision: 197496 URL: http://svn.freebsd.org/changeset/base/197496 Log: Reject some VESA graphics modes if the controller does not have enough memory to support them. Some adapters have expansible memory slots but video mode table is static. In this case, unusable modes may be reported. Submitted by: paradox (ddkprog yahoo com) (initial patch) Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Fri Sep 25 18:07:23 2009 (r197495) +++ head/sys/dev/fb/vesa.c Fri Sep 25 18:08:38 2009 (r197496) @@ -194,6 +194,7 @@ static int vesa_bios_set_start(int x, in static int vesa_map_gen_mode_num(int type, int color, int mode); static int vesa_translate_flags(u_int16_t vflags); static int vesa_translate_mmodel(u_int8_t vmodel); +static int vesa_get_line_width(video_info_t *info); static int vesa_bios_init(void); static void vesa_clear_modes(video_info_t *info, int color); static vm_offset_t vesa_map_buffer(u_int paddr, size_t size); @@ -654,12 +655,44 @@ vesa_translate_mmodel(u_int8_t vmodel) } static int +vesa_get_line_width(video_info_t *info) +{ + int len; + int width; + + width = info->vi_width; + + if (info->vi_flags & V_INFO_GRAPHICS) + switch (info->vi_depth / info->vi_planes) { + case 1: + return (width / 8); + case 2: + return (width / 4); + case 4: + return (width / 2); + case 8: + return (width); + case 15: + case 16: + return (width * 2); + case 24: + case 32: + return (width * 4); + } + + len = vesa_bios_get_line_length(); + + return (len > 0 ? len : width); +} + +static int vesa_bios_init(void) { static struct vesa_info buf; struct vesa_mode vmode; video_info_t *p; x86regs_t regs; + size_t bsize; int offs; u_char *vmbuf; int is_via_cle266; @@ -837,6 +870,20 @@ vesa_bios_init(void) vesa_vmode[modes].vi_flags = vesa_translate_flags(vmode.v_modeattr) | V_INFO_VESA; + + /* Does it have enough memory to support this mode? */ + bsize = vesa_get_line_width(&vesa_vmode[modes]); + bsize *= vesa_vmode[modes].vi_height; + if (bsize > vesa_vmode[modes].vi_buffer_size) { +#if VESA_DEBUG > 1 + printf( + "Rejecting VESA %s mode: %d x %d x %d bpp attr = %x, not enough memory\n", + (vmode.v_modeattr & V_MODEGRAPHICS) != 0 ? "graphics" : "text", + vmode.v_width, vmode.v_height, vmode.v_bpp, vmode.v_modeattr); +#endif + continue; + } + ++modes; } vesa_vmode[modes].vi_mode = EOT; @@ -1049,7 +1096,6 @@ static int vesa_set_mode(video_adapter_t *adp, int mode) { video_info_t info; - int len = 0; if (adp != vesa_adp) return (*prevvidsw->set_mode)(adp, mode); @@ -1132,42 +1178,12 @@ vesa_set_mode(video_adapter_t *adp, int vesa_adp->va_window_gran = info.vi_window_gran; } vesa_adp->va_window_orig = 0; - - if (info.vi_flags & V_INFO_GRAPHICS) { - switch (info.vi_depth/info.vi_planes) { - case 1: - vesa_adp->va_line_width = info.vi_width/8; - break; - case 2: - vesa_adp->va_line_width = info.vi_width/4; - break; - case 4: - vesa_adp->va_line_width = info.vi_width/2; - break; - case 8: - default: /* shouldn't happen */ - vesa_adp->va_line_width = info.vi_width; - break; - case 15: - case 16: - vesa_adp->va_line_width = info.vi_width*2; - break; - case 24: - case 32: - vesa_adp->va_line_width = info.vi_width*4; - break; - } - } else { - vesa_adp->va_line_width = info.vi_width; - len = vesa_bios_get_line_length(); - if (len > 0) - vesa_adp->va_line_width = len; - } + vesa_adp->va_line_width = vesa_get_line_width(&info); vesa_adp->va_disp_start.x = 0; vesa_adp->va_disp_start.y = 0; #if VESA_DEBUG > 0 - printf("vesa_set_mode(): vi_width:%d, len:%d, line_width:%d\n", - info.vi_width, len, vesa_adp->va_line_width); + printf("vesa_set_mode(): vi_width:%d, line_width:%d\n", + info.vi_width, vesa_adp->va_line_width); #endif bcopy(&info, &vesa_adp->va_info, sizeof(vesa_adp->va_info)); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 18:19:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68C6B1065670; Fri, 25 Sep 2009 18:19:50 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 572D98FC13; Fri, 25 Sep 2009 18:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PIJo6P036383; Fri, 25 Sep 2009 18:19:50 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PIJoKs036380; Fri, 25 Sep 2009 18:19:50 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909251819.n8PIJoKs036380@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 25 Sep 2009 18:19: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: r197497 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 18:19:51 -0000 Author: pjd Date: Fri Sep 25 18:19:50 2009 New Revision: 197497 URL: http://svn.freebsd.org/changeset/base/197497 Log: Switch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to be a bit weak and OpenSolaris also switched to fletcher4. PR: kern/139072 Reported by: Daniel Grund MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c Fri Sep 25 18:08:38 2009 (r197496) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c Fri Sep 25 18:19:50 2009 (r197497) @@ -19,11 +19,111 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Fletcher Checksums + * ------------------ + * + * ZFS's 2nd and 4th order Fletcher checksums are defined by the following + * recurrence relations: + * + * a = a + f + * i i-1 i-1 + * + * b = b + a + * i i-1 i + * + * c = c + b (fletcher-4 only) + * i i-1 i + * + * d = d + c (fletcher-4 only) + * i i-1 i + * + * Where + * a_0 = b_0 = c_0 = d_0 = 0 + * and + * f_0 .. f_(n-1) are the input data. + * + * Using standard techniques, these translate into the following series: + * + * __n_ __n_ + * \ | \ | + * a = > f b = > i * f + * n /___| n - i n /___| n - i + * i = 1 i = 1 + * + * + * __n_ __n_ + * \ | i*(i+1) \ | i*(i+1)*(i+2) + * c = > ------- f d = > ------------- f + * n /___| 2 n - i n /___| 6 n - i + * i = 1 i = 1 + * + * For fletcher-2, the f_is are 64-bit, and [ab]_i are 64-bit accumulators. + * Since the additions are done mod (2^64), errors in the high bits may not + * be noticed. For this reason, fletcher-2 is deprecated. + * + * For fletcher-4, the f_is are 32-bit, and [abcd]_i are 64-bit accumulators. + * A conservative estimate of how big the buffer can get before we overflow + * can be estimated using f_i = 0xffffffff for all i: + * + * % bc + * f=2^32-1;d=0; for (i = 1; d<2^64; i++) { d += f*i*(i+1)*(i+2)/6 }; (i-1)*4 + * 2264 + * quit + * % + * + * So blocks of up to 2k will not overflow. Our largest block size is + * 128k, which has 32k 4-byte words, so we can compute the largest possible + * accumulators, then divide by 2^64 to figure the max amount of overflow: + * + * % bc + * a=b=c=d=0; f=2^32-1; for (i=1; i<=32*1024; i++) { a+=f; b+=a; c+=b; d+=c } + * a/2^64;b/2^64;c/2^64;d/2^64 + * 0 + * 0 + * 1365 + * 11186858 + * quit + * % + * + * So a and b cannot overflow. To make sure each bit of input has some + * effect on the contents of c and d, we can look at what the factors of + * the coefficients in the equations for c_n and d_n are. The number of 2s + * in the factors determines the lowest set bit in the multiplier. Running + * through the cases for n*(n+1)/2 reveals that the highest power of 2 is + * 2^14, and for n*(n+1)*(n+2)/6 it is 2^15. So while some data may overflow + * the 64-bit accumulators, every bit of every f_i effects every accumulator, + * even for 128k blocks. + * + * If we wanted to make a stronger version of fletcher4 (fletcher4c?), + * we could do our calculations mod (2^32 - 1) by adding in the carries + * periodically, and store the number of carries in the top 32-bits. + * + * -------------------- + * Checksum Performance + * -------------------- + * + * There are two interesting components to checksum performance: cached and + * uncached performance. With cached data, fletcher-2 is about four times + * faster than fletcher-4. With uncached data, the performance difference is + * negligible, since the cost of a cache fill dominates the processing time. + * Even though fletcher-4 is slower than fletcher-2, it is still a pretty + * efficient pass over the data. + * + * In normal operation, the data which is being checksummed is in a buffer + * which has been filled either by: + * + * 1. a compression step, which will be mostly cached, or + * 2. a bcopy() or copyin(), which will be uncached (because the + * copy is cache-bypassing). + * + * For both cached and uncached data, both fletcher checksums are much faster + * than sha-256, and slower than 'off', which doesn't touch the data at all. + */ #include #include Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Sep 25 18:08:38 2009 (r197496) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Sep 25 18:19:50 2009 (r197497) @@ -76,7 +76,7 @@ enum zio_checksum { ZIO_CHECKSUM_FUNCTIONS }; -#define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_2 +#define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_4 #define ZIO_CHECKSUM_DEFAULT ZIO_CHECKSUM_ON enum zio_compress { From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 18:24:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6BE106566B; Fri, 25 Sep 2009 18:24:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBE718FC27; Fri, 25 Sep 2009 18:24:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PIOLx0036515; Fri, 25 Sep 2009 18:24:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PIOLte036513; Fri, 25 Sep 2009 18:24:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909251824.n8PIOLte036513@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 25 Sep 2009 18:24: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: r197498 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 18:24:22 -0000 Author: pjd Date: Fri Sep 25 18:24:21 2009 New Revision: 197498 URL: http://svn.freebsd.org/changeset/base/197498 Log: Fletcher4 is not the default checksum algorithm. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Sep 25 18:19:50 2009 (r197497) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Sep 25 18:24:21 2009 (r197498) @@ -535,7 +535,7 @@ This property is not inherited. .ad .sp .6 .RS 4n -Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity +Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher4\fR, but this may change in future releases). The value "off" disables integrity checking on user data. Disabling checksums is NOT a recommended practice. .RE From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 18:43:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CB0C1065679; Fri, 25 Sep 2009 18:43:01 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id BDF438FC08; Fri, 25 Sep 2009 18:43:00 +0000 (UTC) Received: from c83-253-248-99.bredband.comhem.se ([83.253.248.99]:49075 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1MrFiN-0003gB-5s; Fri, 25 Sep 2009 20:40:21 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 4EC7FFFC0C; Fri, 25 Sep 2009 20:40:16 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Thomas Backman In-Reply-To: <200909251824.n8PIOLte036513@svn.freebsd.org> Date: Fri, 25 Sep 2009 20:40:13 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <200909251824.n8PIOLte036513@svn.freebsd.org> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1076) X-Originating-IP: 83.253.248.99 X-Scan-Result: No virus found in message 1MrFiN-0003gB-5s. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MrFiN-0003gB-5s 1bcca97e1caa395c4702091c3b4d12d7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197498 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 18:43:01 -0000 On Sep 25, 2009, at 8:24 PM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Fri Sep 25 18:24:21 2009 > New Revision: 197498 > URL: http://svn.freebsd.org/changeset/base/197498 > > Log: > Fletcher4 is not the default checksum algorithm. There's a typo in the commit message ("not" instead of "now"). Dunno if it's fixable (i.e. if you can edit it in svn), just wanted to make sure you noticed. :) Regards, Thomas From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 19:14:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32930106566B; Fri, 25 Sep 2009 19:14:21 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF748FC1C; Fri, 25 Sep 2009 19:14:20 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 90A4845C9F; Fri, 25 Sep 2009 21:14:18 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8DCFC45684; Fri, 25 Sep 2009 21:14:13 +0200 (CEST) Date: Fri, 25 Sep 2009 21:14:16 +0200 From: Pawel Jakub Dawidek To: Thomas Backman Message-ID: <20090925191416.GA1597@garage.freebsd.pl> References: <200909251824.n8PIOLte036513@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197498 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 19:14:21 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 25, 2009 at 08:40:13PM +0200, Thomas Backman wrote: > On Sep 25, 2009, at 8:24 PM, Pawel Jakub Dawidek wrote: >=20 > >Author: pjd > >Date: Fri Sep 25 18:24:21 2009 > >New Revision: 197498 > >URL: http://svn.freebsd.org/changeset/base/197498 > > > >Log: > > Fletcher4 is not the default checksum algorithm. > There's a typo in the commit message ("not" instead of "now"). Dunno =20 > if it's fixable (i.e. if you can edit it in svn), just wanted to make =20 > sure you noticed. :) I didn't, thanks. Unfortunately svn doesn't even allow forced commits, which is a paintful regression compared to cvs. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKvRaIForvXbEpPzQRAnDkAJ0STSZiFEN4f7FPrNARXYWFCxSHOACgwNjT dRdT+tZVCl2CyABIp2UB3tI= =PiEj -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 19:49:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D90AF106566B; Fri, 25 Sep 2009 19:49:07 +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 AF0A28FC1A; Fri, 25 Sep 2009 19:49:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PJn7tG038178; Fri, 25 Sep 2009 19:49:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PJn7te038176; Fri, 25 Sep 2009 19:49:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909251949.n8PJn7te038176@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 Sep 2009 19:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197501 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 19:49:07 -0000 Author: jkim Date: Fri Sep 25 19:49:07 2009 New Revision: 197501 URL: http://svn.freebsd.org/changeset/base/197501 Log: - Use x86bios_offset() instead of BIOS_PADDRTOVADDR() macro.[1] - Clear all registers before calling real mode interrupt handlers as we did for dpms and vesa and re-enable the function as it should be fixed by this. - Tidy up register access. For example, when we call INT 0x15, AH=0xc0, we used to initialize AX=0xc000 to clear AL at the same time but it is very confusing. We don't have to do this any more because we are explicitly clearing all registers now. - Check size of system configuration table although it is almost always 8. This is to make sure we are not reading some random low physical memory. Hopefully it is just zero in that case. :-) - Fix some style nits and add more comments. Submitted by: paradox (ddkprog yahoo com)[1] Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Fri Sep 25 18:50:33 2009 (r197500) +++ head/sys/dev/atkbdc/atkbd.c Fri Sep 25 19:49:07 2009 (r197501) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if 0 +#if defined(__i386__) || defined(__amd64__) #include #include #include @@ -1089,32 +1089,41 @@ atkbd_shutdown_final(void *v) static int get_typematic(keyboard_t *kbd) { -#if 0 +#if defined(__i386__) || defined(__amd64__) /* * Only some systems allow us to retrieve the keyboard repeat * rate previously set via the BIOS... */ x86regs_t regs; - vm_offset_t p; + uint8_t *p; - regs.R_AX = 0xc000; + /* Is BIOS system configuration table supported? */ + bzero(®s, sizeof(regs)); + regs.R_AH = 0xc0; x86bios_intr(®s, 0x15); - if ((regs.R_EFLG & PSL_C) || regs.R_AH) - return ENODEV; - p = BIOS_PADDRTOVADDR((regs.R_ES << 4) + regs.R_BX); - if ((readb(p + 6) & 0x40) == 0) /* int 16, function 0x09 supported? */ - return ENODEV; - regs.R_AX = 0x0900; + if ((regs.R_FLG & PSL_C) || regs.R_AH) + return (ENODEV); + + /* Is int 16, function 0x09 supported? */ + p = x86bios_offset((regs.R_ES << 4) + regs.R_BX); + if (readw(p) < 5 || (readb(p + 6) & 0x40) == 0) + return (ENODEV); + + /* Is int 16, function 0x0306 supported? */ + bzero(®s, sizeof(regs)); + regs.R_AH = 0x09; x86bios_intr(®s, 0x16); - if ((regs.R_AL & 0x08) == 0) /* int 16, function 0x0306 supported? */ - return ENODEV; + if ((regs.R_AL & 0x08) == 0) + return (ENODEV); + + bzero(®s, sizeof(regs)); regs.R_AX = 0x0306; x86bios_intr(®s, 0x16); kbd->kb_delay1 = typematic_delay(regs.R_BH << 5); kbd->kb_delay2 = typematic_rate(regs.R_BL); - return 0; + return (0); #else - return ENODEV; + return (ENODEV); #endif /* __i386__ || __amd64__ */ } From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 19:59:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1444106566B; Fri, 25 Sep 2009 19:59:18 +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 CDE0B8FC1A; Fri, 25 Sep 2009 19:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PJxInx038405; Fri, 25 Sep 2009 19:59:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PJxInd038403; Fri, 25 Sep 2009 19:59:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909251959.n8PJxInd038403@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 19:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197502 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/sound/pci dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 19:59:19 -0000 Author: marius Date: Fri Sep 25 19:59:18 2009 New Revision: 197502 URL: http://svn.freebsd.org/changeset/base/197502 Log: MFC: r197401 - According to Linux, the ALi M5451 can do 31-bit DMA instead of just 30-bit like the reset of the controllers supported by this driver. Actually ALi M5451 can be setup up to generate 32-bit addresses by setting the 31st bit via the accompanying ISA bridge, which allows it to work in sparc64 machines whose IOMMU require at least 32-bit DMA. Even though other architectures would also benefit from 32-bit DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT results in a buffer in the 32-bit range. - According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of ALi M5451 is fixed to 64k and in fact using the default size of 4k causes the chip to overrun the mapping, triggering uncorrectable DMA errors on sparc64. - The 4DWAVE DX and NX require the recording buffer to be 8-byte aligned so adjust the bus_dma_tag_create(9) accordingly. - Unlike the rest of the controllers supported by this driver, the ALi M5451 only has 32 hardware channels instead of 64 so limit the loop in tr_intr() accordingly. [1] Submitted by: yongari [1] Reviewed by: yongari (superset of what is committed) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/sound/pci/t4dwave.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/t4dwave.c ============================================================================== --- stable/8/sys/dev/sound/pci/t4dwave.c Fri Sep 25 19:49:07 2009 (r197501) +++ stable/8/sys/dev/sound/pci/t4dwave.c Fri Sep 25 19:59:18 2009 (r197502) @@ -45,18 +45,22 @@ SND_DECLARE_FILE("$FreeBSD$"); #define SPA_PCI_ID 0x70181039 #define TR_DEFAULT_BUFSZ 0x1000 +/* For ALi M5451 the DMA transfer size appears to be fixed to 64k. */ +#define ALI_BUFSZ 0x10000 +#define TR_BUFALGN 0x8 #define TR_TIMEOUT_CDC 0xffff +#define TR_MAXHWCH 64 +#define ALI_MAXHWCH 32 #define TR_MAXPLAYCH 4 +#define ALI_MAXPLAYCH 1 /* - * Though, it's not clearly documented in trident datasheet, trident - * audio cards can't handle DMA addresses located above 1GB. The LBA - * (loop begin address) register which holds DMA base address is 32bits - * register. - * But the MSB 2bits are used for other purposes(I guess it is really - * bad idea). This effectivly limits the DMA address space up to 1GB. + * Though, it's not clearly documented in the 4DWAVE datasheet, the + * DX and NX chips can't handle DMA addresses located above 1GB as the + * LBA (loop begin address) register which holds the DMA base address + * is 32-bit, but the two MSBs are used for other purposes. */ -#define TR_MAXADDR ((1 << 30) - 1) - +#define TR_MAXADDR ((1U << 30) - 1) +#define ALI_MAXADDR ((1U << 31) - 1) struct tr_info; @@ -97,6 +101,7 @@ struct tr_info { struct mtx *lock; + u_int32_t hwchns; u_int32_t playchns; unsigned int bufsz; @@ -398,7 +403,10 @@ tr_wrch(struct tr_chinfo *ch) ch->ec &= 0x00000fff; ch->alpha &= 0x00000fff; ch->delta &= 0x0000ffff; - ch->lba &= 0x3fffffff; + if (tr->type == ALI_PCI_ID) + ch->lba &= ALI_MAXADDR; + else + ch->lba &= TR_MAXADDR; cr[1]=ch->lba; cr[3]=(ch->fmc<<14) | (ch->rvol<<7) | (ch->cvol); @@ -441,7 +449,10 @@ tr_rdch(struct tr_chinfo *ch) snd_mtxunlock(tr->lock); - ch->lba= (cr[1] & 0x3fffffff); + if (tr->type == ALI_PCI_ID) + ch->lba=(cr[1] & ALI_MAXADDR); + else + ch->lba=(cr[1] & TR_MAXADDR); ch->fmc= (cr[3] & 0x0000c000) >> 14; ch->rvol= (cr[3] & 0x00003f80) >> 7; ch->cvol= (cr[3] & 0x0000007f); @@ -628,7 +639,6 @@ trrchan_setformat(kobj_t obj, void *data tr_wr(tr, TR_REG_SBCTRL, i, 1); return 0; - } static u_int32_t @@ -729,7 +739,7 @@ tr_intr(void *p) intsrc = tr_rd(tr, TR_REG_MISCINT, 4); if (intsrc & TR_INT_ADDR) { chnum = 0; - while (chnum < 64) { + while (chnum < tr->hwchns) { mask = 0x00000001; active = tr_rd(tr, (chnum < 32)? TR_REG_ADDRINTA : TR_REG_ADDRINTB, 4); bufhalf = tr_rd(tr, (chnum < 32)? TR_REG_CSPF_A : TR_REG_CSPF_B, 4); @@ -815,8 +825,13 @@ tr_pci_attach(device_t dev) u_int32_t data; struct tr_info *tr; struct ac97_info *codec = 0; + bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; +#ifdef __sparc64__ + device_t *children; + int nchildren; +#endif tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO); tr->type = pci_get_devid(dev); @@ -834,7 +849,7 @@ tr_pci_attach(device_t dev) } else { switch (tr->type) { case ALI_PCI_ID: - dacn = 1; + dacn = ALI_MAXPLAYCH; break; default: dacn = TR_MAXPLAYCH; @@ -859,8 +874,6 @@ tr_pci_attach(device_t dev) goto bad; } - tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, 65536); - if (tr_init(tr) == -1) { device_printf(dev, "unable to initialize the card\n"); goto bad; @@ -879,12 +892,59 @@ tr_pci_attach(device_t dev) goto bad; } - if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), /*alignment*/2, + if (tr->type == ALI_PCI_ID) { + /* + * The M5451 generates 31 bit of DMA and in order to do + * 32-bit DMA, the 31st bit can be set via its accompanying + * ISA bridge. Note that we can't predict whether bus_dma(9) + * will actually supply us with a 32-bit buffer and even when + * using a low address of BUS_SPACE_MAXADDR_32BIT for both + * we might end up with the play buffer being in the 32-bit + * range while the record buffer isn't or vice versa. So we + * limit enabling the 31st bit to sparc64, where the IOMMU + * guarantees that we're using a 32-bit address (and in turn + * requires it). + */ + lowaddr = ALI_MAXADDR; +#ifdef __sparc64__ + if (device_get_children(device_get_parent(dev), &children, + &nchildren) == 0) { + for (i = 0; i < nchildren; i++) { + if (pci_get_devid(children[i]) == 0x153310b9) { + lowaddr = BUS_SPACE_MAXADDR_32BIT; + data = pci_read_config(children[i], + 0x7e, 1); + if (bootverbose) + device_printf(dev, + "M1533 0x7e: 0x%x -> ", + data); + data |= 0x1; + if (bootverbose) + printf("0x%x\n", data); + pci_write_config(children[i], 0x7e, + data, 1); + break; + } + } + } + free(children, M_TEMP); +#endif + tr->hwchns = ALI_MAXHWCH; + tr->bufsz = ALI_BUFSZ; + } else { + lowaddr = TR_MAXADDR; + tr->hwchns = TR_MAXHWCH; + tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, + 65536); + } + + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), + /*alignment*/TR_BUFALGN, /*boundary*/0, - /*lowaddr*/TR_MAXADDR, + /*lowaddr*/lowaddr, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, + /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/tr->bufsz, /*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, &tr->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 19:59:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98600106566B; Fri, 25 Sep 2009 19:59:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2C58FC1F; Fri, 25 Sep 2009 19:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PJxmXV038449; Fri, 25 Sep 2009 19:59:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PJxm4v038447; Fri, 25 Sep 2009 19:59:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909251959.n8PJxm4v038447@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 19:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197503 - in stable/7/sys: . contrib/pf dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 19:59:48 -0000 Author: marius Date: Fri Sep 25 19:59:48 2009 New Revision: 197503 URL: http://svn.freebsd.org/changeset/base/197503 Log: MFC: r197401 - According to Linux, the ALi M5451 can do 31-bit DMA instead of just 30-bit like the reset of the controllers supported by this driver. Actually ALi M5451 can be setup up to generate 32-bit addresses by setting the 31st bit via the accompanying ISA bridge, which allows it to work in sparc64 machines whose IOMMU require at least 32-bit DMA. Even though other architectures would also benefit from 32-bit DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT results in a buffer in the 32-bit range. - According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of ALi M5451 is fixed to 64k and in fact using the default size of 4k causes the chip to overrun the mapping, triggering uncorrectable DMA errors on sparc64. - The 4DWAVE DX and NX require the recording buffer to be 8-byte aligned so adjust the bus_dma_tag_create(9) accordingly. - Unlike the rest of the controllers supported by this driver, the ALi M5451 only has 32 hardware channels instead of 64 so limit the loop in tr_intr() accordingly. [1] Submitted by: yongari [1] Reviewed by: yongari (superset of what is committed) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/sound/pci/t4dwave.c Modified: stable/7/sys/dev/sound/pci/t4dwave.c ============================================================================== --- stable/7/sys/dev/sound/pci/t4dwave.c Fri Sep 25 19:59:18 2009 (r197502) +++ stable/7/sys/dev/sound/pci/t4dwave.c Fri Sep 25 19:59:48 2009 (r197503) @@ -41,18 +41,22 @@ SND_DECLARE_FILE("$FreeBSD$"); #define SPA_PCI_ID 0x70181039 #define TR_DEFAULT_BUFSZ 0x1000 +/* For ALi M5451 the DMA transfer size appears to be fixed to 64k. */ +#define ALI_BUFSZ 0x10000 +#define TR_BUFALGN 0x8 #define TR_TIMEOUT_CDC 0xffff +#define TR_MAXHWCH 64 +#define ALI_MAXHWCH 32 #define TR_MAXPLAYCH 4 +#define ALI_MAXPLAYCH 1 /* - * Though, it's not clearly documented in trident datasheet, trident - * audio cards can't handle DMA addresses located above 1GB. The LBA - * (loop begin address) register which holds DMA base address is 32bits - * register. - * But the MSB 2bits are used for other purposes(I guess it is really - * bad idea). This effectivly limits the DMA address space up to 1GB. + * Though, it's not clearly documented in the 4DWAVE datasheet, the + * DX and NX chips can't handle DMA addresses located above 1GB as the + * LBA (loop begin address) register which holds the DMA base address + * is 32-bit, but the two MSBs are used for other purposes. */ -#define TR_MAXADDR ((1 << 30) - 1) - +#define TR_MAXADDR ((1U << 30) - 1) +#define ALI_MAXADDR ((1U << 31) - 1) struct tr_info; @@ -93,6 +97,7 @@ struct tr_info { struct mtx *lock; + u_int32_t hwchns; u_int32_t playchns; unsigned int bufsz; @@ -394,7 +399,10 @@ tr_wrch(struct tr_chinfo *ch) ch->ec &= 0x00000fff; ch->alpha &= 0x00000fff; ch->delta &= 0x0000ffff; - ch->lba &= 0x3fffffff; + if (tr->type == ALI_PCI_ID) + ch->lba &= ALI_MAXADDR; + else + ch->lba &= TR_MAXADDR; cr[1]=ch->lba; cr[3]=(ch->fmc<<14) | (ch->rvol<<7) | (ch->cvol); @@ -437,7 +445,10 @@ tr_rdch(struct tr_chinfo *ch) snd_mtxunlock(tr->lock); - ch->lba= (cr[1] & 0x3fffffff); + if (tr->type == ALI_PCI_ID) + ch->lba=(cr[1] & ALI_MAXADDR); + else + ch->lba=(cr[1] & TR_MAXADDR); ch->fmc= (cr[3] & 0x0000c000) >> 14; ch->rvol= (cr[3] & 0x00003f80) >> 7; ch->cvol= (cr[3] & 0x0000007f); @@ -624,7 +635,6 @@ trrchan_setformat(kobj_t obj, void *data tr_wr(tr, TR_REG_SBCTRL, i, 1); return 0; - } static int @@ -725,7 +735,7 @@ tr_intr(void *p) intsrc = tr_rd(tr, TR_REG_MISCINT, 4); if (intsrc & TR_INT_ADDR) { chnum = 0; - while (chnum < 64) { + while (chnum < tr->hwchns) { mask = 0x00000001; active = tr_rd(tr, (chnum < 32)? TR_REG_ADDRINTA : TR_REG_ADDRINTB, 4); bufhalf = tr_rd(tr, (chnum < 32)? TR_REG_CSPF_A : TR_REG_CSPF_B, 4); @@ -811,8 +821,13 @@ tr_pci_attach(device_t dev) u_int32_t data; struct tr_info *tr; struct ac97_info *codec = 0; + bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; +#ifdef __sparc64__ + device_t *children; + int nchildren; +#endif tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO); tr->type = pci_get_devid(dev); @@ -830,7 +845,7 @@ tr_pci_attach(device_t dev) } else { switch (tr->type) { case ALI_PCI_ID: - dacn = 1; + dacn = ALI_MAXPLAYCH; break; default: dacn = TR_MAXPLAYCH; @@ -855,8 +870,6 @@ tr_pci_attach(device_t dev) goto bad; } - tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, 65536); - if (tr_init(tr) == -1) { device_printf(dev, "unable to initialize the card\n"); goto bad; @@ -875,12 +888,59 @@ tr_pci_attach(device_t dev) goto bad; } - if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), /*alignment*/2, + if (tr->type == ALI_PCI_ID) { + /* + * The M5451 generates 31 bit of DMA and in order to do + * 32-bit DMA, the 31st bit can be set via its accompanying + * ISA bridge. Note that we can't predict whether bus_dma(9) + * will actually supply us with a 32-bit buffer and even when + * using a low address of BUS_SPACE_MAXADDR_32BIT for both + * we might end up with the play buffer being in the 32-bit + * range while the record buffer isn't or vice versa. So we + * limit enabling the 31st bit to sparc64, where the IOMMU + * guarantees that we're using a 32-bit address (and in turn + * requires it). + */ + lowaddr = ALI_MAXADDR; +#ifdef __sparc64__ + if (device_get_children(device_get_parent(dev), &children, + &nchildren) == 0) { + for (i = 0; i < nchildren; i++) { + if (pci_get_devid(children[i]) == 0x153310b9) { + lowaddr = BUS_SPACE_MAXADDR_32BIT; + data = pci_read_config(children[i], + 0x7e, 1); + if (bootverbose) + device_printf(dev, + "M1533 0x7e: 0x%x -> ", + data); + data |= 0x1; + if (bootverbose) + printf("0x%x\n", data); + pci_write_config(children[i], 0x7e, + data, 1); + break; + } + } + } + free(children, M_TEMP); +#endif + tr->hwchns = ALI_MAXHWCH; + tr->bufsz = ALI_BUFSZ; + } else { + lowaddr = TR_MAXADDR; + tr->hwchns = TR_MAXHWCH; + tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, + 65536); + } + + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), + /*alignment*/TR_BUFALGN, /*boundary*/0, - /*lowaddr*/TR_MAXADDR, + /*lowaddr*/lowaddr, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, + /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/tr->bufsz, /*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, &tr->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 20:06:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7920C106566C; Fri, 25 Sep 2009 20:06:31 +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 68E878FC20; Fri, 25 Sep 2009 20:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PK6VEK038707; Fri, 25 Sep 2009 20:06:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PK6VBW038705; Fri, 25 Sep 2009 20:06:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909252006.n8PK6VBW038705@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 Sep 2009 20:06: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: r197504 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 20:06:31 -0000 Author: jkim Date: Fri Sep 25 20:06:31 2009 New Revision: 197504 URL: http://svn.freebsd.org/changeset/base/197504 Log: Fix couple of style nits missed in the previous commit. Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Fri Sep 25 19:59:48 2009 (r197503) +++ head/sys/dev/atkbdc/atkbd.c Fri Sep 25 20:06:31 2009 (r197504) @@ -1101,7 +1101,7 @@ get_typematic(keyboard_t *kbd) bzero(®s, sizeof(regs)); regs.R_AH = 0xc0; x86bios_intr(®s, 0x15); - if ((regs.R_FLG & PSL_C) || regs.R_AH) + if ((regs.R_FLG & PSL_C) != 0 || regs.R_AH != 0) return (ENODEV); /* Is int 16, function 0x09 supported? */ From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 20:08:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27781106566B; Fri, 25 Sep 2009 20:08:54 +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 14F908FC0C; Fri, 25 Sep 2009 20:08:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PK8rsn038790; Fri, 25 Sep 2009 20:08:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PK8rwR038788; Fri, 25 Sep 2009 20:08:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909252008.n8PK8rwR038788@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Sep 2009 20:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197505 - in stable/6/sys: . conf contrib/pf dev/cxgb dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 20:08:54 -0000 Author: marius Date: Fri Sep 25 20:08:53 2009 New Revision: 197505 URL: http://svn.freebsd.org/changeset/base/197505 Log: MFC: r197401 - According to Linux, the ALi M5451 can do 31-bit DMA instead of just 30-bit like the reset of the controllers supported by this driver. Actually ALi M5451 can be setup up to generate 32-bit addresses by setting the 31st bit via the accompanying ISA bridge, which allows it to work in sparc64 machines whose IOMMU require at least 32-bit DMA. Even though other architectures would also benefit from 32-bit DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT results in a buffer in the 32-bit range. - According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of ALi M5451 is fixed to 64k and in fact using the default size of 4k causes the chip to overrun the mapping, triggering uncorrectable DMA errors on sparc64. - The 4DWAVE DX and NX require the recording buffer to be 8-byte aligned so adjust the bus_dma_tag_create(9) accordingly. - Unlike the rest of the controllers supported by this driver, the ALi M5451 only has 32 hardware channels instead of 64 so limit the loop in tr_intr() accordingly. [1] Submitted by: yongari [1] Reviewed by: yongari (superset of what is committed) Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/sound/pci/t4dwave.c Modified: stable/6/sys/dev/sound/pci/t4dwave.c ============================================================================== --- stable/6/sys/dev/sound/pci/t4dwave.c Fri Sep 25 20:06:31 2009 (r197504) +++ stable/6/sys/dev/sound/pci/t4dwave.c Fri Sep 25 20:08:53 2009 (r197505) @@ -41,18 +41,22 @@ SND_DECLARE_FILE("$FreeBSD$"); #define SPA_PCI_ID 0x70181039 #define TR_DEFAULT_BUFSZ 0x1000 +/* For ALi M5451 the DMA transfer size appears to be fixed to 64k. */ +#define ALI_BUFSZ 0x10000 +#define TR_BUFALGN 0x8 #define TR_TIMEOUT_CDC 0xffff +#define TR_MAXHWCH 64 +#define ALI_MAXHWCH 32 #define TR_MAXPLAYCH 4 +#define ALI_MAXPLAYCH 1 /* - * Though, it's not clearly documented in trident datasheet, trident - * audio cards can't handle DMA addresses located above 1GB. The LBA - * (loop begin address) register which holds DMA base address is 32bits - * register. - * But the MSB 2bits are used for other purposes(I guess it is really - * bad idea). This effectivly limits the DMA address space up to 1GB. + * Though, it's not clearly documented in the 4DWAVE datasheet, the + * DX and NX chips can't handle DMA addresses located above 1GB as the + * LBA (loop begin address) register which holds the DMA base address + * is 32-bit, but the two MSBs are used for other purposes. */ -#define TR_MAXADDR ((1 << 30) - 1) - +#define TR_MAXADDR ((1U << 30) - 1) +#define ALI_MAXADDR ((1U << 31) - 1) struct tr_info; @@ -93,6 +97,7 @@ struct tr_info { struct mtx *lock; + u_int32_t hwchns; u_int32_t playchns; unsigned int bufsz; @@ -394,7 +399,10 @@ tr_wrch(struct tr_chinfo *ch) ch->ec &= 0x00000fff; ch->alpha &= 0x00000fff; ch->delta &= 0x0000ffff; - ch->lba &= 0x3fffffff; + if (tr->type == ALI_PCI_ID) + ch->lba &= ALI_MAXADDR; + else + ch->lba &= TR_MAXADDR; cr[1]=ch->lba; cr[3]=(ch->fmc<<14) | (ch->rvol<<7) | (ch->cvol); @@ -437,7 +445,10 @@ tr_rdch(struct tr_chinfo *ch) snd_mtxunlock(tr->lock); - ch->lba= (cr[1] & 0x3fffffff); + if (tr->type == ALI_PCI_ID) + ch->lba=(cr[1] & ALI_MAXADDR); + else + ch->lba=(cr[1] & TR_MAXADDR); ch->fmc= (cr[3] & 0x0000c000) >> 14; ch->rvol= (cr[3] & 0x00003f80) >> 7; ch->cvol= (cr[3] & 0x0000007f); @@ -624,7 +635,6 @@ trrchan_setformat(kobj_t obj, void *data tr_wr(tr, TR_REG_SBCTRL, i, 1); return 0; - } static int @@ -725,7 +735,7 @@ tr_intr(void *p) intsrc = tr_rd(tr, TR_REG_MISCINT, 4); if (intsrc & TR_INT_ADDR) { chnum = 0; - while (chnum < 64) { + while (chnum < tr->hwchns) { mask = 0x00000001; active = tr_rd(tr, (chnum < 32)? TR_REG_ADDRINTA : TR_REG_ADDRINTB, 4); bufhalf = tr_rd(tr, (chnum < 32)? TR_REG_CSPF_A : TR_REG_CSPF_B, 4); @@ -811,8 +821,13 @@ tr_pci_attach(device_t dev) u_int32_t data; struct tr_info *tr; struct ac97_info *codec = 0; + bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; +#ifdef __sparc64__ + device_t *children; + int nchildren; +#endif if ((tr = malloc(sizeof(*tr), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { device_printf(dev, "cannot allocate softc\n"); @@ -834,7 +849,7 @@ tr_pci_attach(device_t dev) } else { switch (tr->type) { case ALI_PCI_ID: - dacn = 1; + dacn = ALI_MAXPLAYCH; break; default: dacn = TR_MAXPLAYCH; @@ -859,8 +874,6 @@ tr_pci_attach(device_t dev) goto bad; } - tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, 65536); - if (tr_init(tr) == -1) { device_printf(dev, "unable to initialize the card\n"); goto bad; @@ -879,11 +892,59 @@ tr_pci_attach(device_t dev) goto bad; } - if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0, - /*lowaddr*/TR_MAXADDR, + if (tr->type == ALI_PCI_ID) { + /* + * The M5451 generates 31 bit of DMA and in order to do + * 32-bit DMA, the 31st bit can be set via its accompanying + * ISA bridge. Note that we can't predict whether bus_dma(9) + * will actually supply us with a 32-bit buffer and even when + * using a low address of BUS_SPACE_MAXADDR_32BIT for both + * we might end up with the play buffer being in the 32-bit + * range while the record buffer isn't or vice versa. So we + * limit enabling the 31st bit to sparc64, where the IOMMU + * guarantees that we're using a 32-bit address (and in turn + * requires it). + */ + lowaddr = ALI_MAXADDR; +#ifdef __sparc64__ + if (device_get_children(device_get_parent(dev), &children, + &nchildren) == 0) { + for (i = 0; i < nchildren; i++) { + if (pci_get_devid(children[i]) == 0x153310b9) { + lowaddr = BUS_SPACE_MAXADDR_32BIT; + data = pci_read_config(children[i], + 0x7e, 1); + if (bootverbose) + device_printf(dev, + "M1533 0x7e: 0x%x -> ", + data); + data |= 0x1; + if (bootverbose) + printf("0x%x\n", data); + pci_write_config(children[i], 0x7e, + data, 1); + break; + } + } + } + free(children, M_TEMP); +#endif + tr->hwchns = ALI_MAXHWCH; + tr->bufsz = ALI_BUFSZ; + } else { + lowaddr = TR_MAXADDR; + tr->hwchns = TR_MAXHWCH; + tr->bufsz = pcm_getbuffersize(dev, 4096, TR_DEFAULT_BUFSZ, + 65536); + } + + if (bus_dma_tag_create(/*parent*/NULL, + /*alignment*/TR_BUFALGN, + /*boundary*/0, + /*lowaddr*/lowaddr, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, + /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/tr->bufsz, /*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, &tr->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 20:31:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D0B106568B for ; Fri, 25 Sep 2009 20:31:46 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mx.egr.msu.edu (surfnturf.egr.msu.edu [35.9.37.164]) by mx1.freebsd.org (Postfix) with ESMTP id 9AE6C8FC0A for ; Fri, 25 Sep 2009 20:31:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.egr.msu.edu (Postfix) with ESMTP id AC20A9BF78; Fri, 25 Sep 2009 16:13:56 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mx.egr.msu.edu ([127.0.0.1]) by localhost (surfnturf.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7gwY9BbU8Suf; Fri, 25 Sep 2009 16:13:56 -0400 (EDT) Received: from [35.9.132.20] (cal001.dhcp.egr.msu.edu [35.9.132.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mcdouga9) by mx.egr.msu.edu (Postfix) with ESMTPSA id DE2259BEFE; Fri, 25 Sep 2009 16:13:53 -0400 (EDT) Message-ID: <4ABD247D.40201@egr.msu.edu> Date: Fri, 25 Sep 2009 16:13:49 -0400 From: Adam McDougall User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200908170923.n7H9NR7t056904@svn.freebsd.org> In-Reply-To: <200908170923.n7H9NR7t056904@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r196300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 20:31:46 -0000 Pawel Jakub Dawidek wrote: > Author: pjd > Date: Mon Aug 17 09:23:27 2009 > New Revision: 196300 > URL: http://svn.freebsd.org/changeset/base/196300 > > Log: > MFC r196299: > > - We need to recycle vnode instead of freeing znode. > > Submitted by: avg > > - Add missing vnode interlock unlock. > - Remove redundant znode locking. > > Approved by: re (kib) > Two quick questions: - Do you think this fix would improve or fix the panic below? (transcribed by hand since it did not dump and I only have a screenshot) - Are the many misc ZFS fixes that went into 9.0 and 8.0 going to be MFC'ed to 7-stable sometime, including the one above? I have lucked out pretty well so far since May. Thanks. Sleeping thread (tid 100161), pid 919) owns a non-sleepable lock sched_switch() at sched_switch+0x1fe mi_switch() at mi_switch+0x18e sleepq_wait() at sleepq_wait+0x3b _sx_xlock_hard() at _sx_xlock_hard+0x1ee _sx_xlock() at _sx_xlock+0x4e rrw_enter() at rrw_enter+0xa4 zfs_freebsd_getattr() at zfs_freebsd_getattr+0x9d filt_vfsread() at filt_vfsread+_0x5e knote() at knote+0xc2 VOP_WRITE_APV() at VOP_WRITE_APV+0x109 vn_write() at vn_write+0x240 dofilewrite() at dofilewrite+0x85 kern_writev() at kern_writev+0x4c writev() at writev+0x41 syscall() at syscall+0x1f0 Xfast_syscall() at Xfast_syscall+0xab --- syscall (121, FreeBSD ELF64, writev), rip = 0x80081490c, rsp = 0x7fffffffccb8, rbp = 0 --- panic: sleeping thread cpuid = 4 From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 20:56:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1C2521065670; Fri, 25 Sep 2009 20:56:32 +0000 (UTC) Date: Fri, 25 Sep 2009 20:56:32 +0000 From: Alexey Dokuchaev To: Ed Schouten Message-ID: <20090925205631.GA99527@FreeBSD.org> References: <200909251158.n8PBwpbI028049@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200909251158.n8PBwpbI028049@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197480 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 20:56:32 -0000 On Fri, Sep 25, 2009 at 11:58:51AM +0000, Ed Schouten wrote: > Author: ed > Date: Fri Sep 25 11:58:51 2009 > New Revision: 197480 > URL: http://svn.freebsd.org/changeset/base/197480 > > Log: > Conformance: ignore {delete,insert} line while outside the scrolling region. > > I noticed a small inconsistency in delete and insert line between xterm > and libteken. libteken allows these actions to happen while the cursor > is placed outside the scrolling region, while xterm does not. > > This behaviour seems to be VT100-like. Confirmation: > > http://www.vt100.net/docs/vt102-ug/chapter5.html > "This sequence is ignored when cursor is outside scrolling region." You could have probably mention canonical document name and chapter/paragraph number in comments as well (refering to standards seems quite appropriate and just looks good in code). ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 21:03:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9360E1065672 for ; Fri, 25 Sep 2009 21:03:10 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id D61938FC18 for ; Fri, 25 Sep 2009 21:03:09 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 867D245685; Fri, 25 Sep 2009 23:03:08 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6EA0245683; Fri, 25 Sep 2009 23:03:03 +0200 (CEST) Date: Fri, 25 Sep 2009 23:03:06 +0200 From: Pawel Jakub Dawidek To: Adam McDougall Message-ID: <20090925210305.GB1597@garage.freebsd.pl> References: <200908170923.n7H9NR7t056904@svn.freebsd.org> <4ABD247D.40201@egr.msu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: <4ABD247D.40201@egr.msu.edu> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r196300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 21:03:10 -0000 --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 25, 2009 at 04:13:49PM -0400, Adam McDougall wrote: > Pawel Jakub Dawidek wrote: > >Author: pjd > >Date: Mon Aug 17 09:23:27 2009 > >New Revision: 196300 > >URL: http://svn.freebsd.org/changeset/base/196300 > > > >Log: > > MFC r196299: > > =20 > > - We need to recycle vnode instead of freeing znode. > > =20 > > Submitted by: avg > > =20 > > - Add missing vnode interlock unlock. > > - Remove redundant znode locking. > > =20 > > Approved by: re (kib) > > >=20 > Two quick questions: >=20 > - Do you think this fix would improve or fix the panic below? > (transcribed by hand since it did not dump and I only have a > screenshot) > - Are the many misc ZFS fixes that went into 9.0 and 8.0 going to > be MFC'ed to 7-stable sometime, including the one above? I have > lucked out pretty well so far since May. At this point I'm not going to MFC them into stable/7, although marck@ seems to be interested in doing it. > Sleeping thread (tid 100161), pid 919) owns a non-sleepable lock > sched_switch() at sched_switch+0x1fe > mi_switch() at mi_switch+0x18e > sleepq_wait() at sleepq_wait+0x3b > _sx_xlock_hard() at _sx_xlock_hard+0x1ee > _sx_xlock() at _sx_xlock+0x4e > rrw_enter() at rrw_enter+0xa4 > zfs_freebsd_getattr() at zfs_freebsd_getattr+0x9d > filt_vfsread() at filt_vfsread+_0x5e > knote() at knote+0xc2 It looks like kqueue is calling into ZFS with mutex held, which is bad... No, this bug is not fixed. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --2B/JsCI69OhZNC5r Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKvTAJForvXbEpPzQRAn6sAKD0O14wAuQRFaIsIByTJ323Y9dLhACgtAlU 20C/i8lor84jqMQ3uSWQDUE= =wTwg -----END PGP SIGNATURE----- --2B/JsCI69OhZNC5r-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 21:43:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 814A9106566B for ; Fri, 25 Sep 2009 21:43:28 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id C57408FC08 for ; Fri, 25 Sep 2009 21:43:27 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 1F4EC45CBA; Fri, 25 Sep 2009 23:43:26 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id DF31A45C9B; Fri, 25 Sep 2009 23:43:20 +0200 (CEST) Date: Fri, 25 Sep 2009 23:43:23 +0200 From: Pawel Jakub Dawidek To: Adam McDougall Message-ID: <20090925214323.GC1597@garage.freebsd.pl> References: <200908170923.n7H9NR7t056904@svn.freebsd.org> <4ABD247D.40201@egr.msu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OBd5C1Lgu00Gd/Tn" Content-Disposition: inline In-Reply-To: <4ABD247D.40201@egr.msu.edu> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r196300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 21:43:28 -0000 --OBd5C1Lgu00Gd/Tn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 25, 2009 at 04:13:49PM -0400, Adam McDougall wrote: > Pawel Jakub Dawidek wrote: > >Author: pjd > >Date: Mon Aug 17 09:23:27 2009 > >New Revision: 196300 > >URL: http://svn.freebsd.org/changeset/base/196300 > > > >Log: > > MFC r196299: > > =20 > > - We need to recycle vnode instead of freeing znode. > > =20 > > Submitted by: avg > > =20 > > - Add missing vnode interlock unlock. > > - Remove redundant znode locking. > > =20 > > Approved by: re (kib) > > >=20 > Two quick questions: >=20 > - Do you think this fix would improve or fix the panic below? > (transcribed by hand since it did not dump and I only have a > screenshot) [...] > Sleeping thread (tid 100161), pid 919) owns a non-sleepable lock > sched_switch() at sched_switch+0x1fe > mi_switch() at mi_switch+0x18e > sleepq_wait() at sleepq_wait+0x3b > _sx_xlock_hard() at _sx_xlock_hard+0x1ee > _sx_xlock() at _sx_xlock+0x4e > rrw_enter() at rrw_enter+0xa4 > zfs_freebsd_getattr() at zfs_freebsd_getattr+0x9d > filt_vfsread() at filt_vfsread+_0x5e > knote() at knote+0xc2 > VOP_WRITE_APV() at VOP_WRITE_APV+0x109 > vn_write() at vn_write+0x240 > dofilewrite() at dofilewrite+0x85 > kern_writev() at kern_writev+0x4c > writev() at writev+0x41 > syscall() at syscall+0x1f0 > Xfast_syscall() at Xfast_syscall+0xab > --- syscall (121, FreeBSD ELF64, writev), rip =3D 0x80081490c, rsp =3D=20 > 0x7fffffffccb8, rbp =3D 0 --- > panic: sleeping thread > cpuid =3D 4 I've just been told, that this should be fixed already by r193951 and r195148. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --OBd5C1Lgu00Gd/Tn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKvTl7ForvXbEpPzQRAkbwAJwMaaC0/T4vjYYHM3WrvGxD2AUEgACg3ZA3 e6ifOpUlJhqcsdKTPpKYZsg= =ExXi -----END PGP SIGNATURE----- --OBd5C1Lgu00Gd/Tn-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 22:09:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82689106566C; Fri, 25 Sep 2009 22:09:05 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mx.egr.msu.edu (surfnturf.egr.msu.edu [35.9.37.164]) by mx1.freebsd.org (Postfix) with ESMTP id 23C0C8FC14; Fri, 25 Sep 2009 22:09:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.egr.msu.edu (Postfix) with ESMTP id 9AC469BB7F; Fri, 25 Sep 2009 18:09:04 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mx.egr.msu.edu ([127.0.0.1]) by localhost (surfnturf.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dU0c7YLlrIPm; Fri, 25 Sep 2009 18:09:04 -0400 (EDT) Received: from [35.9.132.20] (cal001.dhcp.egr.msu.edu [35.9.132.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mcdouga9) by mx.egr.msu.edu (Postfix) with ESMTPSA id 7407C9BB7C; Fri, 25 Sep 2009 18:09:04 -0400 (EDT) Message-ID: <4ABD3F80.6020009@egr.msu.edu> Date: Fri, 25 Sep 2009 18:09:04 -0400 From: Adam McDougall User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200908170923.n7H9NR7t056904@svn.freebsd.org> <4ABD247D.40201@egr.msu.edu> <20090925214323.GC1597@garage.freebsd.pl> In-Reply-To: <20090925214323.GC1597@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r196300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 22:09:05 -0000 Pawel Jakub Dawidek wrote: >> panic: sleeping thread >> cpuid = 4 > > I've just been told, that this should be fixed already by r193951 and > r195148. > (much of previous email removed) I hunted for MFCs and found r195586 which was to 7-STABLE (after the date of the kernel that crashed) but I can't tell that r193951 is in anything except HEAD and there was mentioned of it causing struct vnet changes which may have been why. Do you think r195586 will be a sufficient fix in 7? Thanks. From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 22:20:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE4511065670; Fri, 25 Sep 2009 22:20:30 +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 DD08E8FC19; Fri, 25 Sep 2009 22:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PMKUJU041293; Fri, 25 Sep 2009 22:20:30 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PMKUnE041291; Fri, 25 Sep 2009 22:20:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200909252220.n8PMKUnE041291@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 25 Sep 2009 22:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197506 - head/libexec/rpc.rquotad X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 22:20:31 -0000 Author: des Date: Fri Sep 25 22:20:30 2009 New Revision: 197506 URL: http://svn.freebsd.org/changeset/base/197506 Log: Slight style cleanup. Modified: head/libexec/rpc.rquotad/rquotad.c Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Fri Sep 25 20:08:53 2009 (r197505) +++ head/libexec/rpc.rquotad/rquotad.c Fri Sep 25 22:20:30 2009 (r197506) @@ -56,8 +56,8 @@ static void cleanup(int sig) { - (void) sig; - (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); + (void)sig; + (void)rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); exit(0); } @@ -70,18 +70,17 @@ main(void) socklen_t fromlen; fromlen = sizeof(from); - if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) { + if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) from_inetd = 0; - } if (!from_inetd) { daemon(0, 0); - (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); + (void)rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); - (void) signal(SIGINT, cleanup); - (void) signal(SIGTERM, cleanup); - (void) signal(SIGHUP, cleanup); + (void)signal(SIGINT, cleanup); + (void)signal(SIGTERM, cleanup); + (void)signal(SIGHUP, cleanup); } openlog("rpc.rquotad", LOG_CONS|LOG_PID, LOG_DAEMON); @@ -94,10 +93,11 @@ main(void) exit(1); } ok = svc_reg(transp, RQUOTAPROG, RQUOTAVERS, - rquota_service, NULL); - } else + rquota_service, NULL); + } else { ok = svc_create(rquota_service, - RQUOTAPROG, RQUOTAVERS, "udp"); + RQUOTAPROG, RQUOTAVERS, "udp"); + } if (!ok) { syslog(LOG_ERR, "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", @@ -142,7 +142,7 @@ sendquota(struct svc_req *request, SVCXP struct dqblk dqblk; struct timeval timev; - bzero((char *)&getq_args, sizeof(getq_args)); + bzero(&getq_args, sizeof(getq_args)); if (!svc_getargs(transp, (xdrproc_t)xdr_getquota_args, &getq_args)) { svcerr_decode(transp); return; @@ -195,7 +195,7 @@ printerr_reply(SVCXPRT *transp) /* when caller = (struct sockaddr *)svc_getrpccaller(transp)->buf; getnameinfo(caller, caller->sa_len, name, sizeof (name), - NULL, 0, NI_NUMERICHOST); + NULL, 0, NI_NUMERICHOST); errno = save_errno; if (errno == 0) syslog(LOG_ERR, "couldn't send reply to %s", name); @@ -220,15 +220,13 @@ initfs(void) if (!hasquota(fs, &qfpathname)) continue; - fs_current = (struct fs_stat *) malloc(sizeof(struct fs_stat)); + fs_current = malloc(sizeof(struct fs_stat)); fs_current->fs_next = fs_next; /* next element */ - fs_current->fs_file = - malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); + fs_current->fs_file = malloc(strlen(fs->fs_file) + 1); strcpy(fs_current->fs_file, fs->fs_file); - fs_current->qfpathname = - malloc(sizeof(char) * (strlen(qfpathname) + 1)); + fs_current->qfpathname = malloc(strlen(qfpathname) + 1); strcpy(fs_current->qfpathname, qfpathname); stat(fs_current->fs_file, &st); From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 23:03:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E37A106566B; Fri, 25 Sep 2009 23:03:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D02D8FC08; Fri, 25 Sep 2009 23:03:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PN3OxX042151; Fri, 25 Sep 2009 23:03:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PN3OUN042149; Fri, 25 Sep 2009 23:03:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200909252303.n8PN3OUN042149@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 25 Sep 2009 23:03: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: r197508 - head/libexec/rpc.rquotad X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 23:03:25 -0000 Author: des Date: Fri Sep 25 23:03:24 2009 New Revision: 197508 URL: http://svn.freebsd.org/changeset/base/197508 Log: Other minor style issues. Modified: head/libexec/rpc.rquotad/rquotad.c Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Fri Sep 25 22:45:59 2009 (r197507) +++ head/libexec/rpc.rquotad/rquotad.c Fri Sep 25 23:03:24 2009 (r197508) @@ -175,9 +175,8 @@ sendquota(struct svc_req *request, SVCXP getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft = dqblk.dqb_itime - timev.tv_sec; } - if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, &getq_rslt)) { + if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, &getq_rslt)) svcerr_systemerr(transp); - } if (!svc_freeargs(transp, (xdrproc_t)xdr_getquota_args, &getq_args)) { syslog(LOG_ERR, "unable to free arguments"); exit(1); @@ -189,10 +188,9 @@ printerr_reply(SVCXPRT *transp) /* when { char name[INET6_ADDRSTRLEN]; struct sockaddr *caller; - int save_errno; + int save_errno; save_errno = errno; - caller = (struct sockaddr *)svc_getrpccaller(transp)->buf; getnameinfo(caller, caller->sa_len, name, sizeof (name), NULL, 0, NI_NUMERICHOST); @@ -255,7 +253,7 @@ getfsquota(long id, char *path, struct d qcmd = QCMD(Q_GETQUOTA, USRQUOTA); for (fs = fs_begin; fs != NULL; fs = fs->fs_next) { - /* where the devise is the same as path */ + /* where the device is the same as path */ if (fs->st_dev != st_path.st_dev) continue; From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 23:14:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B256106566C; Fri, 25 Sep 2009 23:14:44 +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 57D0D8FC18; Fri, 25 Sep 2009 23:14:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PNEiP5042411; Fri, 25 Sep 2009 23:14:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PNEifH042410; Fri, 25 Sep 2009 23:14:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200909252314.n8PNEifH042410@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 25 Sep 2009 23:14: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: r197509 - head/tools/regression/usr.bin/sed/regress.multitest.out X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 23:14:44 -0000 Author: des Date: Fri Sep 25 23:14:43 2009 New Revision: 197509 URL: http://svn.freebsd.org/changeset/base/197509 Log: Wipe out mergeinfo. Modified: head/tools/regression/usr.bin/sed/regress.multitest.out/1.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.10 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.11 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.12 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.13 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.14 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.15 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.16 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.17 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.18 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.4.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/1.9 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.10 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.11 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.12 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.13 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.14 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.15 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.16 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.17 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.18 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.19 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.20 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.21 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.22 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/2.9 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/3.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/3.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/3.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/3.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/4.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/5.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/6.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/6.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/6.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/6.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/6.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/6.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/7.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.10 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.11 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.12 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.13 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.14 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.15 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.16 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.17 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/8.9 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.1 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.10 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.11 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.12 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.13 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.14 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.15 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.16 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.17 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.18 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.19 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.2 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.20 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.21 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.22 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.23 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.24 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.25 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.26 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.27 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.28 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.29 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.3 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.30 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.31 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.4 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.5 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.6 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.7 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.8 (props changed) head/tools/regression/usr.bin/sed/regress.multitest.out/9.9 (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 00:04:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A276E106566B; Sat, 26 Sep 2009 00:04:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90F528FC08; Sat, 26 Sep 2009 00:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8Q04Uaa043388; Sat, 26 Sep 2009 00:04:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8Q04UPX043386; Sat, 26 Sep 2009 00:04:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909260004.n8Q04UPX043386@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Sep 2009 00:04: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: r197512 - head/sys/cddl/contrib/opensolaris/uts/common/fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 00:04:30 -0000 Author: pjd Date: Sat Sep 26 00:04:30 2009 New Revision: 197512 URL: http://svn.freebsd.org/changeset/base/197512 Log: - Don't depend on value returned by gfs_*_inactive(), it doesn't work well with forced unmounts when GFS vnodes are referenced. - Make other preparations to GFS for forced unmounts. PR: kern/139062 Reported by: trasz MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Fri Sep 25 23:28:57 2009 (r197511) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Sep 26 00:04:30 2009 (r197512) @@ -595,7 +595,6 @@ found: if (vp->v_flag & V_XATTRDIR) VI_LOCK(fp->gfs_parent); VI_LOCK(vp); - ASSERT(vp->v_count < 2); /* * Really remove this vnode */ @@ -607,12 +606,7 @@ found: */ ge->gfse_vnode = NULL; } - if (vp->v_count == 1) { - vp->v_usecount--; - vdropl(vp); - } else { - VI_UNLOCK(vp); - } + VI_UNLOCK(vp); /* * Free vnode and release parent @@ -1084,18 +1078,16 @@ gfs_vop_inactive(ap) { vnode_t *vp = ap->a_vp; gfs_file_t *fp = vp->v_data; - void *data; if (fp->gfs_type == GFS_DIR) - data = gfs_dir_inactive(vp); + gfs_dir_inactive(vp); else - data = gfs_file_inactive(vp); - - if (data != NULL) - kmem_free(data, fp->gfs_size); + gfs_file_inactive(vp); VI_LOCK(vp); vp->v_data = NULL; VI_UNLOCK(vp); + kmem_free(fp, fp->gfs_size); + return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 00:07:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E1CF1065679; Sat, 26 Sep 2009 00:07:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F10158FC2B; Sat, 26 Sep 2009 00:07:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8Q07E7Y043470; Sat, 26 Sep 2009 00:07:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8Q07EVU043468; Sat, 26 Sep 2009 00:07:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909260007.n8Q07EVU043468@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Sep 2009 00:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197513 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 00:07:15 -0000 Author: pjd Date: Sat Sep 26 00:07:14 2009 New Revision: 197513 URL: http://svn.freebsd.org/changeset/base/197513 Log: Use traverse() function to find and return mount point's vnode instead of covered vnode when snapshot is already mounted. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Sep 26 00:04:30 2009 (r197512) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Sep 26 00:07:14 2009 (r197513) @@ -818,7 +818,11 @@ zfsctl_snapdir_lookup(ap) if ((sep = avl_find(&sdp->sd_snaps, &search, &where)) != NULL) { *vpp = sep->se_root; VN_HOLD(*vpp); - if ((*vpp)->v_mountedhere == NULL) { + err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY); + if (err) { + VN_RELE(*vpp); + *vpp = NULL; + } else if (*vpp == sep->se_root) { /* * The snapshot was unmounted behind our backs, * try to remount it. @@ -832,10 +836,9 @@ zfsctl_snapdir_lookup(ap) */ (*vpp)->v_flag &= ~VROOT; } - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); - return (0); + return (err); } /* From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 00:08:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB381106566C; Sat, 26 Sep 2009 00:08:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9F7D8FC15; Sat, 26 Sep 2009 00:08:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8Q08iV1043528; Sat, 26 Sep 2009 00:08:44 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8Q08iMJ043526; Sat, 26 Sep 2009 00:08:44 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909260008.n8Q08iMJ043526@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Sep 2009 00:08: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: r197514 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 00:08:44 -0000 Author: pjd Date: Sat Sep 26 00:08:44 2009 New Revision: 197514 URL: http://svn.freebsd.org/changeset/base/197514 Log: On lookup error VFS expects *vpp to be set to NULL, be sure to do that. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Sep 26 00:07:14 2009 (r197513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Sep 26 00:08:44 2009 (r197514) @@ -898,6 +898,8 @@ domount: } mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); + if (err != 0) + *vpp = NULL; return (err); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 00:10:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB6E106568B; Sat, 26 Sep 2009 00:10:45 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC678FC19; Sat, 26 Sep 2009 00:10:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8Q0Ajcm043602; Sat, 26 Sep 2009 00:10:45 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8Q0AjkT043599; Sat, 26 Sep 2009 00:10:45 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909260010.n8Q0AjkT043599@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Sep 2009 00:10: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: r197515 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 00:10:45 -0000 Author: pjd Date: Sat Sep 26 00:10:45 2009 New Revision: 197515 URL: http://svn.freebsd.org/changeset/base/197515 Log: Handle cases where virtual (GFS) vnodes are referenced when doing forced unmount. In that case we cannot depend on the proper order of invalidating vnodes, so we have to free resources when we have a chance. PR: kern/139062 Reported by: trasz MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Sep 26 00:08:44 2009 (r197514) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Sep 26 00:10:45 2009 (r197515) @@ -1007,15 +1007,24 @@ zfsctl_snapdir_inactive(ap) { vnode_t *vp = ap->a_vp; zfsctl_snapdir_t *sdp = vp->v_data; - void *private; + zfs_snapentry_t *sep; - private = gfs_dir_inactive(vp); - if (private != NULL) { - ASSERT(avl_numnodes(&sdp->sd_snaps) == 0); - mutex_destroy(&sdp->sd_lock); - avl_destroy(&sdp->sd_snaps); - kmem_free(private, sizeof (zfsctl_snapdir_t)); + /* + * On forced unmount we have to free snapshots from here. + */ + mutex_enter(&sdp->sd_lock); + while ((sep = avl_first(&sdp->sd_snaps)) != NULL) { + avl_remove(&sdp->sd_snaps, sep); + kmem_free(sep->se_name, strlen(sep->se_name) + 1); + kmem_free(sep, sizeof (zfs_snapentry_t)); } + mutex_exit(&sdp->sd_lock); + gfs_dir_inactive(vp); + ASSERT(avl_numnodes(&sdp->sd_snaps) == 0); + mutex_destroy(&sdp->sd_lock); + avl_destroy(&sdp->sd_snaps); + kmem_free(sdp, sizeof (zfsctl_snapdir_t)); + return (0); } @@ -1073,6 +1082,9 @@ zfsctl_snapshot_inactive(ap) int locked; vnode_t *dvp; + if (vp->v_count > 0) + goto end; + VERIFY(gfs_dir_lookup(vp, "..", &dvp, cr, 0, NULL, NULL) == 0); sdp = dvp->v_data; VOP_UNLOCK(dvp, 0); @@ -1080,11 +1092,6 @@ zfsctl_snapshot_inactive(ap) if (!(locked = MUTEX_HELD(&sdp->sd_lock))) mutex_enter(&sdp->sd_lock); - if (vp->v_count > 1) { - if (!locked) - mutex_exit(&sdp->sd_lock); - return (0); - } ASSERT(!vn_ismntpt(vp)); sep = avl_first(&sdp->sd_snaps); @@ -1104,6 +1111,7 @@ zfsctl_snapshot_inactive(ap) if (!locked) mutex_exit(&sdp->sd_lock); VN_RELE(dvp); +end: VFS_RELE(vp->v_vfsp); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Sep 26 00:08:44 2009 (r197514) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Sep 26 00:10:45 2009 (r197515) @@ -1107,8 +1107,7 @@ zfs_umount(vfs_t *vfsp, int fflag) if (zfsvfs->z_issnap) { vnode_t *svp = vfsp->mnt_vnodecovered; - ASSERT(svp->v_count == 2 || svp->v_count == 1); - if (svp->v_count == 2) + if (svp->v_count >= 2) VN_RELE(svp); } zfs_freevfs(vfsp); From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 11:31:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5908106566B; Sat, 26 Sep 2009 11:31:25 +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 AA63C8FC12; Sat, 26 Sep 2009 11:31:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QBVPss057956; Sat, 26 Sep 2009 11:31:25 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QBVPhU057955; Sat, 26 Sep 2009 11:31:25 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200909261131.n8QBVPhU057955@svn.freebsd.org> From: Max Laier Date: Sat, 26 Sep 2009 11:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197516 - in stable/7/sys: . conf contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 11:31:25 -0000 Author: mlaier Date: Sat Sep 26 11:31:25 2009 New Revision: 197516 URL: http://svn.freebsd.org/changeset/base/197516 Log: MFC r197334,r197433: Extract svn and git version info from git-svn repos. Modified: stable/7/sys/ (props changed) stable/7/sys/conf/newvers.sh stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Sat Sep 26 00:10:45 2009 (r197515) +++ stable/7/sys/conf/newvers.sh Sat Sep 26 11:31:25 2009 (r197516) @@ -89,28 +89,54 @@ i=`${MAKE:-make} -V KERN_IDENT` case "$d" in */sys/*) + SRCDIR=${d##*obj} + if [ -n "$MACHINE" ]; then + SRCDIR=${SRCDIR##/$MACHINE} + fi + SRCDIR=${SRCDIR%%/sys/*} + for dir in /bin /usr/bin /usr/local/bin; do - if [ -x "${dir}/svnversion" ]; then + if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then svnversion=${dir}/svnversion - SRCDIR=${d##*obj} - if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE} - fi - SRCDIR=${SRCDIR%%/sys/*} + break + fi + if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" break fi done - if [ -n "$svnversion" -a -d "${SRCDIR}/sys/.svn" ] ; then + if [ -n "$svnversion" ] ; then svn=" r`cd ${SRCDIR}/sys && $svnversion`" fi + if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="=${git}" + else + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then + svn=" r${svn}" + git="+${git}" + else + git=" ${git}" + fi + fi + if $git_cmd --work-tree=${SRCDIR} diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi + fi ;; esac cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}: ${t}" +#define VERSTR "${VERSION} #${v}${svn}${git}: ${t}\\n ${u}@${h}:${d}\\n" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 11:44:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410B61065672; Sat, 26 Sep 2009 11:44:05 +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 15E428FC0C; Sat, 26 Sep 2009 11:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QBi4AP058311; Sat, 26 Sep 2009 11:44:04 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QBi4Fo058309; Sat, 26 Sep 2009 11:44:04 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200909261144.n8QBi4Fo058309@svn.freebsd.org> From: Max Laier Date: Sat, 26 Sep 2009 11:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197517 - in stable/6/sys: . conf contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 11:44:05 -0000 Author: mlaier Date: Sat Sep 26 11:44:04 2009 New Revision: 197517 URL: http://svn.freebsd.org/changeset/base/197517 Log: MFC r197334,r197433: Extract svn and git version info from git-svn repos. Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/conf/newvers.sh stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/conf/newvers.sh ============================================================================== --- stable/6/sys/conf/newvers.sh Sat Sep 26 11:31:25 2009 (r197516) +++ stable/6/sys/conf/newvers.sh Sat Sep 26 11:44:04 2009 (r197517) @@ -89,25 +89,56 @@ i=`${MAKE:-make} -V KERN_IDENT` case "$d" in */sys/*) + SRCDIR=${d##*obj} + if [ -n "$MACHINE" ]; then + if [ -n "$MACHINE" ]; then + SRCDIR=${SRCDIR##/$MACHINE} + fi + fi + SRCDIR=${SRCDIR%%/sys/*} + for dir in /bin /usr/bin /usr/local/bin; do - if [ -x "${dir}/svnversion" ]; then + if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then svnversion=${dir}/svnversion - SRCDIR=${d##*obj} - SRCDIR=${SRCDIR%%/sys/*} + break + fi + if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" break fi done - if [ -n "$svnversion" -a -d "${SRCDIR}/sys/.svn" ] ; then + if [ -n "$svnversion" ] ; then svn=" r`cd ${SRCDIR}/sys && $svnversion`" fi + if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="=${git}" + else + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then + svn=" r${svn}" + git="+${git}" + else + git=" ${git}" + fi + fi + if $git_cmd --work-tree=${SRCDIR} diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi + fi ;; esac cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}: ${t}" +#define VERSTR "${VERSION} #${v}${svn}${git}: ${t}\\n ${u}@${h}:${d}\\n" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 12:45:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9C51065670; Sat, 26 Sep 2009 12:45:28 +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 660048FC1A; Sat, 26 Sep 2009 12:45:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QCjSJo059400; Sat, 26 Sep 2009 12:45:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QCjSiM059385; Sat, 26 Sep 2009 12:45:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200909261245.n8QCjSiM059385@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 Sep 2009 12:45: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: r197518 - in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/lindev sys/i386/conf sys/modules sys/modules/lindev sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 12:45:29 -0000 Author: bz Date: Sat Sep 26 12:45:28 2009 New Revision: 197518 URL: http://svn.freebsd.org/changeset/base/197518 Log: lindev(4) [1] is supposed to be a collection of linux-specific pseudo devices that we also support, just not by default (thus only LINT or module builds by default). While currently there is only "/dev/full" [2], we are planning to see more in the future. We may decide to change the module/dependency logic in the future should the list grow too long. This is not part of linux.ko as also non-linux binaries like kFreeBSD userland or ports can make use of this as well. Suggested by: rwatson [1] (name) Submitted by: ed [2] Discussed with: markm, ed, rwatson, kib (weeks ago) Reviewed by: rwatson, brueffer (prev. version) PR: kern/68961 MFC after: 6 weeks Added: head/share/man/man4/lindev.4 (contents, props changed) head/sys/dev/lindev/ head/sys/dev/lindev/full.c (contents, props changed) head/sys/dev/lindev/lindev.c (contents, props changed) head/sys/dev/lindev/lindev.h (contents, props changed) head/sys/modules/lindev/ head/sys/modules/lindev/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/conf/NOTES head/sys/modules/Makefile head/sys/pc98/conf/NOTES Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Sep 26 11:44:04 2009 (r197517) +++ head/share/man/man4/Makefile Sat Sep 26 12:45:28 2009 (r197518) @@ -173,6 +173,7 @@ MAN= aac.4 \ le.4 \ led.4 \ lge.4 \ + ${_lindev.4} \ ${_linux.4} \ lmc.4 \ lo.4 \ @@ -625,6 +626,7 @@ _if_urtw.4= if_urtw.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 +_lindev.4= lindev.4 _linux.4= linux.4 _ndis.4= ndis.4 _nfe.4= nfe.4 @@ -636,6 +638,8 @@ _speaker.4= speaker.4 _spkr.4= spkr.4 _urtw.4= urtw.4 _wpi.4= wpi.4 + +MLINKS+=lindev.4 full.4 .endif .if exists(${.CURDIR}/man4.${MACHINE_ARCH}) Added: head/share/man/man4/lindev.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/lindev.4 Sat Sep 26 12:45:28 2009 (r197518) @@ -0,0 +1,73 @@ +.\"- +.\" Copyright (c) 2009 "Bjoern A. Zeeb" +.\" 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 September 26, 2009 +.Dt LINDEV 4 +.Os +.Sh NAME +.Nm lindev +.Nd the lindev module +.Sh SYNOPSIS +To compile this collection of linux-specific pseudo devices into the kernel, +place the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device lindev" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +lindev_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +module provides a collection of linux-specific pseudo devices. +.Sh DEVICES +.Bl -tag -width /dev/full +.It Pa /dev/full +The +.Xr full +device always returns +.Er ENOSPC +on write attempts. +For reads it emulates +.Xr zero 4 . +.El +.Sh FILES +.Bl -tag -width /dev/full +.It Pa /dev/full +.El +.Sh SEE ALSO +.Xr null 4 , +.Xr zero 4 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 9.0 . Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/amd64/conf/NOTES Sat Sep 26 12:45:28 2009 (r197518) @@ -517,3 +517,6 @@ options VM_KMEM_SIZE_SCALE # Enable NDIS binary driver support options NDISAPI device ndis + +# Linux-specific pseudo devices support +device lindev Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/boot/forth/loader.conf Sat Sep 26 12:45:28 2009 (r197518) @@ -179,6 +179,7 @@ screensave_name="green_saver" # Set to t ibcs2_load="NO" # IBCS2 (SCO) emulation ibcs2_coff_load="NO" linux_load="NO" # Linux emulation +lindev_load="NO" # Linux-specific pseudo devices (see lindev(4)) svr4_load="NO" # SystemV R4 emulation streams_load="NO" # System V streams module Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/conf/files.amd64 Sat Sep 26 12:45:28 2009 (r197518) @@ -208,6 +208,8 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/conf/files.i386 Sat Sep 26 12:45:28 2009 (r197518) @@ -201,6 +201,8 @@ dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/le/if_le_isa.c optional le isa +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/conf/files.pc98 Sat Sep 26 12:45:28 2009 (r197518) @@ -107,6 +107,8 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd | sc | ukbd | usb2_input_kbd dev/le/if_le_cbus.c optional le isa +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa Added: head/sys/dev/lindev/full.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/lindev/full.c Sat Sep 26 12:45:28 2009 (r197518) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +static struct cdev *full_dev; + +static d_read_t full_read; +static d_write_t full_write; + +static struct cdevsw full_cdevsw = { + .d_version = D_VERSION, + .d_read = full_read, + .d_write = full_write, + .d_name = "full", +}; + +static void *zbuf; + +/* ARGSUSED */ +static int +full_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) +{ + int error = 0; + + while (uio->uio_resid > 0 && error == 0) + error = uiomove(zbuf, MIN(uio->uio_resid, PAGE_SIZE), uio); + + return (error); +} + +/* ARGSUSED */ +static int +full_write(struct cdev *dev __unused, struct uio *uio __unused, + int flags __unused) +{ + + return (ENOSPC); +} + +/* ARGSUSED */ +int +lindev_modevent_full(module_t mod __unused, int type, void *data __unused) +{ + + switch(type) { + case MOD_LOAD: + zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); + full_dev = make_dev(&full_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0666, "full"); + if (bootverbose) + printf("full: \n"); + break; + + case MOD_UNLOAD: + destroy_dev(full_dev); + free(zbuf, M_TEMP); + break; + + case MOD_SHUTDOWN: + break; + + default: + return (EOPNOTSUPP); + } + + return (0); +} + Added: head/sys/dev/lindev/lindev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/lindev/lindev.c Sat Sep 26 12:45:28 2009 (r197518) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2009 "Bjoern A. Zeeb" + * 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. + */ + +/* + * "lindev" is supposed to be a collection of linux-specific devices + * that we also support, just not by default. + * While currently there is only "/dev/full", we are planning to see + * more in the future. + * This file is only the container to load/unload all supported devices; + * the implementation of each should go into its own file. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +/* ARGSUSED */ +static int +lindev_modevent(module_t mod, int type, void *data) +{ + int error; + + switch(type) { + case MOD_LOAD: + error = lindev_modevent_full(mod, type, data); + break; + + case MOD_UNLOAD: + error = lindev_modevent_full(mod, type, data); + break; + + case MOD_SHUTDOWN: + error = lindev_modevent_full(mod, type, data); + break; + + default: + return (EOPNOTSUPP); + } + + return (error); +} + +DEV_MODULE(lindev, lindev_modevent, NULL); +MODULE_VERSION(lindev, 1); Added: head/sys/dev/lindev/lindev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/lindev/lindev.h Sat Sep 26 12:45:28 2009 (r197518) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2009 "Bjoern A. Zeeb" + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_LINDEV_LINDEV_H +#define _DEV_LINDEV_LINDEV_H + +int lindev_modevent_full(module_t, int, void *); + +#endif /* _DEV_LINDEV_LINDEV_H */ Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/i386/conf/NOTES Sat Sep 26 12:45:28 2009 (r197518) @@ -880,6 +880,9 @@ device streams # STREAMS network drive options NDISAPI device ndis +# Linux-specific pseudo devices support +device lindev + ##################################################################### # VM OPTIONS Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/modules/Makefile Sat Sep 26 12:45:28 2009 (r197518) @@ -151,6 +151,7 @@ SUBDIR= ${_3dfx} \ libiconv \ libmbpool \ libmchain \ + ${_lindev} \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ @@ -373,6 +374,7 @@ _ie= ie _if_ndis= if_ndis _igb= igb _io= io +_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux @@ -510,6 +512,7 @@ _ipwfw= ipwfw _iwn= iwn _iwnfw= iwnfw _ixgb= ixgb +_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux Added: head/sys/modules/lindev/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/lindev/Makefile Sat Sep 26 12:45:28 2009 (r197518) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/lindev + +KMOD= lindev +SRCS= full.c lindev.c + +.include Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Sat Sep 26 11:44:04 2009 (r197517) +++ head/sys/pc98/conf/NOTES Sat Sep 26 12:45:28 2009 (r197518) @@ -565,6 +565,9 @@ options COMPAT_SVR4 # build emulator st options DEBUG_SVR4 # enable verbose debugging device streams # STREAMS network driver (required for svr4). +# Linux-specific pseudo devices support +device lindev + ##################################################################### # VM OPTIONS From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 12:47:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70421106566C; Sat, 26 Sep 2009 12:47:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 279F88FC13; Sat, 26 Sep 2009 12:47:01 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id D430741C6B4; Sat, 26 Sep 2009 14:46:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id GBeQEYGSpMAX; Sat, 26 Sep 2009 14:46:59 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 7CFED41C6A7; Sat, 26 Sep 2009 14:46:59 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 939B44448E6; Sat, 26 Sep 2009 12:46:50 +0000 (UTC) Date: Sat, 26 Sep 2009 12:46:50 +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: <200909261245.n8QCjSiM059385@svn.freebsd.org> Message-ID: <20090926124551.R68375@maildrop.int.zabbadoz.net> References: <200909261245.n8QCjSiM059385@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: r197518 - in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/lindev sys/i386/conf sys/modules sys/modules/lindev sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 12:47:01 -0000 On Sat, 26 Sep 2009, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Sep 26 12:45:28 2009 > New Revision: 197518 > URL: http://svn.freebsd.org/changeset/base/197518 > > Log: > lindev(4) [1] is supposed to be a collection of linux-specific pseudo > devices that we also support, just not by default (thus only LINT or > module builds by default). > > While currently there is only "/dev/full" [2], we are planning to see more > in the future. We may decide to change the module/dependency logic in the > future should the list grow too long. > > This is not part of linux.ko as also non-linux binaries like kFreeBSD > userland or ports can make use of this as well. > > Suggested by: rwatson [1] (name) > Submitted by: ed [2] > Discussed with: markm, ed, rwatson, kib (weeks ago) > Reviewed by: rwatson, brueffer (prev. version) > PR: kern/68961 > MFC after: 6 weeks The bikeshed colour shall be light yellow on top of black and white. Please finish the ranting before the MFC date. Thanks! -- Bjoern A. Zeeb What was I talking about and who are you again? From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 15:00:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DE3F1065670; Sat, 26 Sep 2009 15:00:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0A78FC29; Sat, 26 Sep 2009 15:00:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QF0gRr062857; Sat, 26 Sep 2009 15:00:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QF0gvv062855; Sat, 26 Sep 2009 15:00:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909261500.n8QF0gvv062855@svn.freebsd.org> From: Ed Schouten Date: Sat, 26 Sep 2009 15:00: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: r197519 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 15:00:42 -0000 Author: ed Date: Sat Sep 26 15:00:42 2009 New Revision: 197519 URL: http://svn.freebsd.org/changeset/base/197519 Log: Make the fuzzer a bit more useful by forcing 7-bit data into it. Getting valid UTF-8 sequences is quite unlikely, so we'd better just convert data to 7 bits and make it extra likely for escape sequences to occur. Modified: head/sys/teken/teken_stress.c Modified: head/sys/teken/teken_stress.c ============================================================================== --- head/sys/teken/teken_stress.c Sat Sep 26 12:45:28 2009 (r197518) +++ head/sys/teken/teken_stress.c Sat Sep 26 15:00:42 2009 (r197519) @@ -92,13 +92,16 @@ stress_respond(void *s __unused, const v { } +static const char replacement[] = + { 0x1b, '[', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ';' }; + int main(int argc __unused, char *argv[] __unused) { teken_t t; int rnd; - unsigned int iteration = 0; - char buf[2048]; + unsigned int i, iteration = 0; + unsigned char buf[2048]; rnd = open("/dev/urandom", O_RDONLY); if (rnd < 0) { @@ -114,6 +117,12 @@ main(int argc __unused, char *argv[] __u exit(1); } + for (i = 0; i < sizeof buf; i++) { + if (buf[i] >= 0x80) + buf[i] = + replacement[buf[i] % sizeof replacement]; + } + teken_input(&t, buf, sizeof buf); iteration++; From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 15:03:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDA4F106566B; Sat, 26 Sep 2009 15:03:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA308FC15; Sat, 26 Sep 2009 15:03:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QF3gP7062949; Sat, 26 Sep 2009 15:03:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QF3g2r062945; Sat, 26 Sep 2009 15:03:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909261503.n8QF3g2r062945@svn.freebsd.org> From: Ed Schouten Date: Sat, 26 Sep 2009 15:03: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: r197520 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 15:03:43 -0000 Author: ed Date: Sat Sep 26 15:03:42 2009 New Revision: 197520 URL: http://svn.freebsd.org/changeset/base/197520 Log: Get rid of now deprecated SCS wrappers. We always build SCS, even when processing 8-bit data. There is no reason why we should be able to disable it now. Modified: head/sys/teken/teken.c head/sys/teken/teken_scs.h head/sys/teken/teken_subr.h Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Sat Sep 26 15:00:42 2009 (r197519) +++ head/sys/teken/teken.c Sat Sep 26 15:03:42 2009 (r197520) @@ -196,13 +196,13 @@ teken_input_char(teken_t *t, teken_char_ if (t->t_stateflags & TS_CONS25) t->t_nextstate(t, c); else - teken_scs_switch(t, 1); + t->t_curscs = 1; break; case '\x0F': if (t->t_stateflags & TS_CONS25) t->t_nextstate(t, c); else - teken_scs_switch(t, 0); + t->t_curscs = 0; break; case '\r': teken_subr_carriage_return(t); Modified: head/sys/teken/teken_scs.h ============================================================================== --- head/sys/teken/teken_scs.h Sat Sep 26 15:00:42 2009 (r197519) +++ head/sys/teken/teken_scs.h Sat Sep 26 15:03:42 2009 (r197520) @@ -26,35 +26,7 @@ * $FreeBSD$ */ -static void -teken_scs_set(teken_t *t, unsigned int g, teken_scs_t *ts) -{ - - t->t_scs[g] = ts; -} - -static void -teken_scs_switch(teken_t *t, unsigned int g) -{ - - t->t_curscs = g; -} - -static void -teken_scs_restore(teken_t *t) -{ - - t->t_scs[t->t_curscs] = t->t_saved_curscs; -} - -static void -teken_scs_save(teken_t *t) -{ - - t->t_saved_curscs = t->t_scs[t->t_curscs]; -} - -static teken_char_t +static inline teken_char_t teken_scs_process(teken_t *t, teken_char_t c) { Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sat Sep 26 15:00:42 2009 (r197519) +++ head/sys/teken/teken_subr.h Sat Sep 26 15:03:42 2009 (r197520) @@ -540,42 +540,42 @@ static void teken_subr_g0_scs_special_graphics(teken_t *t __unused) { - teken_scs_set(t, 0, teken_scs_special_graphics); + t->t_scs[0] = teken_scs_special_graphics; } static void teken_subr_g0_scs_uk_national(teken_t *t __unused) { - teken_scs_set(t, 0, teken_scs_uk_national); + t->t_scs[0] = teken_scs_uk_national; } static void teken_subr_g0_scs_us_ascii(teken_t *t __unused) { - teken_scs_set(t, 0, teken_scs_us_ascii); + t->t_scs[0] = teken_scs_us_ascii; } static void teken_subr_g1_scs_special_graphics(teken_t *t __unused) { - teken_scs_set(t, 1, teken_scs_special_graphics); + t->t_scs[1] = teken_scs_special_graphics; } static void teken_subr_g1_scs_uk_national(teken_t *t __unused) { - teken_scs_set(t, 1, teken_scs_uk_national); + t->t_scs[1] = teken_scs_uk_national; } static void teken_subr_g1_scs_us_ascii(teken_t *t __unused) { - teken_scs_set(t, 1, teken_scs_us_ascii); + t->t_scs[1] = teken_scs_us_ascii; } static void @@ -962,9 +962,9 @@ teken_subr_do_reset(teken_t *t) t->t_stateflags &= TS_8BIT|TS_CONS25; t->t_stateflags |= TS_AUTOWRAP; - teken_scs_set(t, 0, teken_scs_us_ascii); - teken_scs_set(t, 1, teken_scs_us_ascii); - teken_scs_switch(t, 0); + t->t_scs[0] = teken_scs_us_ascii; + t->t_scs[1] = teken_scs_us_ascii; + t->t_curscs = 0; teken_subr_save_cursor(t); teken_tab_default(t); @@ -986,8 +986,8 @@ teken_subr_restore_cursor(teken_t *t) t->t_cursor = t->t_saved_cursor; t->t_curattr = t->t_saved_curattr; + t->t_scs[t->t_curscs] = t->t_saved_curscs; t->t_stateflags &= ~TS_WRAPPED; - teken_scs_restore(t); teken_funcs_cursor(t); } @@ -1010,7 +1010,7 @@ teken_subr_save_cursor(teken_t *t) t->t_saved_cursor = t->t_cursor; t->t_saved_curattr = t->t_curattr; - teken_scs_save(t); + t->t_saved_curscs = t->t_scs[t->t_curscs]; } static void From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 15:07:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A69106566B; Sat, 26 Sep 2009 15:07:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3DC8FC15; Sat, 26 Sep 2009 15:07:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QF7BGo063061; Sat, 26 Sep 2009 15:07:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QF7BFi063059; Sat, 26 Sep 2009 15:07:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909261507.n8QF7BFi063059@svn.freebsd.org> From: Ed Schouten Date: Sat, 26 Sep 2009 15:07: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: r197521 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 15:07:11 -0000 Author: ed Date: Sat Sep 26 15:07:11 2009 New Revision: 197521 URL: http://svn.freebsd.org/changeset/base/197521 Log: Properly get out of origin mode if the cursor has to move outside of it. In some cases events may occur that move the cursor outside the scrolling region while in origin mode, which is normally not possible. Events like these include: - Alignment test. - Restore cursor. Properly switch off origin mode in these cases. MFC after: 1 month Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sat Sep 26 15:03:42 2009 (r197520) +++ head/sys/teken/teken_subr.h Sat Sep 26 15:07:11 2009 (r197521) @@ -185,11 +185,11 @@ teken_subr_alignment_test(teken_t *t) { teken_rect_t tr; + t->t_cursor.tp_row = t->t_cursor.tp_col = 0; t->t_scrollreg.ts_begin = 0; t->t_scrollreg.ts_end = t->t_winsize.tp_row; - - t->t_cursor.tp_row = t->t_cursor.tp_col = 0; - t->t_stateflags &= ~TS_WRAPPED; + t->t_originreg = t->t_scrollreg; + t->t_stateflags &= ~(TS_WRAPPED|TS_ORIGIN); teken_funcs_cursor(t); tr.tr_begin.tp_row = 0; @@ -988,6 +988,15 @@ teken_subr_restore_cursor(teken_t *t) t->t_curattr = t->t_saved_curattr; t->t_scs[t->t_curscs] = t->t_saved_curscs; t->t_stateflags &= ~TS_WRAPPED; + + /* Get out of origin mode when the cursor is moved outside. */ + if (t->t_cursor.tp_row < t->t_originreg.ts_begin || + t->t_cursor.tp_row >= t->t_originreg.ts_end) { + t->t_stateflags &= ~TS_ORIGIN; + t->t_originreg.ts_begin = 0; + t->t_originreg.ts_end = t->t_winsize.tp_row; + } + teken_funcs_cursor(t); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 15:26:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EFF1065676; Sat, 26 Sep 2009 15:26:33 +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 002938FC20; Sat, 26 Sep 2009 15:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QFQWLS063436; Sat, 26 Sep 2009 15:26:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QFQWVY063429; Sat, 26 Sep 2009 15:26:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909261526.n8QFQWVY063429@svn.freebsd.org> From: Ed Schouten Date: Sat, 26 Sep 2009 15:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197522 - in head/sys: dev/syscons teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 15:26:33 -0000 Author: ed Date: Sat Sep 26 15:26:32 2009 New Revision: 197522 URL: http://svn.freebsd.org/changeset/base/197522 Log: Add 256 color support. It is quite inconvenient that if an application for xterm uses 256 color mode, text suddenly starts to blink (because of ;5; in the middle). We'd better just implement 256 color mode and add a conversion routine from 256 to 8 color mode, which doesn't seem to be too bad in practice. Remapping colors is done quite simple. If one of the channels is most actively represented, primary colors are used. If two channels are most actively represented, secondary colors are used. If all three channels are equal (gray), it picks between black and white. Reported by: Paul B. Mahol Modified: head/sys/dev/syscons/scterm-teken.c head/sys/teken/teken.c head/sys/teken/teken.h head/sys/teken/teken_demo.c head/sys/teken/teken_subr.h head/sys/teken/teken_subr_compat.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sat Sep 26 15:07:11 2009 (r197521) +++ head/sys/dev/syscons/scterm-teken.c Sat Sep 26 15:26:32 2009 (r197522) @@ -313,11 +313,11 @@ scteken_attr(const teken_attr_t *a) teken_color_t fg, bg; if (a->ta_format & TF_REVERSE) { - fg = a->ta_bgcolor; - bg = a->ta_fgcolor; + fg = teken_256to8(a->ta_bgcolor); + bg = teken_256to8(a->ta_fgcolor); } else { - fg = a->ta_fgcolor; - bg = a->ta_bgcolor; + fg = teken_256to8(a->ta_fgcolor); + bg = teken_256to8(a->ta_bgcolor); } if (a->ta_format & TF_BOLD) attr |= fgcolors_bold[fg]; Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Sat Sep 26 15:07:11 2009 (r197521) +++ head/sys/teken/teken.c Sat Sep 26 15:26:32 2009 (r197522) @@ -409,4 +409,55 @@ teken_state_numbers(teken_t *t, teken_ch return (0); } +teken_color_t +teken_256to8(teken_color_t c) +{ + unsigned int r, g, b; + + if (c < 16) { + /* Traditional color indices. */ + return (c % 8); + } else if (c >= 244) { + /* Upper grayscale colors. */ + return (TC_WHITE); + } else if (c >= 232) { + /* Lower grayscale colors. */ + return (TC_BLACK); + } + + /* Convert to RGB. */ + c -= 16; + b = c % 6; + g = (c / 6) % 6; + r = c / 36; + + if (r < g) { + /* Possibly green. */ + if (g < b) + return (TC_BLUE); + else if (g > b) + return (TC_GREEN); + else + return (TC_CYAN); + } else if (r > g) { + /* Possibly red. */ + if (r < b) + return (TC_BLUE); + else if (r > b) + return (TC_RED); + else + return (TC_MAGENTA); + } else { + /* Possibly brown. */ + if (g < b) + return (TC_BLUE); + else if (g > b) + return (TC_BROWN); + else if (r < 3) + return (TC_BLACK); + else + return (TC_WHITE); + } +} + #include "teken_state.h" Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Sat Sep 26 15:07:11 2009 (r197521) +++ head/sys/teken/teken.h Sat Sep 26 15:26:32 2009 (r197522) @@ -171,4 +171,7 @@ void teken_set_winsize(teken_t *, const void teken_set_8bit(teken_t *); void teken_set_cons25(teken_t *); +/* Color conversion. */ +teken_color_t teken_256to8(teken_color_t); + #endif /* !_TEKEN_H_ */ Modified: head/sys/teken/teken_demo.c ============================================================================== --- head/sys/teken/teken_demo.c Sat Sep 26 15:07:11 2009 (r197521) +++ head/sys/teken/teken_demo.c Sat Sep 26 15:26:32 2009 (r197522) @@ -116,7 +116,8 @@ printchar(const teken_pos_t *p) if (px->a.ta_format & TF_REVERSE) attr |= A_REVERSE; - bkgdset(attr | COLOR_PAIR(px->a.ta_fgcolor + 8 * px->a.ta_bgcolor)); + bkgdset(attr | COLOR_PAIR(teken_256to8(px->a.ta_fgcolor) + + 8 * teken_256to8(px->a.ta_bgcolor))); mvaddstr(p->tp_row, p->tp_col, str); move(y, x); Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sat Sep 26 15:07:11 2009 (r197521) +++ head/sys/teken/teken_subr.h Sat Sep 26 15:26:32 2009 (r197522) @@ -1150,6 +1150,12 @@ teken_subr_set_graphic_rendition(teken_t case 37: /* Set foreground color: white */ t->t_curattr.ta_fgcolor = n - 30; break; + case 38: /* Set foreground color: 256 color mode */ + if (i + 2 >= ncmds || cmds[i + 1] != 5) + continue; + t->t_curattr.ta_fgcolor = cmds[i + 2]; + i += 2; + break; case 39: /* Set default foreground color. */ t->t_curattr.ta_fgcolor = t->t_defattr.ta_fgcolor; break; @@ -1163,9 +1169,35 @@ teken_subr_set_graphic_rendition(teken_t case 47: /* Set background color: white */ t->t_curattr.ta_bgcolor = n - 40; break; + case 48: /* Set background color: 256 color mode */ + if (i + 2 >= ncmds || cmds[i + 1] != 5) + continue; + t->t_curattr.ta_bgcolor = cmds[i + 2]; + i += 2; + break; case 49: /* Set default background color. */ t->t_curattr.ta_bgcolor = t->t_defattr.ta_bgcolor; break; + case 90: /* Set bright foreground color: black */ + case 91: /* Set bright foreground color: red */ + case 92: /* Set bright foreground color: green */ + case 93: /* Set bright foreground color: brown */ + case 94: /* Set bright foreground color: blue */ + case 95: /* Set bright foreground color: magenta */ + case 96: /* Set bright foreground color: cyan */ + case 97: /* Set bright foreground color: white */ + t->t_curattr.ta_fgcolor = n - 90 + 8; + break; + case 100: /* Set bright background color: black */ + case 101: /* Set bright background color: red */ + case 102: /* Set bright background color: green */ + case 103: /* Set bright background color: brown */ + case 104: /* Set bright background color: blue */ + case 105: /* Set bright background color: magenta */ + case 106: /* Set bright background color: cyan */ + case 107: /* Set bright background color: white */ + t->t_curattr.ta_bgcolor = n - 100 + 8; + break; default: teken_printf("unsupported attribute %u\n", n); } Modified: head/sys/teken/teken_subr_compat.h ============================================================================== --- head/sys/teken/teken_subr_compat.h Sat Sep 26 15:07:11 2009 (r197521) +++ head/sys/teken/teken_subr_compat.h Sat Sep 26 15:26:32 2009 (r197522) @@ -65,10 +65,10 @@ void teken_get_defattr_cons25(teken_t *t, int *fg, int *bg) { - *fg = cons25_revcolors[t->t_defattr.ta_fgcolor]; + *fg = cons25_revcolors[teken_256to8(t->t_defattr.ta_fgcolor)]; if (t->t_defattr.ta_format & TF_BOLD) *fg += 8; - *bg = cons25_revcolors[t->t_defattr.ta_bgcolor]; + *bg = cons25_revcolors[teken_256to8(t->t_defattr.ta_bgcolor)]; } static void From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 16:37:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7FB106568D; Sat, 26 Sep 2009 16:37:25 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD698FC12; Sat, 26 Sep 2009 16:37:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QGbNqr064763; Sat, 26 Sep 2009 16:37:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QGbNdL064760; Sat, 26 Sep 2009 16:37:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909261637.n8QGbNdL064760@svn.freebsd.org> From: Rui Paulo Date: Sat, 26 Sep 2009 16:37: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: r197523 - in head/sys/arm: arm include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 16:37:25 -0000 Author: rpaulo Date: Sat Sep 26 16:37:23 2009 New Revision: 197523 URL: http://svn.freebsd.org/changeset/base/197523 Log: Promote the cpu_class local variable to global and expose it in md_var.h Reviewed by: freebsd-arm Modified: head/sys/arm/arm/identcpu.c head/sys/arm/include/md_var.h Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Sat Sep 26 15:26:32 2009 (r197522) +++ head/sys/arm/arm/identcpu.c Sat Sep 26 16:37:23 2009 (r197523) @@ -54,30 +54,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include char machine[] = "arm"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); -enum cpu_class { - CPU_CLASS_NONE, - CPU_CLASS_ARM2, - CPU_CLASS_ARM2AS, - CPU_CLASS_ARM3, - CPU_CLASS_ARM6, - CPU_CLASS_ARM7, - CPU_CLASS_ARM7TDMI, - CPU_CLASS_ARM8, - CPU_CLASS_ARM9TDMI, - CPU_CLASS_ARM9ES, - CPU_CLASS_ARM9EJS, - CPU_CLASS_ARM10E, - CPU_CLASS_ARM10EJ, - CPU_CLASS_SA1, - CPU_CLASS_XSCALE, - CPU_CLASS_ARM11J, - CPU_CLASS_MARVELL -}; static const char * const generic_steppings[16] = { "rev 0", "rev 1", "rev 2", "rev 3", @@ -372,11 +354,11 @@ static const char * const wtnames[] = { extern int ctrl; +enum cpu_class cpu_class = CPU_CLASS_NONE; void identify_arm_cpu(void) { u_int cpuid; - enum cpu_class cpu_class = CPU_CLASS_NONE; int i; cpuid = cpu_id(); Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Sat Sep 26 15:26:32 2009 (r197522) +++ head/sys/arm/include/md_var.h Sat Sep 26 16:37:23 2009 (r197523) @@ -48,6 +48,27 @@ extern int _min_bzero_size; #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 +enum cpu_class { + CPU_CLASS_NONE, + CPU_CLASS_ARM2, + CPU_CLASS_ARM2AS, + CPU_CLASS_ARM3, + CPU_CLASS_ARM6, + CPU_CLASS_ARM7, + CPU_CLASS_ARM7TDMI, + CPU_CLASS_ARM8, + CPU_CLASS_ARM9TDMI, + CPU_CLASS_ARM9ES, + CPU_CLASS_ARM9EJS, + CPU_CLASS_ARM10E, + CPU_CLASS_ARM10EJ, + CPU_CLASS_SA1, + CPU_CLASS_XSCALE, + CPU_CLASS_ARM11J, + CPU_CLASS_MARVELL +}; +extern enum cpu_class cpu_class; + struct dumperinfo; extern int busdma_swi_pending; void busdma_swi(void); From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 18:20:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F229106566C; Sat, 26 Sep 2009 18:20:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F22FE8FC14; Sat, 26 Sep 2009 18:20:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QIKe97066646; Sat, 26 Sep 2009 18:20:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QIKeo4066643; Sat, 26 Sep 2009 18:20:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909261820.n8QIKeo4066643@svn.freebsd.org> From: Alan Cox Date: Sat, 26 Sep 2009 18:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197524 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 18:20:41 -0000 Author: alc Date: Sat Sep 26 18:20:40 2009 New Revision: 197524 URL: http://svn.freebsd.org/changeset/base/197524 Log: Make malloc(3) superpage aware. Specifically, if getpagesizes(3) returns a large page size that is greater than malloc(3)'s default chunk size but less than or equal to 4 MB, then increase the chunk size to match the large page size. Most often, using a chunk size that is less than the large page size is not a problem. However, consider a long-running application that allocates and frees significant amounts of memory. In particular, it frees enough memory at times that some of that memory is munmap()ed. Up until the first munmap(), a 1MB chunk size is just fine; it's not a problem for the virtual memory system. Two adjacent 1MB chunks that are aligned on a 2MB boundary will be promoted automatically to a superpage even though they were allocated at different times. The trouble begins with the munmap(), releasing a 1MB chunk will trigger the demotion of the containing superpage, leaving behind a half-used 2MB reservation. Now comes the real problem. Unfortunately, when the application needs to allocate more memory, and it recycles the previously munmap()ed address range, the implementation of mmap() won't be able to reuse the reservation. Basically, the coalescing rules in the virtual memory system don't allow this new range to combine with its neighbor. The effect being that superpage promotion will not reoccur for this range of addresses until both 1MB chunks are freed at some point in the future. Reviewed by: jasone MFC after: 3 weeks Modified: head/lib/libc/stdlib/malloc.3 head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.3 ============================================================================== --- head/lib/libc/stdlib/malloc.3 Sat Sep 26 16:37:23 2009 (r197523) +++ head/lib/libc/stdlib/malloc.3 Sat Sep 26 18:20:40 2009 (r197524) @@ -32,7 +32,7 @@ .\" @(#)malloc.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 26, 2008 +.Dd September 26, 2009 .Dt MALLOC 3 .Os .Sh NAME @@ -245,7 +245,8 @@ will be initialized to 0x5a. This is intended for debugging and will impact performance negatively. .It K Double/halve the virtual memory chunk size. -The default chunk size is 1 MB. +The default chunk size is the maximum of 1 MB and the largest +page size that is less than or equal to 4 MB. .It M Use .Xr mmap 2 @@ -561,6 +562,7 @@ _malloc_options = "X"; .Xr alloca 3 , .Xr atexit 3 , .Xr getpagesize 3 , +.Xr getpagesizes 3 , .Xr memory 3 , .Xr posix_memalign 3 .Sh STANDARDS Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Sat Sep 26 16:37:23 2009 (r197523) +++ head/lib/libc/stdlib/malloc.c Sat Sep 26 18:20:40 2009 (r197524) @@ -4795,6 +4795,21 @@ malloc_init_hard(void) } } + /* + * Increase the chunk size to the largest page size that is greater + * than the default chunk size and less than or equal to 4MB. + */ + { + size_t pagesizes[MAXPAGESIZES]; + int k, nsizes; + + nsizes = getpagesizes(pagesizes, MAXPAGESIZES); + for (k = 0; k < nsizes; k++) + if (pagesizes[k] <= (1LU << 22)) + while ((1LU << opt_chunk_2pow) < pagesizes[k]) + opt_chunk_2pow++; + } + for (i = 0; i < 3; i++) { unsigned j; From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 18:23:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9547C106566C; Sat, 26 Sep 2009 18:23:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 848FD8FC1C; Sat, 26 Sep 2009 18:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QING6K066740; Sat, 26 Sep 2009 18:23:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QINGBa066738; Sat, 26 Sep 2009 18:23:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909261823.n8QINGBa066738@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Sep 2009 18:23: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: r197525 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 18:23:16 -0000 Author: pjd Date: Sat Sep 26 18:23:16 2009 New Revision: 197525 URL: http://svn.freebsd.org/changeset/base/197525 Log: Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object. This completes the fix from r185586. PR: kern/139059 Reported by: Daniel Braniss Submitted by: Jaakko Heinonen Tested by: Daniel Braniss MFC after: 3 days Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Sat Sep 26 18:20:40 2009 (r197524) +++ head/sys/nfsserver/nfs_serv.c Sat Sep 26 18:23:16 2009 (r197525) @@ -1332,7 +1332,7 @@ nfsrv_create(struct nfsrv_descript *nfsd tl = nfsm_dissect_nonblock(u_int32_t *, NFSX_V3CREATEVERF); /* Unique bytes, endianness is not important. */ - cverf.tv_sec = tl[0]; + cverf.tv_sec = (int32_t)tl[0]; cverf.tv_nsec = tl[1]; exclusive_flag = 1; break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 18:59:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F073106566B; Sat, 26 Sep 2009 18:59:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD5A8FC12; Sat, 26 Sep 2009 18:59:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QIx1GB067494; Sat, 26 Sep 2009 18:59:01 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QIx1MU067487; Sat, 26 Sep 2009 18:59:01 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200909261859.n8QIx1MU067487@svn.freebsd.org> From: Hiroki Sato Date: Sat, 26 Sep 2009 18:59: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: r197526 - in head: . etc etc/rc.d sbin/ifconfig share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 18:59:01 -0000 Author: hrs Date: Sat Sep 26 18:59:00 2009 New Revision: 197526 URL: http://svn.freebsd.org/changeset/base/197526 Log: Fix several logic bugs in the previous IPv6 variable change and re-add $ipv6_enable support for backward compatibility. From UPDATING: 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF for IPv4. For aliases, $ifconfig_IF_aliasN should be used. Note that both variables need the "inet6" keyword at the head. Do not set $ipv6_network_interfaces manually if you do not understand what you are doing. It is not needed in most cases. $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but they are obsolete. 2. $ipv6_enable is obsolete. Use $ipv6_prefer and/or "inet6 accept_rtadv" keyword in ifconfig(8) instead. If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and all configured interfaces have "inet6 accept_rtadv" in the $ifconfig_IF_ipv6. These are for backward compatibility. 3. A new variable $ipv6_prefer has been added. If NO, IPv6 functionality of interfaces with no corresponding $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag, and the default address selection policy of ip6addrctl(8) is the IPv4-preferred one (see rc.d/ip6addrctl for more details). Note that if you want to configure IPv6 functionality on the disabled interfaces after boot, first you need to clear the flag by using ifconfig(8) like: ifconfig em0 inet6 -ifdisabled If YES, the default address selection policy is set as IPv6-preferred. The default value of $ipv6_prefer is NO. 4. If your system need to receive Router Advertisement messages, define "inet6 accept_rtadv" in $ifconfig_IF_ipv6. The rc(8) scripts automatically invoke rtsol(8) when the interface becomes UP. The Router Advertisement messages are used for SLAAC (State-Less Address AutoConfiguration). Modified: head/UPDATING head/etc/network.subr head/etc/rc.d/ip6addrctl head/etc/rc.d/netif head/sbin/ifconfig/ifconfig.8 head/share/man/man5/rc.conf.5 Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Sep 26 18:23:16 2009 (r197525) +++ head/UPDATING Sat Sep 26 18:59:00 2009 (r197526) @@ -22,10 +22,61 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090926: + The rc.d/network_ipv6, IPv6 configuration script has been integrated + into rc.d/netif. The changes are the following: + + 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF + for IPv4. For aliases, $ifconfig_IF_aliasN should be used. + Note that both variables need the "inet6" keyword at the head. + + Do not set $ipv6_network_interfaces manually if you do not + understand what you are doing. It is not needed in most cases. + + $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but + they are obsolete. + + 2. $ipv6_enable is obsolete. Use $ipv6_prefer and + "inet6 accept_rtadv" keyword in ifconfig(8) instead. + + If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and + all configured interfaces have "inet6 accept_rtadv" in the + $ifconfig_IF_ipv6. These are for backward compatibility. + + 3. A new variable $ipv6_prefer has been added. If NO, IPv6 + functionality of interfaces with no corresponding + $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag, + and the default address selection policy of ip6addrctl(8) + is the IPv4-preferred one (see rc.d/ip6addrctl for more details). + Note that if you want to configure IPv6 functionality on the + disabled interfaces after boot, first you need to clear the flag by + using ifconfig(8) like: + + ifconfig em0 inet6 -ifdisabled + + If YES, the default address selection policy is set as + IPv6-preferred. + + The default value of $ipv6_prefer is NO. + + 4. If your system need to receive Router Advertisement messages, + define "inet6 accept_rtadv" in $ifconfig_IF_ipv6. The rc(8) + scripts automatically invoke rtsol(8) when the interface becomes + UP. The Router Advertisement messages are used for SLAAC + (State-Less Address AutoConfiguration). + 20090922: 802.11s D3.03 support was committed. This is incompatible with the previous code, which was based on D3.0. +20090912: + A sysctl variable net.inet6.ip6.accept_rtadv now sets the default value + of a per-interface flag ND6_IFF_ACCEPT_RTADV, not a global knob to + control whether accepting Router Advertisement messages or not. + Also, a per-interface flag ND6_IFF_AUTO_LINKLOCAL has been added and + a sysctl variable net.inet6.ip6.auto_linklocal is its default value. + The ifconfig(8) utility now supports these flags. + 20090910: ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for mount(8) and -a option for df(1) to see them. Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sat Sep 26 18:23:16 2009 (r197525) +++ head/etc/network.subr Sat Sep 26 18:59:00 2009 (r197526) @@ -97,15 +97,26 @@ ifconfig_up() if afexists inet6; then if ipv6if $1; then if checkyesno ipv6_gateway_enable; then - _ipv6_opts="-accept_rtadv auto_linklocal" - else - _ipv6_opts="auto_linklocal" + _ipv6_opts="-accept_rtadv" fi else - _ipv6_opts="-auto_linklocal ifdisabled" + if checkyesno ipv6_prefer; then + _ipv6_opts="-ifdisabled" + else + _ipv6_opts="ifdisabled" + fi + + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]) + _ipv6_opts="${_ipv6_opts} accept_rtadv" + ;; + esac fi - ifconfig $1 inet6 ${_ipv6_opts} + if [ -n "${_ipv6_opts}" ]; then + ifconfig $1 inet6 ${_ipv6_opts} + fi # ifconfig_IF_ipv6 ifconfig_args=`ifconfig_getargs $1 ipv6` @@ -382,7 +393,7 @@ noafif() # 1 otherwise. ipv6if() { - local _if i + local _if _tmpargs i _if=$1 if ! afexists inet6; then @@ -396,6 +407,18 @@ ipv6if() ;; esac + # True if $ifconfig_IF_ipv6 is defined. + _tmpargs=`_ifconfig_getargs $_if ipv6` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + + # backward compatibility: True if $ipv6_ifconfig_IF is defined. + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + case "${ipv6_network_interfaces}" in [Aa][Uu][Tt][Oo]) return 0 @@ -431,17 +454,30 @@ ipv6_autoconfif() if checkyesno ipv6_gateway_enable; then return 1 fi + _tmpargs=`get_if_var $_if ipv6_prefix_IF` + if [ -n "${_tmpargs}" ]; then + return 1 + fi case $_if in lo0|\ stf[0-9]*|\ faith[0-9]*|\ lp[0-9]*|\ - sl[0-9]*) + sl[0-9]*|\ + pflog[0-9]*|\ + pfsync[0-9]*) return 1 ;; esac + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]) + return 0 + ;; + esac + _tmpargs=`_ifconfig_getargs $_if ipv6` for _arg in $_tmpargs; do case $_arg in @@ -451,6 +487,16 @@ ipv6_autoconfif() esac done + # backward compatibility: $ipv6_ifconfig_IF + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + for _arg in $_tmpargs; do + case $_arg in + accept_rtadv) + return 0 + ;; + esac + done + return 1 } @@ -691,7 +737,7 @@ ifalias_ipv6_up() ;; *) ifconfig $1 inet6 ${ifconfig_args} alias && _ret=0 - warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." + warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." \ " Use ifconfig_$1_aliasN instead." ;; esac @@ -773,6 +819,7 @@ ifalias_ipv6_down() done # backward compatibility: ipv6_ifconfig_IF_aliasN. + alias=0 while : ; do ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}` case "${ifconfig_args}" in @@ -780,13 +827,12 @@ ifalias_ipv6_down() break ;; *) - ifconfig $1 inet6 ${ifconfig_args} -alias - alias=$((${alias} + 1)) - warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." + ifconfig $1 inet6 ${ifconfig_args} -alias && _ret=0 + warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." \ " Use ifconfig_$1_aliasN instead." - _ret=0 ;; esac + alias=$((${alias} + 1)) done return $_ret Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Sat Sep 26 18:23:16 2009 (r197525) +++ head/etc/rc.d/ip6addrctl Sat Sep 26 18:59:00 2009 (r197526) @@ -19,6 +19,8 @@ status_cmd="ip6addrctl" prefer_ipv6_cmd="ip6addrctl_prefer_ipv6" prefer_ipv4_cmd="ip6addrctl_prefer_ipv4" +set_rcvar_obsolete ipv6_enable ipv6_prefer + ip6addrctl_prefer_ipv6() { ip6addrctl flush >/dev/null 2>&1 Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sat Sep 26 18:23:16 2009 (r197525) +++ head/etc/rc.d/netif Sat Sep 26 18:59:00 2009 (r197526) @@ -41,7 +41,7 @@ clonedown_cmd="clone_down" extra_commands="cloneup clonedown" cmdifn= -set_rcvar_obsolete ipv6_enable +set_rcvar_obsolete ipv6_enable ipv6_prefer network_start() { Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat Sep 26 18:23:16 2009 (r197525) +++ head/sbin/ifconfig/ifconfig.8 Sat Sep 26 18:59:00 2009 (r197526) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 2, 2009 +.Dd September 23, 2009 .Dt IFCONFIG 8 .Os .Sh NAME @@ -598,7 +598,10 @@ If the interface was reset when previous the hardware will be re-initialized. .El .Pp -The following parameters are for ICMPv6 Neightbor Discovery Protocol: +The following parameters are for ICMPv6 Neightbor Discovery Protocol. +Note that the address family keyword +.Dq Li inet6 +is needed for them: .Bl -tag -width indent .It Cm accept_rtadv Set a flag to enable accepting ICMPv6 Router Advertisement messages. @@ -619,7 +622,10 @@ Clear a flag .Cm defaultif . .It Cm ifdisabled Set a flag to disable all of IPv6 network communications on the -specified interface. +specified interface. Note that if there are already configured IPv6 +addresses on that interface, all of them are marked as +.Dq tentative +and DAD will be performed when this flag is cleared. .It Cm -ifdisabled Clear a flag .Cm ifdisabled . Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Sep 26 18:23:16 2009 (r197525) +++ head/share/man/man5/rc.conf.5 Sat Sep 26 18:59:00 2009 (r197526) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2009 +.Dd September 23, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -1246,28 +1246,85 @@ It is also possible to rename interface ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed +.It Va ipv6_enable +.Pq Vt bool +If the variable is +.Dq Li YES , +.Dq Li inet6 accept_rtadv +is added to all of +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +and the +.Va ipv6_prefer +is defined as +.Dq Li YES . +.Pp +This variable is deprecated. Use +.Va ipv6_prefer +and +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 . +.It Va ipv6_prefer +.Pq Vt bool +This variable does the following: +.Pp +If the variable is +.Dq Li YES , +the default policy of the source address selection set by +.Xr ip6addrctl 8 +will be IPv6-preferred. +.Pp +If the variable is +.Dq Li NO , +the default policy of the source address selection set by +.Xr ip6addrctl 8 +will be IPv4-preferred, and all of interfaces which does not have the +corrsponding +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +variable will be marked as +.Dq Li IFDISABLED . +This means only IPv6 functionality on that interface is completely +disabled. For more details of +.Dq Li IFDISABLED +flag and keywords +.Dq Li inet6 ifdisabled , +see +.Xr ifconfig 8 . +.Pp .It Va ipv6_network_interfaces .Pq Vt str This is the IPv6 equivalent of .Va network_interfaces . -Instead of setting the ifconfig variables as -.Va ifconfig_ Ns Aq Ar interface -they should be set as -.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6. -Aliases should be set as -.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n . -.Va ipv6_prefix_ Ns Aq Ar interface -does something. -Interfaces that have a -.Fl accept_rtadv -flag in +Normally manual configuration of this variable is not needed. +.Pp +IPv6 functionality on an interface should be configured by +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , +instead of setting ifconfig parameters in +.Va ifconfig_ Ns Aq Ar interface . +Aliases should be set by +.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n +with +.Dq Li inet6 +keyword. For example: +.Bd -literal +ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" +ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" +.Ed +.Pp +Interfaces that have an +.Dq Li inet6 accept_rtadv +keyword in .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 setting will be automatically configured by -.Xr rtsol 8 -if the +.Xr rtsol 8 . +Note that this automatic configuration is disabled if the .Va ipv6_gateway_enable is set to -.Dq Li NO . +.Dq Li YES . +.It Va ipv6_prefix_ Ns Aq Ar interface +.Pq Vt str +If one or more prefixes are defined in +.Va ipv6_prefix_ Ns Aq Ar interface +addresses based on each prefix and the EUI-64 interface index will be +configured on that interface. .It Va ipv6_default_interface .Pq Vt str If not set to From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 19:00:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9133B1065693; Sat, 26 Sep 2009 19:00:20 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80F6F8FC15; Sat, 26 Sep 2009 19:00:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QJ0KuT067578; Sat, 26 Sep 2009 19:00:20 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QJ0KK4067575; Sat, 26 Sep 2009 19:00:20 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200909261900.n8QJ0KK4067575@svn.freebsd.org> From: Hiroki Sato Date: Sat, 26 Sep 2009 19:00: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: r197527 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 19:00:20 -0000 Author: hrs Date: Sat Sep 26 19:00:20 2009 New Revision: 197527 URL: http://svn.freebsd.org/changeset/base/197527 Log: Move rc.d/{stf,faith} to just before rc.d/routing. Pointed out by: tegge Modified: head/etc/rc.d/defaultroute head/etc/rc.d/routing Modified: head/etc/rc.d/defaultroute ============================================================================== --- head/etc/rc.d/defaultroute Sat Sep 26 18:59:00 2009 (r197526) +++ head/etc/rc.d/defaultroute Sat Sep 26 19:00:20 2009 (r197527) @@ -6,7 +6,7 @@ # # PROVIDE: defaultroute -# REQUIRE: devd netif +# REQUIRE: devd faith netif stf # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sat Sep 26 18:59:00 2009 (r197526) +++ head/etc/rc.d/routing Sat Sep 26 19:00:20 2009 (r197527) @@ -6,7 +6,7 @@ # # PROVIDE: routing -# REQUIRE: netif ppp +# REQUIRE: faith netif ppp stf # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 19:00:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A525E1065670; Sat, 26 Sep 2009 19:00:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94F318FC19; Sat, 26 Sep 2009 19:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QJ0l1a067624; Sat, 26 Sep 2009 19:00:47 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QJ0ltc067622; Sat, 26 Sep 2009 19:00:47 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200909261900.n8QJ0ltc067622@svn.freebsd.org> From: Hiroki Sato Date: Sat, 26 Sep 2009 19:00: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: r197528 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 19:00:47 -0000 Author: hrs Date: Sat Sep 26 19:00:47 2009 New Revision: 197528 URL: http://svn.freebsd.org/changeset/base/197528 Log: Use ipv6if() when $rtadvd_interfaces="AUTO". Modified: head/etc/rc.d/rtadvd Modified: head/etc/rc.d/rtadvd ============================================================================== --- head/etc/rc.d/rtadvd Sat Sep 26 19:00:20 2009 (r197527) +++ head/etc/rc.d/rtadvd Sat Sep 26 19:00:47 2009 (r197528) @@ -43,7 +43,10 @@ rtadvd_precmd() case ${rtadvd_interfaces} in [Aa][Uu][Tt][Oo]|'') for i in `ifconfig -l` ; do - if is_wired_interface $1; then + case $i in + lo0) continue ;; + esac + if ipv6if $i; then rtadvd_interfaces="${rtadvd_interfaces} ${i}" fi done From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 19:57:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029D3106566B for ; Sat, 26 Sep 2009 19:57:50 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1888FC19 for ; Sat, 26 Sep 2009 19:57:48 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 86DCE45C9F; Sat, 26 Sep 2009 21:57:46 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 71DE345C89; Sat, 26 Sep 2009 21:57:41 +0200 (CEST) Date: Sat, 26 Sep 2009 21:57:44 +0200 From: Pawel Jakub Dawidek To: Adam McDougall Message-ID: <20090926195743.GG1597@garage.freebsd.pl> References: <200908170923.n7H9NR7t056904@svn.freebsd.org> <4ABD247D.40201@egr.msu.edu> <20090925214323.GC1597@garage.freebsd.pl> <4ABD3F80.6020009@egr.msu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CNfT9TXqV7nd4cfk" Content-Disposition: inline In-Reply-To: <4ABD3F80.6020009@egr.msu.edu> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r196300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 19:57:50 -0000 --CNfT9TXqV7nd4cfk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 25, 2009 at 06:09:04PM -0400, Adam McDougall wrote: > Pawel Jakub Dawidek wrote: >=20 > >>panic: sleeping thread > >>cpuid =3D 4 > > > >I've just been told, that this should be fixed already by r193951 and > >r195148. > > >=20 > (much of previous email removed) >=20 > I hunted for MFCs and found r195586 which was to 7-STABLE (after the=20 > date of the kernel that crashed) but I can't tell that r193951 is in=20 > anything except HEAD and there was mentioned of it causing struct vnet > changes which may have been why. Do you think r195586 will be a=20 > sufficient fix in 7? Thanks. Could be, but to be sure you would have to try it on your own. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --CNfT9TXqV7nd4cfk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKvnI3ForvXbEpPzQRApQOAJ91iSvnIjkQRek3V8CxHHEMT3LV7wCg+BlO oMauWLxLA/x2G9Vi/Sg8KNY= =3LJQ -----END PGP SIGNATURE----- --CNfT9TXqV7nd4cfk-- From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 20:07:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3A0106566C; Sat, 26 Sep 2009 20:07:49 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC6198FC29; Sat, 26 Sep 2009 20:07:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QK7n6A069710; Sat, 26 Sep 2009 20:07:49 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QK7nDa069706; Sat, 26 Sep 2009 20:07:49 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200909262007.n8QK7nDa069706@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 26 Sep 2009 20:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197529 - in stable/7/sys: . contrib/pf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 20:07:49 -0000 Author: stas Date: Sat Sep 26 20:07:48 2009 New Revision: 197529 URL: http://svn.freebsd.org/changeset/base/197529 Log: - MFC r196410 by peter@: Fix signed comparison bug when ticks goes negative after 24 days of uptime. This causes the tcp time_wait state code to fail to expire sockets in timewait state. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/netinet/tcp_timewait.c Modified: stable/7/sys/netinet/tcp_timewait.c ============================================================================== --- stable/7/sys/netinet/tcp_timewait.c Sat Sep 26 19:00:47 2009 (r197528) +++ stable/7/sys/netinet/tcp_timewait.c Sat Sep 26 20:07:48 2009 (r197529) @@ -587,7 +587,7 @@ tcp_tw_2msl_scan(int reuse) INP_INFO_WLOCK_ASSERT(&tcbinfo); for (;;) { tw = TAILQ_FIRST(&twq_2msl); - if (tw == NULL || (!reuse && tw->tw_time > ticks)) + if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) break; INP_WLOCK(tw->tw_inpcb); tcp_twclose(tw, reuse); From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 20:52:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9165D106566B; Sat, 26 Sep 2009 20:52:01 +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 5EC2F8FC13; Sat, 26 Sep 2009 20:52:00 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 62AB26D41B; Sat, 26 Sep 2009 20:51:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 2B997844E0; Sat, 26 Sep 2009 22:51:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek References: <200909251824.n8PIOLte036513@svn.freebsd.org> <20090925191416.GA1597@garage.freebsd.pl> Date: Sat, 26 Sep 2009 22:51:58 +0200 In-Reply-To: <20090925191416.GA1597@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Fri, 25 Sep 2009 21:14:16 +0200") Message-ID: <86tyyph1jl.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (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, Thomas Backman Subject: Re: svn commit: r197498 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 20:52:01 -0000 Pawel Jakub Dawidek writes: > I didn't, thanks. Unfortunately svn doesn't even allow forced commits, > which is a paintful regression compared to cvs. Subversion does allow editing a log message after the fact, but our commit scripts prohibit it. This should IMHO be allowed, and cause a new email to be sent out to note the change. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 20:53:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB4A1065672; Sat, 26 Sep 2009 20:53:09 +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 3D7048FC15; Sat, 26 Sep 2009 20:53:09 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 777E56D41B; Sat, 26 Sep 2009 20:53:08 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 4C249844E0; Sat, 26 Sep 2009 22:53:08 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Bjoern A. Zeeb" References: <200909261245.n8QCjSiM059385@svn.freebsd.org> Date: Sat, 26 Sep 2009 22:53:08 +0200 In-Reply-To: <200909261245.n8QCjSiM059385@svn.freebsd.org> (Bjoern A. Zeeb's message of "Sat, 26 Sep 2009 12:45:28 +0000 (UTC)") Message-ID: <86pr9dh1hn.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (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: r197518 - in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/lindev sys/i386/conf sys/modules sys/modules/lindev sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 20:53:09 -0000 "Bjoern A. Zeeb" writes: > Log: > lindev(4) [1] is supposed to be a collection of linux-specific pseudo > devices that we also support, just not by default (thus only LINT or > module builds by default). >=20=20=20 > While currently there is only "/dev/full" [2], we are planning to see m= ore > in the future. We may decide to change the module/dependency logic in = the > future should the list grow too long. >=20=20=20 > This is not part of linux.ko as also non-linux binaries like kFreeBSD > userland or ports can make use of this as well. >=20=20=20 > Suggested by: rwatson [1] (name) > Submitted by: ed [2] > Discussed with: markm, ed, rwatson, kib (weeks ago) > Reviewed by: rwatson, brueffer (prev. version) > PR: kern/68961 > MFC after: 6 weeks Also discussed with: des, who was in favor - both of the concept and of the implementation. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Sep 26 23:05:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82B60106566C; Sat, 26 Sep 2009 23:05:01 +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 672798FC0C; Sat, 26 Sep 2009 23:05:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8QN511n073248; Sat, 26 Sep 2009 23:05:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8QN51Yj073246; Sat, 26 Sep 2009 23:05:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200909262305.n8QN51Yj073246@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 Sep 2009 23:05: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: r197531 - head/libexec/rpc.rquotad X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 23:05:01 -0000 Author: des Date: Sat Sep 26 23:05:01 2009 New Revision: 197531 URL: http://svn.freebsd.org/changeset/base/197531 Log: printerr_reply() has never been used for as long as we've had this code in our tree (13+ years). This is an excellent argument for aggressive use of "static". Modified: head/libexec/rpc.rquotad/rquotad.c Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Sat Sep 26 20:43:00 2009 (r197530) +++ head/libexec/rpc.rquotad/rquotad.c Sat Sep 26 23:05:01 2009 (r197531) @@ -31,12 +31,11 @@ __FBSDID("$FreeBSD$"); #include #include -void rquota_service(struct svc_req *request, SVCXPRT *transp); -void sendquota(struct svc_req *request, SVCXPRT *transp); -void printerr_reply(SVCXPRT *transp); -void initfs(void); -int getfsquota(long id, char *path, struct dqblk *dqblk); -int hasquota(struct fstab *fs, char **qfnamep); +static void rquota_service(struct svc_req *request, SVCXPRT *transp); +static void sendquota(struct svc_req *request, SVCXPRT *transp); +static void initfs(void); +static int getfsquota(long id, char *path, struct dqblk *dqblk); +static int hasquota(struct fstab *fs, char **qfnamep); /* * structure containing informations about ufs filesystems @@ -48,9 +47,9 @@ struct fs_stat { char *qfpathname; /* pathname of the quota file */ dev_t st_dev; /* device of the filesystem */ } fs_stat; -struct fs_stat *fs_begin = NULL; +static struct fs_stat *fs_begin = NULL; -int from_inetd = 1; +static int from_inetd = 1; static void cleanup(int sig) @@ -111,7 +110,7 @@ main(void) exit(1); } -void +static void rquota_service(struct svc_req *request, SVCXPRT *transp) { @@ -134,7 +133,7 @@ rquota_service(struct svc_req *request, } /* read quota for the specified id, and send it */ -void +static void sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; @@ -183,26 +182,8 @@ sendquota(struct svc_req *request, SVCXP } } -void -printerr_reply(SVCXPRT *transp) /* when a reply to a request failed */ -{ - char name[INET6_ADDRSTRLEN]; - struct sockaddr *caller; - int save_errno; - - save_errno = errno; - caller = (struct sockaddr *)svc_getrpccaller(transp)->buf; - getnameinfo(caller, caller->sa_len, name, sizeof (name), - NULL, 0, NI_NUMERICHOST); - errno = save_errno; - if (errno == 0) - syslog(LOG_ERR, "couldn't send reply to %s", name); - else - syslog(LOG_ERR, "couldn't send reply to %s: %m", name); -} - /* initialise the fs_tab list from entries in /etc/fstab */ -void +static void initfs(void) { struct fs_stat *fs_current = NULL; @@ -240,7 +221,7 @@ initfs(void) * gets the quotas for id, filesystem path. * Return 0 if fail, 1 otherwise */ -int +static int getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; @@ -295,7 +276,7 @@ getfsquota(long id, char *path, struct d * Check to see if a particular quota is to be enabled. * Comes from quota.c, NetBSD 0.9 */ -int +static int hasquota(struct fstab *fs, char **qfnamep) { static char initname, usrname[100];