From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 00:39:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5C9106566B; Sun, 8 Nov 2009 00:39:50 +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 3C1E78FC08; Sun, 8 Nov 2009 00:39:50 +0000 (UTC) Received: from Macintosh-4.local (sam@[10.0.0.198]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id nA80dncg089641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 7 Nov 2009 16:39:49 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <4AF61355.2080903@freebsd.org> Date: Sat, 07 Nov 2009 16:39:49 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Doug Barton References: <200911071842.nA7IgsNn060380@svn.freebsd.org> <4AF5C3C7.1020806@freebsd.org> <4AF5DDFB.10107@FreeBSD.org> In-Reply-To: <4AF5DDFB.10107@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------010302030009060002060408" X-DCC-CTc-dcc2-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199018 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 00:39:50 -0000 This is a multi-part message in MIME format. --------------010302030009060002060408 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Doug Barton wrote: > Sam Leffler wrote: >> The right thing to do is to set wpi_debug to 0 and leave the messages >> compiled in. > > Well as you can see from the diff I did leave the messages in the > source so that anyone who wants to enable debugging again can just > define WPI_DEBUG at build time to get it. > > However defining WPI_DEBUG to 0 resulted in the debug messages being > printed on the console again so if I'm understanding what you're > suggesting correctly it seems that it would require a lot more changes > in the code to accomplish. (I did see other examples of what I think > you're suggesting in sys/ but this driver doesn't seem to have that > support.) > > If I'm not understanding something or you have a better solution feel > free to implement it. My goal was just to get a less noisy console at > boot time. Try the attached Sam --------------010302030009060002060408 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="wpi.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wpi.patch" Index: if_wpi.c =================================================================== --- if_wpi.c (revision 199033) +++ if_wpi.c (working copy) @@ -103,6 +103,8 @@ #include #include +#define WPI_DEBUG + #ifdef WPI_DEBUG #define DPRINTF(x) do { if (wpi_debug != 0) printf x; } while (0) #define DPRINTFN(n, x) do { if (wpi_debug & n) printf x; } while (0) @@ -124,7 +126,7 @@ WPI_DEBUG_ANY = 0xffffffff }; -static int wpi_debug = 1; +static int wpi_debug = 0; SYSCTL_INT(_debug, OID_AUTO, wpi, CTLFLAG_RW, &wpi_debug, 0, "wpi debug level"); TUNABLE_INT("debug.wpi", &wpi_debug); --------------010302030009060002060408-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 01:13:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC4351065670; Sun, 8 Nov 2009 01:13:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB47C8FC08; Sun, 8 Nov 2009 01:13: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 nA81DcKe068998; Sun, 8 Nov 2009 01:13:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA81Dcfe068996; Sun, 8 Nov 2009 01:13:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911080113.nA81Dcfe068996@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 8 Nov 2009 01:13: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: r199035 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 01:13:39 -0000 Author: yongari Date: Sun Nov 8 01:13:38 2009 New Revision: 199035 URL: http://svn.freebsd.org/changeset/base/199035 Log: Don't count input errors twice, we always read input errors from MAC in bge_tick. Previously it used to show more number of input errors. I noticed actual input errors were less than 8% even for 64 bytes UDP frames generated by netperf. Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in bge_tick, remove useless code protected by #ifdef notyet. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 8 00:50:12 2009 (r199034) +++ head/sys/dev/bge/if_bge.c Sun Nov 8 01:13:38 2009 (r199035) @@ -3196,7 +3196,6 @@ bge_rxeof(struct bge_softc *sc) m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); - ifp->if_ierrors++; continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { @@ -3209,7 +3208,6 @@ bge_rxeof(struct bge_softc *sc) stdcnt++; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); - ifp->if_ierrors++; continue; } m = sc->bge_cdata.bge_rx_std_chain[rxidx]; @@ -3291,14 +3289,6 @@ bge_rxeof(struct bge_softc *sc) bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); if (jumbocnt) bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); -#ifdef notyet - /* - * This register wraps very quickly under heavy packet drops. - * If you need correct statistics, you can enable this check. - */ - if (BGE_IS_5705_PLUS(sc)) - ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); -#endif return (rx_npkts); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 01:30:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D31A0106568B; Sun, 8 Nov 2009 01:30:35 +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 C252E8FC14; Sun, 8 Nov 2009 01:30: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 nA81UZIY069341; Sun, 8 Nov 2009 01:30:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA81UZq4069339; Sun, 8 Nov 2009 01:30:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911080130.nA81UZq4069339@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 8 Nov 2009 01:30: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: r199036 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 01:30:35 -0000 Author: yongari Date: Sun Nov 8 01:30:35 2009 New Revision: 199036 URL: http://svn.freebsd.org/changeset/base/199036 Log: Count number of inbound packets which were chosen to be discarded as input errors. Also count out of receive BDs as input errors. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 8 01:13:38 2009 (r199035) +++ head/sys/dev/bge/if_bge.c Sun Nov 8 01:30:35 2009 (r199036) @@ -3547,7 +3547,9 @@ bge_stats_update_regs(struct bge_softc * ifp->if_collisions += CSR_READ_4(sc, BGE_MAC_STATS + offsetof(struct bge_mac_stats_regs, etherStatsCollisions)); + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS); ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS); } static void From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 02:33:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07DAC106566C; Sun, 8 Nov 2009 02:33:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB37C8FC13; Sun, 8 Nov 2009 02:33: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 nA82XXgc070637; Sun, 8 Nov 2009 02:33:33 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA82XXWG070635; Sun, 8 Nov 2009 02:33:33 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200911080233.nA82XXWG070635@svn.freebsd.org> From: Doug Barton Date: Sun, 8 Nov 2009 02:33: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: r199037 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 02:33:34 -0000 Author: dougb Date: Sun Nov 8 02:33:33 2009 New Revision: 199037 URL: http://svn.freebsd.org/changeset/base/199037 Log: Properly turn off debugging LART applied (gently) by: sam Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Nov 8 01:30:35 2009 (r199036) +++ head/sys/dev/wpi/if_wpi.c Sun Nov 8 02:33:33 2009 (r199037) @@ -103,6 +103,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define WPI_DEBUG + #ifdef WPI_DEBUG #define DPRINTF(x) do { if (wpi_debug != 0) printf x; } while (0) #define DPRINTFN(n, x) do { if (wpi_debug & n) printf x; } while (0) @@ -124,7 +126,7 @@ enum { WPI_DEBUG_ANY = 0xffffffff }; -static int wpi_debug = 1; +static int wpi_debug = 0; SYSCTL_INT(_debug, OID_AUTO, wpi, CTLFLAG_RW, &wpi_debug, 0, "wpi debug level"); TUNABLE_INT("debug.wpi", &wpi_debug); From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 02:34:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797FE106568F for ; Sun, 8 Nov 2009 02:34:24 +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 08D8C8FC26 for ; Sun, 8 Nov 2009 02:34:23 +0000 (UTC) Received: (qmail 29577 invoked by uid 399); 8 Nov 2009 02:34:23 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 8 Nov 2009 02:34:23 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AF62E36.6080203@FreeBSD.org> Date: Sat, 07 Nov 2009 18:34:30 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Sam Leffler References: <200911071842.nA7IgsNn060380@svn.freebsd.org> <4AF5C3C7.1020806@freebsd.org> <4AF5DDFB.10107@FreeBSD.org> <4AF61355.2080903@freebsd.org> In-Reply-To: <4AF61355.2080903@freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199018 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 02:34:24 -0000 Sam Leffler wrote: > Try the attached Ok, I'm an idiot, thanks. :) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 02:55:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A1CB1065676 for ; Sun, 8 Nov 2009 02:55:58 +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 ADBBC8FC0A for ; Sun, 8 Nov 2009 02:55:57 +0000 (UTC) Received: (qmail 29584 invoked by uid 399); 8 Nov 2009 02:55:57 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 8 Nov 2009 02:55:57 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AF63344.6080803@FreeBSD.org> Date: Sat, 07 Nov 2009 18:56:04 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Max Laier References: <200911020721.nA27LDq1048764@svn.freebsd.org> <4AEF22E3.5070701@freebsd.org> <200911021955.02459.max@love2party.net> In-Reply-To: <200911021955.02459.max@love2party.net> 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, Robert Watson , Colin Percival Subject: Re: svn commit: r198781 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 02:55:58 -0000 Max Laier wrote: > On Monday 02 November 2009 19:20:19 Colin Percival wrote: >> Robert Watson wrote: >>> On Mon, 2 Nov 2009, Colin Percival wrote: >>>> Attempt to reduce accidental foot-shooting by pointing out that >>>> accept(2)ed sockets do not necessarily inherit O_NONBLOCK from >>>> listening sockets on non-FreeBSD platforms. >>> I wonder how much trouble we should go to to document bugs in other >>> systems as non-portabilities for features that work in our system. >> I don't think there's any simple rule to apply here except "use common >> sense". One can argue that FreeBSD man pages exist for the purpose of >> documenting FreeBSD; but I'd also like to think that FreeBSD is a good >> development platform for writing portable applications, so alerting our >> users to potentially non-portable code certainly has some value. (And > > +1 ... FreeBSD is such a great development platform specifically because of > the complete man page collection. I'd argue, however, that we should keep the > portability notes to the fact that there might be a difference - without going > into too much detail what/where and why that difference is. In addition, the > more detail we add, the more likely it is that the information grows stale FWIW I agree here. Portability notes == good, details == bad; although I would include enough information in the notes so that an interested party can find the appropriate external reference(s). Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 08:59:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16019106566C; Sun, 8 Nov 2009 08:59:41 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 055AC8FC0A; Sun, 8 Nov 2009 08:59: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 nA88xelh079377; Sun, 8 Nov 2009 08:59:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA88xe2M079375; Sun, 8 Nov 2009 08:59:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200911080859.nA88xe2M079375@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 8 Nov 2009 08:59: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: r199040 - head/release/picobsd/bridge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 08:59:41 -0000 Author: luigi Date: Sun Nov 8 08:59:40 2009 New Revision: 199040 URL: http://svn.freebsd.org/changeset/base/199040 Log: create an SMP kernel by default in picobsd Modified: head/release/picobsd/bridge/PICOBSD Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Sun Nov 8 07:31:42 2009 (r199039) +++ head/release/picobsd/bridge/PICOBSD Sun Nov 8 08:59:40 2009 (r199040) @@ -11,11 +11,14 @@ hints "PICOBSD.hints" # values accessible through getenv() # env "PICOBSD.env" -cpu I486_CPU +#cpu I486_CPU cpu I586_CPU cpu I686_CPU ident PICOBSD +options SMP +device apic + options SCHED_4BSD # mandatory to have one scheduler #options MATH_EMULATE #Support for x87 emulation options INET #InterNETworking From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 09:54:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11FF0106568F; Sun, 8 Nov 2009 09:54:26 +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 013E68FC2A; Sun, 8 Nov 2009 09:54: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 nA89sPQD080621; Sun, 8 Nov 2009 09:54:25 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA89sPUX080619; Sun, 8 Nov 2009 09:54:25 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200911080954.nA89sPUX080619@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 8 Nov 2009 09:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199041 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 09:54:26 -0000 Author: trasz Date: Sun Nov 8 09:54:25 2009 New Revision: 199041 URL: http://svn.freebsd.org/changeset/base/199041 Log: Add suggestion for zfs root. Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Nov 8 08:59:40 2009 (r199040) +++ head/sys/kern/vfs_mount.c Sun Nov 8 09:54:25 2009 (r199041) @@ -1892,6 +1892,7 @@ vfs_mountroot_ask(void) freeenv(options); printf("\nManual root filesystem specification:\n"); printf(" : Mount using filesystem \n"); + printf(" eg. zfs:tank\n"); printf(" eg. ufs:/dev/da0s1a\n"); printf(" eg. cd9660:/dev/acd0\n"); printf(" This is equivalent to: "); From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 11:32:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F11106566B; Sun, 8 Nov 2009 11:32:40 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 593FC8FC13; Sun, 8 Nov 2009 11:32: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 nA8BWeS0084099; Sun, 8 Nov 2009 11:32:40 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8BWerU084097; Sun, 8 Nov 2009 11:32:40 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200911081132.nA8BWerU084097@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 8 Nov 2009 11:32: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: r199042 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 11:32:40 -0000 Author: gabor (doc,ports committer) Date: Sun Nov 8 11:32:39 2009 New Revision: 199042 URL: http://svn.freebsd.org/changeset/base/199042 Log: - Update Ukranian catalog Submitted by: Alex Kozlov (via private mail) Modified: head/lib/libc/nls/uk_UA.UTF-8.msg (contents, props changed) Modified: head/lib/libc/nls/uk_UA.UTF-8.msg ============================================================================== --- head/lib/libc/nls/uk_UA.UTF-8.msg Sun Nov 8 09:54:25 2009 (r199041) +++ head/lib/libc/nls/uk_UA.UTF-8.msg Sun Nov 8 11:32:39 2009 (r199042) @@ -181,6 +181,16 @@ $ ENOATTR 87 Атрибут не знайдено $ EDOOFUS 88 Помилка програмування +$ EBADMSG +89 Поганий формат повідомлення +$ EMULTIHOP XXX +90 Спроба мултіхопу +$ ENOLINK +91 Мережовий канал розірвано +$ EPROTO +92 Помилка протоколу +$ ENOTCAPABLE +93 Можливості недостатні $ $ strsignal() support catalog $ From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 11:33:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F0C106566B; Sun, 8 Nov 2009 11:33:51 +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 8E65D8FC1E; Sun, 8 Nov 2009 11:33: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 nA8BXpU2084172; Sun, 8 Nov 2009 11:33:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8BXpa5084169; Sun, 8 Nov 2009 11:33:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911081133.nA8BXpa5084169@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Nov 2009 11:33: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: r199043 - in head: share/man/man4 sys/dev/hptrr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 11:33:51 -0000 Author: mav Date: Sun Nov 8 11:33:51 2009 New Revision: 199043 URL: http://svn.freebsd.org/changeset/base/199043 Log: Introduce hw.hptrr.attach_generic loader tunable to deny hptrr driver attach chips with generic Marvell (non-HighPoint) PCI identification. These chips are also supported by ata(4). Some vendors, like Supermicro, are using same chips without providing HPT RAID BIOS. PR: kern/120842, kern/136750 Modified: head/share/man/man4/hptrr.4 head/sys/dev/hptrr/hptrr_osm_bsd.c Modified: head/share/man/man4/hptrr.4 ============================================================================== --- head/share/man/man4/hptrr.4 Sun Nov 8 11:32:39 2009 (r199042) +++ head/share/man/man4/hptrr.4 Sun Nov 8 11:33:51 2009 (r199043) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2007 +.Dd November 8, 2009 .Dt HPTRR 4 .Os .Sh NAME @@ -46,6 +46,14 @@ module at boot time, place the following .Bd -literal -offset indent hptrr_load="YES" .Ed +.Pp +The following tunables are settable from the loader: +.Bl -ohang +.It Va hw.hptrr.attach_generic +set to 0 to deny driver attach to chips with generic Marvell (non-HighPoint) +PCI identification. These chips are also supported by ata(4). +Some vendors are using same chips, but without providing RAID BIOS. +.El .Sh DESCRIPTION The .Nm @@ -101,6 +109,7 @@ manual page for details on support. .Pp This driver supersedes the older rr232x driver. .Sh SEE ALSO +.Xr ata 4 , .Xr cam 4 , .Xr hptmv 4 , .Xr loader 8 Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Nov 8 11:32:39 2009 (r199042) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Nov 8 11:33:51 2009 (r199043) @@ -34,6 +34,9 @@ #include #include +static int attach_generic = 1; +TUNABLE_INT("hw.hptrr.attach_generic", &attach_generic); + static int hpt_probe(device_t dev) { PCI_ID pci_id; @@ -41,6 +44,9 @@ static int hpt_probe(device_t dev) int i; PHBA hba; + /* Some of supported chips are used not only by HPT. */ + if (pci_get_vendor(dev) != 0x1103 && !attach_generic) + return (ENXIO); for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { if ((pci_get_vendor(dev) == pci_id.vid) && From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 11:55:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0385D1065670; Sun, 8 Nov 2009 11:55:04 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E63738FC0A; Sun, 8 Nov 2009 11:55: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 nA8Bt3Wc084691; Sun, 8 Nov 2009 11:55:03 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8Bt3gP084689; Sun, 8 Nov 2009 11:55:03 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200911081155.nA8Bt3gP084689@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 8 Nov 2009 11:55: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: r199044 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 11:55:04 -0000 Author: gabor (doc,ports committer) Date: Sun Nov 8 11:55:03 2009 New Revision: 199044 URL: http://svn.freebsd.org/changeset/base/199044 Log: - Strip trailing CRs Requested by: Alex Kozlov (via private mail) Modified: head/lib/libc/nls/uk_UA.UTF-8.msg Modified: head/lib/libc/nls/uk_UA.UTF-8.msg ============================================================================== --- head/lib/libc/nls/uk_UA.UTF-8.msg Sun Nov 8 11:33:51 2009 (r199043) +++ head/lib/libc/nls/uk_UA.UTF-8.msg Sun Nov 8 11:55:03 2009 (r199044) @@ -1,259 +1,259 @@ -$ $FreeBSD$ -$ -$ Message catalog for uk_UA.UTF-8 locale -$ -$ strerror() support catalog -$ -$set 1 -$ EPERM -1 Операція не дозволена -$ ENOENT -2 Немає такого файлу або каталогу -$ ESRCH -3 Немає такого процесу -$ EINTR -4 Перервано виклик функції -$ EIO -5 Помилка вводу-виводу -$ ENXIO -6 Немає такого пристрою або адреси -$ E2BIG -7 Перелік аргументів надто довгий -$ ENOEXEC -8 Помилка формату виконуваного файлу -$ EBADF -9 Невірний дескриптор файлу -$ ECHILD -10 Немає дочірнього процесу -$ EDEADLK -11 Уникнуто взаємне блокування ресурсів -$ ENOMEM -12 Не достатньо пам'яті -$ EACCES -13 Відмова у доступі -$ EFAULT -14 Невірна адреса -$ ENOTBLK -15 Потрібен блочний пристрій -$ EBUSY -16 Ресурс зайнятий -$ EEXIST -17 Файл вже існує -$ EXDEV -18 Посилання за межі пристрою -$ ENODEV -19 Немає такого пристрою -$ ENOTDIR -20 Це не каталог -$ EISDIR -21 Це каталог -$ EINVAL -22 Недозволений аргумент -$ ENFILE -23 Забагато відкритих файлів у системі -$ EMFILE -24 Забагато відкритих файлів -$ ENOTTY -25 Це не термінал -$ ETXTBSY -26 Текстовий файл зайнятий -$ EFBIG -27 Файл надто великий -$ ENOSPC -28 Не залишилось місця на пристрої -$ ESPIPE -29 Недозволене позиціонування -$ EROFS -30 Файлова система лише для читання -$ EMLINK -31 Забагато посилань -$ EPIPE -32 Канал зруйновано -$ EDOM -33 Помилка області визначення -$ ERANGE -34 Результат надто великий -$ EAGAIN, EWOULDBLOCK -35 Ресурс тимчасово не доступний -$ EINPROGRESS -36 Операція у процесі виконання -$ EALREADY -37 Операція вже виконується -$ ENOTSOCK -38 Це не сокет -$ EDESTADDRREQ -39 Необхідна адреса призначення -$ EMSGSIZE -40 Повідомлення надто довге -$ EPROTOTYPE -41 Помилковий тип протоколу для сокету -$ ENOPROTOOPT -42 Немає такого протоколу -$ EPROTONOSUPPORT -43 Протокол не підтримується -$ ESOCKTNOSUPPORT -44 Цей тип сокету не підтримується -$ EOPNOTSUPP -45 Операція не підтримується -$ EPFNOSUPPORT -46 Родина протоколів не підтримується -$ EAFNOSUPPORT -47 Родина адрес не підтримується протоколом -$ EADDRINUSE -48 Адреса вже використовується -$ EADDRNOTAVAIL -49 Адреса недосяжна -$ ENETDOWN -50 Мережа не працює -$ ENETUNREACH -51 Мережа недосяжна -$ ENETRESET -52 З'єднання припинено мережею -$ ECONNABORTED -53 З'єднання припинено -$ ECONNRESET -54 З'єднання припинено протилежною стороною -$ ENOBUFS -55 Немає вільних буферів -$ EISCONN -56 Сокет вже під'єднано -$ ENOTCONN -57 Сокет не під'єднано -$ ESHUTDOWN -58 Не можу відіслати після закриття сокету протилежною стороною -$ ETOOMANYREFS -59 Забагато посилань: не можу з'єднати -$ ETIMEDOUT -60 Вийшов ліміт часу для з'єднання -$ ECONNREFUSED -61 Відмова у з'єднанні -$ ELOOP -62 Забагато рівнів символічних посилань -$ ENAMETOOLONG -63 Ім'я файлу надто довге -$ EHOSTDOWN -64 Хост не працює -$ EHOSTUNREACH -65 Хост недосяжний -$ ENOTEMPTY -66 Каталог не порожній -$ EPROCLIM -67 Забагато процесів -$ EUSERS -68 Забагато користувачів -$ EDQUOT -69 Перевищена дискова квота -$ ESTALE -70 Застарілий дескриптор файлу NFS -$ EREMOTE -71 Віддалений об'єкт -$ EBADRPC -72 Погана структура RPC -$ ERPCMISMATCH -73 Невірна версія RPC -$ EPROGUNAVAIL -74 Програма RPC недосяжна -$ EPROGMISMATCH -75 Невірна версія програми -$ EPROCUNAVAIL -76 Погана процедура для програми -$ ENOLCK -77 Блокування не доступне -$ ENOSYS -78 Функцію не реалізовано -$ EFTYPE -79 Непридатний тип чи формат файлу -$ EAUTH -80 Помилка аутентифікації -$ ENEEDAUTH -81 Потрібна аутентифікація -$ EIDRM -82 Ідентифікатор вилучено -$ ENOMSG -83 Немає повідомлення бажаного типу -$ EOVERFLOW -84 Завелике значення для цього типу даних -$ ECANCELED -85 Операцію скасовано -$ EILSEQ -86 Недозволена послідовність байтів -$ ENOATTR -87 Атрибут не знайдено -$ EDOOFUS -88 Помилка програмування -$ EBADMSG -89 Поганий формат повідомлення -$ EMULTIHOP XXX -90 Спроба мултіхопу -$ ENOLINK -91 Мережовий канал розірвано -$ EPROTO -92 Помилка протоколу -$ ENOTCAPABLE -93 Можливості недостатні -$ -$ strsignal() support catalog -$ -$set 2 -$ SIGHUP -1 Відключення -$ SIGINT -2 Переривання -$ SIGQUIT -3 Вихід -$ SIGILL -4 Неприпустима інструкція -$ SIGTRAP -5 Пастка трасування -$ SIGABRT -6 Аварійне завершення -$ SIGEMT -7 Перехоплення емульованої інструкції -$ SIGFPE -8 Помилка роботи з плаваючою крапкою -$ SIGKILL -9 Вбито -$ SIGBUS -10 Помилка шини -$ SIGSEGV -11 Порушення сегментації -$ SIGSYS -12 Поганий системний виклик -$ SIGPIPE -13 Канал зруйновано -$ SIGALRM -14 Таймер вичерпано -$ SIGTERM -15 Завершення -$ SIGURG -16 Невідкладний стан на сокеті -$ SIGSTOP -17 Призупинено (сигнал) -$ SIGTSTP -18 Призупинено -$ SIGCONT -19 Продовження роботи -$ SIGCHLD -20 Зміна статусу дочірнього процесу -$ SIGTTIN -21 Зупинено (ввід з терміналу) -$ SIGTTOU -22 Зупинено (вивід на термінал) -$ SIGIO -23 Ввід-вивід можливий -$ SIGXCPU -24 Перевищено ліміт процесорного часу -$ SIGXFSZ -25 Перевищено ліміт максимального розміру файла -$ SIGVTALRM -26 Віртуальний таймер вичерпано -$ SIGPROF -27 Таймер профілювання вичерпано -$ SIGWINCH -28 Розмір вікна змінено -$ SIGINFO -29 Запит інформації -$ SIGUSR1 -30 Сигнал користувача 1 -$ SIGUSR2 -31 Сигнал користувача 2 +$ $FreeBSD$ +$ +$ Message catalog for uk_UA.UTF-8 locale +$ +$ strerror() support catalog +$ +$set 1 +$ EPERM +1 Операція не дозволена +$ ENOENT +2 Немає такого файлу або каталогу +$ ESRCH +3 Немає такого процесу +$ EINTR +4 Перервано виклик функції +$ EIO +5 Помилка вводу-виводу +$ ENXIO +6 Немає такого пристрою або адреси +$ E2BIG +7 Перелік аргументів надто довгий +$ ENOEXEC +8 Помилка формату виконуваного файлу +$ EBADF +9 Невірний дескриптор файлу +$ ECHILD +10 Немає дочірнього процесу +$ EDEADLK +11 Уникнуто взаємне блокування ресурсів +$ ENOMEM +12 Не достатньо пам'яті +$ EACCES +13 Відмова у доступі +$ EFAULT +14 Невірна адреса +$ ENOTBLK +15 Потрібен блочний пристрій +$ EBUSY +16 Ресурс зайнятий +$ EEXIST +17 Файл вже існує +$ EXDEV +18 Посилання за межі пристрою +$ ENODEV +19 Немає такого пристрою +$ ENOTDIR +20 Це не каталог +$ EISDIR +21 Це каталог +$ EINVAL +22 Недозволений аргумент +$ ENFILE +23 Забагато відкритих файлів у системі +$ EMFILE +24 Забагато відкритих файлів +$ ENOTTY +25 Це не термінал +$ ETXTBSY +26 Текстовий файл зайнятий +$ EFBIG +27 Файл надто великий +$ ENOSPC +28 Не залишилось місця на пристрої +$ ESPIPE +29 Недозволене позиціонування +$ EROFS +30 Файлова система лише для читання +$ EMLINK +31 Забагато посилань +$ EPIPE +32 Канал зруйновано +$ EDOM +33 Помилка області визначення +$ ERANGE +34 Результат надто великий +$ EAGAIN, EWOULDBLOCK +35 Ресурс тимчасово не доступний +$ EINPROGRESS +36 Операція у процесі виконання +$ EALREADY +37 Операція вже виконується +$ ENOTSOCK +38 Це не сокет +$ EDESTADDRREQ +39 Необхідна адреса призначення +$ EMSGSIZE +40 Повідомлення надто довге +$ EPROTOTYPE +41 Помилковий тип протоколу для сокету +$ ENOPROTOOPT +42 Немає такого протоколу +$ EPROTONOSUPPORT +43 Протокол не підтримується +$ ESOCKTNOSUPPORT +44 Цей тип сокету не підтримується +$ EOPNOTSUPP +45 Операція не підтримується +$ EPFNOSUPPORT +46 Родина протоколів не підтримується +$ EAFNOSUPPORT +47 Родина адрес не підтримується протоколом +$ EADDRINUSE +48 Адреса вже використовується +$ EADDRNOTAVAIL +49 Адреса недосяжна +$ ENETDOWN +50 Мережа не працює +$ ENETUNREACH +51 Мережа недосяжна +$ ENETRESET +52 З'єднання припинено мережею +$ ECONNABORTED +53 З'єднання припинено +$ ECONNRESET +54 З'єднання припинено протилежною стороною +$ ENOBUFS +55 Немає вільних буферів +$ EISCONN +56 Сокет вже під'єднано +$ ENOTCONN +57 Сокет не під'єднано +$ ESHUTDOWN +58 Не можу відіслати після закриття сокету протилежною стороною +$ ETOOMANYREFS +59 Забагато посилань: не можу з'єднати +$ ETIMEDOUT +60 Вийшов ліміт часу для з'єднання +$ ECONNREFUSED +61 Відмова у з'єднанні +$ ELOOP +62 Забагато рівнів символічних посилань +$ ENAMETOOLONG +63 Ім'я файлу надто довге +$ EHOSTDOWN +64 Хост не працює +$ EHOSTUNREACH +65 Хост недосяжний +$ ENOTEMPTY +66 Каталог не порожній +$ EPROCLIM +67 Забагато процесів +$ EUSERS +68 Забагато користувачів +$ EDQUOT +69 Перевищена дискова квота +$ ESTALE +70 Застарілий дескриптор файлу NFS +$ EREMOTE +71 Віддалений об'єкт +$ EBADRPC +72 Погана структура RPC +$ ERPCMISMATCH +73 Невірна версія RPC +$ EPROGUNAVAIL +74 Програма RPC недосяжна +$ EPROGMISMATCH +75 Невірна версія програми +$ EPROCUNAVAIL +76 Погана процедура для програми +$ ENOLCK +77 Блокування не доступне +$ ENOSYS +78 Функцію не реалізовано +$ EFTYPE +79 Непридатний тип чи формат файлу +$ EAUTH +80 Помилка аутентифікації +$ ENEEDAUTH +81 Потрібна аутентифікація +$ EIDRM +82 Ідентифікатор вилучено +$ ENOMSG +83 Немає повідомлення бажаного типу +$ EOVERFLOW +84 Завелике значення для цього типу даних +$ ECANCELED +85 Операцію скасовано +$ EILSEQ +86 Недозволена послідовність байтів +$ ENOATTR +87 Атрибут не знайдено +$ EDOOFUS +88 Помилка програмування +$ EBADMSG +89 Поганий формат повідомлення +$ EMULTIHOP XXX +90 Спроба мултіхопу +$ ENOLINK +91 Мережовий канал розірвано +$ EPROTO +92 Помилка протоколу +$ ENOTCAPABLE +93 Можливості недостатні +$ +$ strsignal() support catalog +$ +$set 2 +$ SIGHUP +1 Відключення +$ SIGINT +2 Переривання +$ SIGQUIT +3 Вихід +$ SIGILL +4 Неприпустима інструкція +$ SIGTRAP +5 Пастка трасування +$ SIGABRT +6 Аварійне завершення +$ SIGEMT +7 Перехоплення емульованої інструкції +$ SIGFPE +8 Помилка роботи з плаваючою крапкою +$ SIGKILL +9 Вбито +$ SIGBUS +10 Помилка шини +$ SIGSEGV +11 Порушення сегментації +$ SIGSYS +12 Поганий системний виклик +$ SIGPIPE +13 Канал зруйновано +$ SIGALRM +14 Таймер вичерпано +$ SIGTERM +15 Завершення +$ SIGURG +16 Невідкладний стан на сокеті +$ SIGSTOP +17 Призупинено (сигнал) +$ SIGTSTP +18 Призупинено +$ SIGCONT +19 Продовження роботи +$ SIGCHLD +20 Зміна статусу дочірнього процесу +$ SIGTTIN +21 Зупинено (ввід з терміналу) +$ SIGTTOU +22 Зупинено (вивід на термінал) +$ SIGIO +23 Ввід-вивід можливий +$ SIGXCPU +24 Перевищено ліміт процесорного часу +$ SIGXFSZ +25 Перевищено ліміт максимального розміру файла +$ SIGVTALRM +26 Віртуальний таймер вичерпано +$ SIGPROF +27 Таймер профілювання вичерпано +$ SIGWINCH +28 Розмір вікна змінено +$ SIGINFO +29 Запит інформації +$ SIGUSR1 +30 Сигнал користувача 1 +$ SIGUSR2 +31 Сигнал користувача 2 From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 14:02:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 078AA1065679; Sun, 8 Nov 2009 14:02:55 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAC438FC17; Sun, 8 Nov 2009 14:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA8E2sL2087813; Sun, 8 Nov 2009 14:02:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8E2s04087811; Sun, 8 Nov 2009 14:02:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911081402.nA8E2s04087811@svn.freebsd.org> From: Christian Brueffer Date: Sun, 8 Nov 2009 14:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199046 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 14:02:55 -0000 Author: brueffer Date: Sun Nov 8 14:02:54 2009 New Revision: 199046 URL: http://svn.freebsd.org/changeset/base/199046 Log: Fix a copy+paste error by checking the correct variable against MM_NULLACT. PR: 140386 Submitted by: soulcatcher Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D07A81065670; Sun, 8 Nov 2009 14:33:19 +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 BF4148FC23; Sun, 8 Nov 2009 14:33: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 nA8EXJAa088775; Sun, 8 Nov 2009 14:33:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8EXJnp088767; Sun, 8 Nov 2009 14:33:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911081433.nA8EXJnp088767@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Nov 2009 14:33: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: r199050 - in head/sys: conf dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 14:33:19 -0000 Author: mav Date: Sun Nov 8 14:33:19 2009 New Revision: 199050 URL: http://svn.freebsd.org/changeset/base/199050 Log: Introduce define and kernel option ATA_REQUEST_TIMEOUT to control ATA(4) command timeout. Submitted by: keramida Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-queue.c head/sys/dev/ata/ata-raid.c head/sys/dev/ata/atapi-cd.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/conf/NOTES Sun Nov 8 14:33:19 2009 (r199050) @@ -1715,8 +1715,11 @@ hint.ata.1.irq="15" # # ATA_STATIC_ID: controller numbering is static ie depends on location # else the device numbers are dynamically allocated. +# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request +# before timing out. options ATA_STATIC_ID +#options ATA_REQUEST_TIMEOUT=10 # # Standard floppy disk controllers and floppy tapes, supports Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/conf/options Sun Nov 8 14:33:19 2009 (r199050) @@ -350,6 +350,7 @@ ISCSI_INITIATOR_DEBUG opt_iscsi_initiato # Options used in the 'ata' ATA/ATAPI driver ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h +ATA_REQUEST_TIMEOUT opt_ata.h # Net stuff. ACCEPT_FILTER_DATA Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/dev/ata/ata-all.h Sun Nov 8 14:33:19 2009 (r199050) @@ -345,6 +345,10 @@ struct ata_ahci_cmd_list { #define ATA_OP_FINISHED 1 #define ATA_MAX_28BIT_LBA 268435455UL +#ifndef ATA_REQUEST_TIMEOUT +#define ATA_REQUEST_TIMEOUT 10 +#endif + /* structure used for composite atomic operations */ #define MAX_COMPOSITES 32 /* u_int32_t bits */ struct ata_composite { Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/dev/ata/ata-disk.c Sun Nov 8 14:33:19 2009 (r199050) @@ -230,7 +230,7 @@ ad_spindown(void *priv) } request->dev = dev; request->flags = ATA_R_CONTROL; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 1; request->callback = ad_power_callback; request->u.ata.command = ATA_STANDBY_IMMEDIATE; @@ -262,10 +262,10 @@ ad_strategy(struct bio *bp) if (atadev->spindown_state) { device_printf(dev, "request while spun down, starting.\n"); atadev->spindown_state = 0; - request->timeout = 31; + request->timeout = MAX(ATA_REQUEST_TIMEOUT, 31); } else { - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; } request->retries = 2; request->data = bp->bio_data; @@ -468,7 +468,7 @@ ad_set_geometry(device_t dev) request->u.ata.count = 0; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL | ATA_R_QUIET; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) @@ -487,7 +487,7 @@ ad_set_geometry(device_t dev) request->u.ata.count = 1; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/dev/ata/ata-queue.c Sun Nov 8 14:33:19 2009 (r199050) @@ -141,9 +141,9 @@ ata_controlcmd(device_t dev, u_int8_t co if (atadev->spindown_state) { device_printf(dev, "request while spun down, starting.\n"); atadev->spindown_state = 0; - request->timeout = 31; + request->timeout = MAX(ATA_REQUEST_TIMEOUT, 31); } else { - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; } request->retries = 0; ata_queue_request(request); @@ -397,7 +397,7 @@ ata_completed(void *context, int dummy) request->bytecount = sizeof(struct atapi_sense); request->donecount = 0; request->transfersize = sizeof(struct atapi_sense); - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->flags &= (ATA_R_ATAPI | ATA_R_QUIET | ATA_R_DEBUG); request->flags |= (ATA_R_READ | ATA_R_AT_HEAD | ATA_R_REQUEUE); ATA_DEBUG_RQ(request, "autoissue request sense"); Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/dev/ata/ata-raid.c Sun Nov 8 14:33:19 2009 (r199050) @@ -273,7 +273,7 @@ ata_raid_flush(struct bio *bp) request->u.ata.lba = 0; request->u.ata.count = 0; request->u.ata.feature = 0; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; request->flags |= ATA_R_ORDERED | ATA_R_DIRECT; ata_queue_request(request); @@ -4371,7 +4371,7 @@ ata_raid_init_request(device_t dev, stru return NULL; } request->dev = dev; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 2; request->callback = ata_raid_done; request->driver = rdp; @@ -4445,7 +4445,7 @@ ata_raid_rw(device_t dev, u_int64_t lba, /* setup request */ request->dev = dev; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; request->data = data; request->bytecount = bcount; Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Sun Nov 8 14:28:23 2009 (r199049) +++ head/sys/dev/ata/atapi-cd.c Sun Nov 8 14:33:19 2009 (r199050) @@ -700,7 +700,7 @@ acd_geom_access(struct g_provider *pp, i request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->flags = ATA_R_ATAPI; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; ata_queue_request(request); if (!request->error && (request->u.atapi.sense.key == 2 || From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 14:37:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9043E1065672; Sun, 8 Nov 2009 14:37:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id F02E48FC16; Sun, 8 Nov 2009 14:37:49 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nA8Eaa7v098355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Nov 2009 16:36:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nA8EaZ4p099908; Sun, 8 Nov 2009 16:36:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nA8EaXCm099907; Sun, 8 Nov 2009 16:36:33 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Nov 2009 16:36:33 +0200 From: Kostik Belousov To: Alexander Motin Message-ID: <20091108143633.GR2331@deviant.kiev.zoral.com.ua> References: <200911081433.nA8EXJnp088767@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4nkDkwsKLd7vqNiU" Content-Disposition: inline In-Reply-To: <200911081433.nA8EXJnp088767@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199050 - in head/sys: conf dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 14:37:50 -0000 --4nkDkwsKLd7vqNiU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 08, 2009 at 02:33:19PM +0000, Alexander Motin wrote: > Author: mav > Date: Sun Nov 8 14:33:19 2009 > New Revision: 199050 > URL: http://svn.freebsd.org/changeset/base/199050 >=20 > Log: > Introduce define and kernel option ATA_REQUEST_TIMEOUT to control ATA(4) > command timeout. Why is this a compile-time option ? Having to recompile kernel for this is too much, IMHO. It should be loader tunable + sysctl, isn't it. --4nkDkwsKLd7vqNiU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkr213EACgkQC3+MBN1Mb4jkXgCg5rV2NxHuMHn9ALtgg719WC3v Q40AoJiJAnAReYHSsQQ48XOvWZHVyptD =lOL3 -----END PGP SIGNATURE----- --4nkDkwsKLd7vqNiU-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 14:40:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEC2C10656C3; Sun, 8 Nov 2009 14:40:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2A68FC18; Sun, 8 Nov 2009 14:40:31 +0000 (UTC) Received: by bwz5 with SMTP id 5so2741384bwz.3 for ; Sun, 08 Nov 2009 06:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=8aZYhvglS8bUIjs86om/xkojRMP7nCykcXMjzix/cys=; b=XPKcQMSsg2CVjIB14NB5r/d6R7/PaVSNhbBt3j04caIXF0Cmzg/uR4aWoXoKEZBnHE 77Uz7ZsUWLS2GBr/GuB1jXb3PqZ7HgTcP5HU88tlCF8fAjJYonuQOLy2tlAyS+KIU2f9 6F0cdgepawAOUUj8Ifk/vdGSRBwWNE0HbuvUE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=bQIvLO4TucMTn8oou7bIRhDfOjxv6meVXzRRv2Okt7auJQlIJSQmYLJvT3I1GKpbPQ cty7zbHSNYzj0T6P5X9mTcq+EDjcM5Is9XPZCz0yYgIXDLMFv6Uc4oF6zJ9BimAQYiWo jG5WgZyyNaBBAEpW/XLEdbNZalAzkKvSBhjV8= Received: by 10.204.154.209 with SMTP id p17mr3586396bkw.104.1257691230337; Sun, 08 Nov 2009 06:40:30 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 13sm516963fxm.13.2009.11.08.06.40.29 (version=SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 06:40:29 -0800 (PST) Sender: Alexander Motin Message-ID: <4AF6D85B.4040905@FreeBSD.org> Date: Sun, 08 Nov 2009 16:40:27 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: Kostik Belousov References: <200911081433.nA8EXJnp088767@svn.freebsd.org> <20091108143633.GR2331@deviant.kiev.zoral.com.ua> In-Reply-To: <20091108143633.GR2331@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199050 - in head/sys: conf dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 14:40:32 -0000 Kostik Belousov wrote: > On Sun, Nov 08, 2009 at 02:33:19PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Sun Nov 8 14:33:19 2009 >> New Revision: 199050 >> URL: http://svn.freebsd.org/changeset/base/199050 >> >> Log: >> Introduce define and kernel option ATA_REQUEST_TIMEOUT to control ATA(4) >> command timeout. > > Why is this a compile-time option ? Having to recompile kernel for this > is too much, IMHO. It should be loader tunable + sysctl, isn't it. As I have told once, I think it is not a thing that should be often tuned by end-user, especially in real-time. I just turned it into macro, as some people complain about using numerous equal numeric constants. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 15:20:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8044106566B; Sun, 8 Nov 2009 15:20:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED8E8FC18; Sun, 8 Nov 2009 15:20:09 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nA8FK6w1001393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Nov 2009 17:20:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nA8FK6x4000181; Sun, 8 Nov 2009 17:20:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nA8FK6hJ000180; Sun, 8 Nov 2009 17:20:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Nov 2009 17:20:06 +0200 From: Kostik Belousov To: Alexander Motin Message-ID: <20091108152006.GS2331@deviant.kiev.zoral.com.ua> References: <200911081433.nA8EXJnp088767@svn.freebsd.org> <20091108143633.GR2331@deviant.kiev.zoral.com.ua> <4AF6D85B.4040905@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B9I4cJCE9PLEoxgz" Content-Disposition: inline In-Reply-To: <4AF6D85B.4040905@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199050 - in head/sys: conf dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 15:20:10 -0000 --B9I4cJCE9PLEoxgz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 08, 2009 at 04:40:27PM +0200, Alexander Motin wrote: > Kostik Belousov wrote: > > On Sun, Nov 08, 2009 at 02:33:19PM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Sun Nov 8 14:33:19 2009 > >> New Revision: 199050 > >> URL: http://svn.freebsd.org/changeset/base/199050 > >> > >> Log: > >> Introduce define and kernel option ATA_REQUEST_TIMEOUT to control AT= A(4) > >> command timeout. > >=20 > > Why is this a compile-time option ? Having to recompile kernel for this > > is too much, IMHO. It should be loader tunable + sysctl, isn't it. >=20 > As I have told once, I think it is not a thing that should be often > tuned by end-user, especially in real-time. I just turned it into macro, Absolutely. I agree with that most users never need this tunable. > as some people complain about using numerous equal numeric constants. But, why not be somewhat more friendly to a user that already has a problam, and force him to recompile the kernel only to check whether it helps or not ? --B9I4cJCE9PLEoxgz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkr24aYACgkQC3+MBN1Mb4gMvwCeNjHRt94gy9wvCQTrLeyecrCi ueQAn212MIZ6f44YXQ0gmZwZZatLe3NI =M6r1 -----END PGP SIGNATURE----- --B9I4cJCE9PLEoxgz-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 19:02:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C9B1065679; Sun, 8 Nov 2009 19:02:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 955C58FC1C; Sun, 8 Nov 2009 19:02: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 nA8J2DKE094896; Sun, 8 Nov 2009 19:02:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8J2D9k094894; Sun, 8 Nov 2009 19:02:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200911081902.nA8J2D9k094894@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Nov 2009 19:02: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: r199053 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 19:02:13 -0000 Author: rmacklem Date: Sun Nov 8 19:02:13 2009 New Revision: 199053 URL: http://svn.freebsd.org/changeset/base/199053 Log: Add a check for the connection being shut down to the krpc client just before queuing a request for the connection. The code already had a check for the connection being shut down while the request was queued, but not one for the shut down having been initiated by the server before the request was in the queue. This appears to fix the problem of slow reconnects against an NFS server that drops inactive connections reported by Olaf Seibert, but does not fix the case where the FreeBSD client generates RST segments at about the same time as ACKs. This is still a problem that is being investigated. This patch does not cause a regression for this case. Tested by: Olaf Seibert, Daniel Braniss Reviewed by: dfr MFC after: 5 days Modified: head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Sun Nov 8 17:59:55 2009 (r199052) +++ head/sys/rpc/clnt_vc.c Sun Nov 8 19:02:13 2009 (r199053) @@ -413,6 +413,22 @@ call_again: cr->cr_xid = xid; mtx_lock(&ct->ct_lock); + /* + * Check to see if the other end has already started to close down + * the connection. The upcall will have set ct_error.re_status + * to RPC_CANTRECV if this is the case. + * If the other end starts to close down the connection after this + * point, it will be detected later when cr_error is checked, + * since the request is in the ct_pending queue. + */ + if (ct->ct_error.re_status == RPC_CANTRECV) { + if (errp != &ct->ct_error) { + errp->re_errno = ct->ct_error.re_errno; + errp->re_status = RPC_CANTRECV; + } + stat = RPC_CANTRECV; + goto out; + } TAILQ_INSERT_TAIL(&ct->ct_pending, cr, cr_link); mtx_unlock(&ct->ct_lock); From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 19:59:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D33331065670; Sun, 8 Nov 2009 19:59:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C286F8FC12; Sun, 8 Nov 2009 19:59: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 nA8JxsiA096202; Sun, 8 Nov 2009 19:59:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8Jxso0096200; Sun, 8 Nov 2009 19:59:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911081959.nA8Jxso0096200@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 8 Nov 2009 19:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199054 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 19:59:54 -0000 Author: yongari Date: Sun Nov 8 19:59:54 2009 New Revision: 199054 URL: http://svn.freebsd.org/changeset/base/199054 Log: Partially revert r199035. Revision 1.158 says only lower ten bits of BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it seems the controller maintains 16bits value for the register. However 16bits are still too small to count all dropped packets happened in a second. To get a correct counter we have to read the register in bge_rxeof() which would be too expensive. Pointed out by: bde Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 8 19:02:13 2009 (r199053) +++ head/sys/dev/bge/if_bge.c Sun Nov 8 19:59:54 2009 (r199054) @@ -3289,6 +3289,14 @@ bge_rxeof(struct bge_softc *sc) bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); if (jumbocnt) bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); +#ifdef notyet + /* + * This register wraps very quickly under heavy packet drops. + * If you need correct statistics, you can enable this check. + */ + if (BGE_IS_5705_PLUS(sc)) + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); +#endif return (rx_npkts); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 20:03:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE7A1106566B; Sun, 8 Nov 2009 20:03:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8E78FC1D; Sun, 8 Nov 2009 20:03: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 nA8K3qoR096347; Sun, 8 Nov 2009 20:03:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8K3qe7096339; Sun, 8 Nov 2009 20:03:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082003.nA8K3qe7096339@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 20:03: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: r199055 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 20:03:52 -0000 Author: thompsa Date: Sun Nov 8 20:03:52 2009 New Revision: 199055 URL: http://svn.freebsd.org/changeset/base/199055 Log: - fix refcounting error during data transfer - fix a memory leak on the USB backend - fix invalid pointer computations (in one case memory outside the allocated area was written in LibUSB v1.0) - make sure memory is always initialised, also in failing cases - add missing functions from v1.0.4 PR: usb/140325 Reported by: Robert Jenssen Submitted by: Hans Petter Selasky MFC After: 3 days Modified: head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb10_desc.c head/lib/libusb/libusb10_io.c head/lib/libusb/libusb20.c head/lib/libusb/libusb20_desc.c head/lib/libusb/libusb20_ugen20.c Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb.h Sun Nov 8 20:03:52 2009 (r199055) @@ -271,9 +271,11 @@ typedef struct libusb_control_setup { uint16_t wLength; } libusb_control_setup; +#define LIBUSB_CONTROL_SETUP_SIZE 8 /* bytes */ + typedef struct libusb_iso_packet_descriptor { - unsigned int length; - unsigned int actual_length; + uint32_t length; + uint32_t actual_length; enum libusb_transfer_status status; } libusb_iso_packet_descriptor __aligned(sizeof(void *)); @@ -282,9 +284,9 @@ typedef void (*libusb_transfer_cb_fn) (s typedef struct libusb_transfer { libusb_device_handle *dev_handle; uint8_t flags; - unsigned int endpoint; + uint32_t endpoint; uint8_t type; - unsigned int timeout; + uint32_t timeout; enum libusb_transfer_status status; int length; int actual_length; @@ -320,7 +322,7 @@ int libusb_get_configuration(libusb_devi int libusb_set_configuration(libusb_device_handle * devh, int configuration); int libusb_claim_interface(libusb_device_handle * devh, int interface_number); int libusb_release_interface(libusb_device_handle * devh, int interface_number); -int libusb_reset_device(libusb_device_handle * dev); +int libusb_reset_device(libusb_device_handle * devh); int libusb_kernel_driver_active(libusb_device_handle * devh, int interface); int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface); int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface); @@ -333,7 +335,8 @@ int libusb_get_active_config_descriptor( int libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, struct libusb_config_descriptor **config); int libusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config); void libusb_free_config_descriptor(struct libusb_config_descriptor *config); -int libusb_get_string_descriptor_ascii(libusb_device_handle * dev, uint8_t desc_index, uint8_t *data, int length); +int libusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t desc_index, uint8_t *data, int length); +int libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, uint8_t desc_index, uint8_t *data, int length); /* Asynchronous device I/O */ @@ -341,7 +344,16 @@ struct libusb_transfer *libusb_alloc_tra void libusb_free_transfer(struct libusb_transfer *transfer); int libusb_submit_transfer(struct libusb_transfer *transfer); int libusb_cancel_transfer(struct libusb_transfer *transfer); -uint8_t *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet); +uint8_t *libusb_get_iso_packet_buffer(struct libusb_transfer *transfer, uint32_t index); +uint8_t *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, uint32_t index); +void libusb_set_iso_packet_lengths(struct libusb_transfer *transfer, uint32_t length); +uint8_t *libusb_control_transfer_get_data(struct libusb_transfer *transfer); +struct libusb_control_setup *libusb_control_transfer_get_setup(struct libusb_transfer *transfer); +void libusb_fill_control_setup(uint8_t *buf, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength); +void libusb_fill_control_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t *buf, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout); +void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, int length, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout); +void libusb_fill_interrupt_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, int length, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout); +void libusb_fill_iso_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, int length, int npacket, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout); /* Polling and timing */ @@ -362,9 +374,14 @@ struct libusb_pollfd **libusb_get_pollfd /* Synchronous device I/O */ -int libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength, unsigned int timeout); -int libusb_bulk_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout); -int libusb_interrupt_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout); +int libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength, uint32_t timeout); +int libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, uint32_t timeout); +int libusb_interrupt_transfer(libusb_device_handle * devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, uint32_t timeout); + +/* Byte-order */ + +uint16_t libusb_cpu_to_le16(uint16_t x); +uint16_t libusb_le16_to_cpu(uint16_t x); #if 0 { /* indent fix */ Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb10.c Sun Nov 8 20:03:52 2009 (r199055) @@ -35,6 +35,7 @@ #include #include #include +#include #include "libusb20.h" #include "libusb20_desc.h" @@ -185,8 +186,6 @@ libusb_get_device_list(libusb_context *c /* create libusb v1.0 compliant devices */ i = 0; while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) { - /* get device into libUSB v1.0 list */ - libusb20_be_dequeue_device(usb_backend, pdev); dev = malloc(sizeof(*dev)); if (dev == NULL) { @@ -199,6 +198,10 @@ libusb_get_device_list(libusb_context *c libusb20_be_free(usb_backend); return (LIBUSB_ERROR_NO_MEM); } + + /* get device into libUSB v1.0 list */ + libusb20_be_dequeue_device(usb_backend, pdev); + memset(dev, 0, sizeof(*dev)); /* init transfer queues */ @@ -416,6 +419,8 @@ libusb_close(struct libusb20_device *pde libusb10_remove_pollfd(ctx, &dev->dev_poll); libusb20_dev_close(pdev); + + /* unref will free the "pdev" when the refcount reaches zero */ libusb_unref_device(dev); /* make sure our event loop detects the closed device */ @@ -1195,7 +1200,7 @@ libusb_submit_transfer(struct libusb_tra struct libusb20_transfer *pxfer1; struct libusb_super_transfer *sxfer; struct libusb_device *dev; - unsigned int endpoint; + uint32_t endpoint; int err; if (uxfer == NULL) @@ -1252,7 +1257,7 @@ libusb_cancel_transfer(struct libusb_tra struct libusb20_transfer *pxfer1; struct libusb_super_transfer *sxfer; struct libusb_device *dev; - unsigned int endpoint; + uint32_t endpoint; if (uxfer == NULL) return (LIBUSB_ERROR_INVALID_PARAM); @@ -1312,3 +1317,16 @@ libusb10_cancel_all_transfer(libusb_devi { /* TODO */ } + +uint16_t +libusb_cpu_to_le16(uint16_t x) +{ + return (htole16(x)); +} + +uint16_t +libusb_le16_to_cpu(uint16_t x) +{ + return (le16toh(x)); +} + Modified: head/lib/libusb/libusb10_desc.c ============================================================================== --- head/lib/libusb/libusb10_desc.c Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb10_desc.c Sun Nov 8 20:03:52 2009 (r199055) @@ -35,6 +35,8 @@ #include "libusb.h" #include "libusb10.h" +#define N_ALIGN(n) (-((-(n)) & (-8UL))) + /* USB descriptors */ int @@ -114,17 +116,17 @@ libusb_get_config_descriptor(libusb_devi nalt = nif = pconf->num_interface; nep = 0; - nextra = pconf->extra.len; + nextra = N_ALIGN(pconf->extra.len); for (i = 0; i < nif; i++) { pinf = pconf->interface + i; - nextra += pinf->extra.len; + nextra += N_ALIGN(pinf->extra.len); nep += pinf->num_endpoints; k = pinf->num_endpoints; pend = pinf->endpoints; while (k--) { - nextra += pend->extra.len; + nextra += N_ALIGN(pend->extra.len); pend++; } @@ -132,12 +134,12 @@ libusb_get_config_descriptor(libusb_devi nalt += pinf->num_altsetting; pinf = pinf->altsetting; while (j--) { - nextra += pinf->extra.len; + nextra += N_ALIGN(pinf->extra.len); nep += pinf->num_endpoints; k = pinf->num_endpoints; pend = pinf->endpoints; while (k--) { - nextra += pend->extra.len; + nextra += N_ALIGN(pend->extra.len); pend++; } pinf++; @@ -150,17 +152,18 @@ libusb_get_config_descriptor(libusb_devi (nalt * sizeof(libusb_interface_descriptor)) + (nep * sizeof(libusb_endpoint_descriptor)); + nextra = N_ALIGN(nextra); + pconfd = malloc(nextra); if (pconfd == NULL) { free(pconf); return (LIBUSB_ERROR_NO_MEM); } - /* make sure memory is clean */ + /* make sure memory is initialised */ memset(pconfd, 0, nextra); - pconfd->interface = (libusb_interface *) (pconfd + - sizeof(libusb_config_descriptor)); + pconfd->interface = (libusb_interface *) (pconfd + 1); ifd = (libusb_interface_descriptor *) (pconfd->interface + nif); endd = (libusb_endpoint_descriptor *) (ifd + nalt); @@ -181,7 +184,7 @@ libusb_get_config_descriptor(libusb_devi pconfd->extra_length = pconf->extra.len; pconfd->extra = pextra; memcpy(pextra, pconf->extra.ptr, pconfd->extra_length); - pextra += pconfd->extra_length; + pextra += N_ALIGN(pconfd->extra_length); } /* setup all interface and endpoint pointers */ @@ -221,7 +224,7 @@ libusb_get_config_descriptor(libusb_devi ifd->extra_length = pinf->extra.len; ifd->extra = pextra; memcpy(pextra, pinf->extra.ptr, pinf->extra.len); - pextra += pinf->extra.len; + pextra += N_ALIGN(pinf->extra.len); } for (k = 0; k < pinf->num_endpoints; k++) { pend = &pinf->endpoints[k]; @@ -238,7 +241,7 @@ libusb_get_config_descriptor(libusb_devi endd->extra_length = pend->extra.len; endd->extra = pextra; memcpy(pextra, pend->extra.ptr, pend->extra.len); - pextra += pend->extra.len; + pextra += N_ALIGN(pend->extra.len); } } } @@ -304,3 +307,12 @@ libusb_get_string_descriptor_ascii(libus return (LIBUSB_ERROR_OTHER); } + +int +libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, + uint8_t desc_index, uint8_t *data, int length) +{ + return (libusb_control_transfer(devh, LIBUSB_ENDPOINT_IN, + LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data, + length, 1000)); +} Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb10_io.c Sun Nov 8 20:03:52 2009 (r199055) @@ -32,6 +32,7 @@ #include #include #include +#include #include "libusb20.h" #include "libusb20_desc.h" @@ -148,19 +149,19 @@ libusb10_handle_events_sub(struct libusb goto do_done; } for (i = 0; i != nfds; i++) { - if (fds[i].revents == 0) - continue; if (ppdev[i] != NULL) { dev = libusb_get_device(ppdev[i]); - err = libusb20_dev_process(ppdev[i]); + if (fds[i].revents == 0) + err = 0; /* nothing to do */ + else + err = libusb20_dev_process(ppdev[i]); + if (err) { /* cancel all transfers - device is gone */ libusb10_cancel_all_transfer(dev); - /* - * make sure we don't go into an infinite - * loop - */ + + /* remove USB device from polling loop */ libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); } CTX_UNLOCK(ctx); @@ -573,3 +574,160 @@ libusb_interrupt_transfer(libusb_device_ DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer leave"); return (ret); } + +uint8_t * +libusb_get_iso_packet_buffer(struct libusb_transfer *transfer, uint32_t index) +{ + uint8_t *ptr; + uint32_t n; + + if (transfer->num_iso_packets < 0) + return (NULL); + + if (index >= (uint32_t)transfer->num_iso_packets) + return (NULL); + + ptr = transfer->buffer; + if (ptr == NULL) + return (NULL); + + for (n = 0; n != index; n++) { + ptr += transfer->iso_packet_desc[n].length; + } + return (ptr); +} + +uint8_t * +libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, uint32_t index) +{ + uint8_t *ptr; + + if (transfer->num_iso_packets < 0) + return (NULL); + + if (index >= (uint32_t)transfer->num_iso_packets) + return (NULL); + + ptr = transfer->buffer; + if (ptr == NULL) + return (NULL); + + ptr += transfer->iso_packet_desc[0].length * index; + + return (ptr); +} + +void +libusb_set_iso_packet_lengths(struct libusb_transfer *transfer, uint32_t length) +{ + int n; + + if (transfer->num_iso_packets < 0) + return; + + for (n = 0; n != transfer->num_iso_packets; n++) + transfer->iso_packet_desc[n].length = length; +} + +uint8_t * +libusb_control_transfer_get_data(struct libusb_transfer *transfer) +{ + if (transfer->buffer == NULL) + return (NULL); + + return (transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE); +} + +struct libusb_control_setup * +libusb_control_transfer_get_setup(struct libusb_transfer *transfer) +{ + return ((struct libusb_control_setup *)transfer->buffer); +} + +void +libusb_fill_control_setup(uint8_t *buf, uint8_t bmRequestType, + uint8_t bRequest, uint16_t wValue, + uint16_t wIndex, uint16_t wLength) +{ + struct libusb_control_setup *req = (struct libusb_control_setup *)buf; + + /* The alignment is OK for all fields below. */ + req->bmRequestType = bmRequestType; + req->bRequest = bRequest; + req->wValue = htole16(wValue); + req->wIndex = htole16(wIndex); + req->wLength = htole16(wLength); +} + +void +libusb_fill_control_transfer(struct libusb_transfer *transfer, + libusb_device_handle *devh, uint8_t *buf, + libusb_transfer_cb_fn callback, void *user_data, + uint32_t timeout) +{ + struct libusb_control_setup *setup = (struct libusb_control_setup *)buf; + + transfer->dev_handle = devh; + transfer->endpoint = 0; + transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL; + transfer->timeout = timeout; + transfer->buffer = buf; + if (setup != NULL) + transfer->length = LIBUSB_CONTROL_SETUP_SIZE + + le16toh(setup->wLength); + else + transfer->length = 0; + transfer->user_data = user_data; + transfer->callback = callback; + +} + +void +libusb_fill_bulk_transfer(struct libusb_transfer *transfer, + libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, + int length, libusb_transfer_cb_fn callback, void *user_data, + uint32_t timeout) +{ + transfer->dev_handle = devh; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_BULK; + transfer->timeout = timeout; + transfer->buffer = buf; + transfer->length = length; + transfer->user_data = user_data; + transfer->callback = callback; +} + +void +libusb_fill_interrupt_transfer(struct libusb_transfer *transfer, + libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, + int length, libusb_transfer_cb_fn callback, void *user_data, + uint32_t timeout) +{ + transfer->dev_handle = devh; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT; + transfer->timeout = timeout; + transfer->buffer = buf; + transfer->length = length; + transfer->user_data = user_data; + transfer->callback = callback; +} + +void +libusb_fill_iso_transfer(struct libusb_transfer *transfer, + libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, + int length, int npacket, libusb_transfer_cb_fn callback, + void *user_data, uint32_t timeout) +{ + transfer->dev_handle = devh; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS; + transfer->timeout = timeout; + transfer->buffer = buf; + transfer->length = length; + transfer->num_iso_packets = npacket; + transfer->user_data = user_data; + transfer->callback = callback; +} + Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb20.c Sun Nov 8 20:03:52 2009 (r199055) @@ -630,6 +630,9 @@ libusb20_dev_req_string_sync(struct libu struct LIBUSB20_CONTROL_SETUP_DECODED req; int error; + /* make sure memory is initialised */ + memset(ptr, 0, len); + if (len < 4) { /* invalid length */ return (LIBUSB20_ERROR_INVALID_PARAM); @@ -1093,7 +1096,8 @@ libusb20_be_free(struct libusb20_backend if (pbe->methods->exit_backend) { pbe->methods->exit_backend(pbe); } - return; + /* free backend */ + free(pbe); } void @@ -1101,7 +1105,6 @@ libusb20_be_enqueue_device(struct libusb { pdev->beMethods = pbe->methods; /* copy backend methods */ TAILQ_INSERT_TAIL(&(pbe->usb_devs), pdev, dev_entry); - return; } void @@ -1109,5 +1112,4 @@ libusb20_be_dequeue_device(struct libusb struct libusb20_device *pdev) { TAILQ_REMOVE(&(pbe->usb_devs), pdev, dev_entry); - return; } Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb20_desc.c Sun Nov 8 20:03:52 2009 (r199055) @@ -118,6 +118,9 @@ libusb20_parse_config_desc(const void *c if (lub_config == NULL) { return (NULL); /* out of memory */ } + /* make sure memory is initialised */ + memset(lub_config, 0, size); + lub_interface = (void *)(lub_config + 1); lub_alt_interface = (void *)(lub_interface + niface_no_alt); lub_endpoint = (void *)(lub_interface + niface); Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Sun Nov 8 19:59:54 2009 (r199054) +++ head/lib/libusb/libusb20_ugen20.c Sun Nov 8 20:03:52 2009 (r199055) @@ -449,6 +449,8 @@ ugen20_get_config_desc_full(struct libus uint16_t len; int error; + /* make sure memory is initialised */ + memset(&cdesc, 0, sizeof(cdesc)); memset(&gen_desc, 0, sizeof(gen_desc)); gen_desc.ugd_data = &cdesc; @@ -468,6 +470,10 @@ ugen20_get_config_desc_full(struct libus if (!ptr) { return (LIBUSB20_ERROR_NO_MEM); } + + /* make sure memory is initialised */ + memset(ptr, 0, len); + gen_desc.ugd_data = ptr; gen_desc.ugd_maxlen = len; From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 20:44:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4524B106568B; Sun, 8 Nov 2009 20:44:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340D58FC1F; Sun, 8 Nov 2009 20:44: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 nA8KiuY8097257; Sun, 8 Nov 2009 20:44:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8Kius8097253; Sun, 8 Nov 2009 20:44:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082044.nA8Kius8097253@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 20:44: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: r199057 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 20:44:56 -0000 Author: thompsa Date: Sun Nov 8 20:44:55 2009 New Revision: 199057 URL: http://svn.freebsd.org/changeset/base/199057 Log: ehci_init() will do reset and set the usbrev flag. Fix problem where ehci_reset() was called before ehci_init(). PR: usb/140242 Submitted by: Sebastian Huber Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mbus.c head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_ixp4xx.c Sun Nov 8 20:17:15 2009 (r199056) +++ head/sys/dev/usb/controller/ehci_ixp4xx.c Sun Nov 8 20:44:55 2009 (r199057) @@ -157,8 +157,6 @@ ehci_ixp_attach(device_t self) return (ENOMEM); } - sc->sc_bus.usbrev = USB_REV_2_0; - /* NB: hints fix the memory location and irq */ rid = 0; @@ -230,7 +228,6 @@ ehci_ixp_attach(device_t self) | EHCI_SCFLG_BIGEMMIO | EHCI_SCFLG_NORESTERM ; - (void) ehci_reset(sc); err = ehci_init(sc); if (!err) { Modified: head/sys/dev/usb/controller/ehci_mbus.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mbus.c Sun Nov 8 20:17:15 2009 (r199056) +++ head/sys/dev/usb/controller/ehci_mbus.c Sun Nov 8 20:44:55 2009 (r199057) @@ -166,8 +166,6 @@ ehci_mbus_attach(device_t self) return (ENOMEM); } - sc->sc_bus.usbrev = USB_REV_2_0; - rid = 0; sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->sc_io_res) { Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sun Nov 8 20:17:15 2009 (r199056) +++ head/sys/dev/usb/controller/ehci_pci.c Sun Nov 8 20:44:55 2009 (r199057) @@ -318,13 +318,11 @@ ehci_pci_attach(device_t self) device_printf(self, "pre-2.0 USB revision (ignored)\n"); /* fallthrough */ case PCI_USB_REV_2_0: - sc->sc_bus.usbrev = USB_REV_2_0; break; default: /* Quirk for Parallels Desktop 4.0 */ device_printf(self, "USB revision is unknown. Assuming v2.0.\n"); - sc->sc_bus.usbrev = USB_REV_2_0; - break; + break; } rid = PCI_CBMEM; From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 20:51:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECE74106566B; Sun, 8 Nov 2009 20:51:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB87C8FC1A; Sun, 8 Nov 2009 20:51: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 nA8KpFqj097436; Sun, 8 Nov 2009 20:51:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8KpF63097431; Sun, 8 Nov 2009 20:51:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082051.nA8KpF63097431@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 20:51: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: r199058 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 20:51:16 -0000 Author: thompsa Date: Sun Nov 8 20:51:15 2009 New Revision: 199058 URL: http://svn.freebsd.org/changeset/base/199058 Log: Integrate lost interrupts patch from the old USB stack. Some EHCI chips from VIA / ATI seem to trigger interrupts before writing back the qTD status, or miss signalling occasionally under heavy load. If the host machine is too fast, we can miss transaction completion - when we scan the active list the transaction still seems to be active. This generally exhibits itself as a umass stall that never recovers. We work around this behaviour by setting up this callback after any softintr that completes with transactions still pending, giving us another chance to check for completion after the writeback has taken place Submitted by: Alexander Nedotsuko MFC after: 3 days Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Nov 8 20:44:55 2009 (r199057) +++ head/sys/dev/usb/controller/ehci.c Sun Nov 8 20:51:15 2009 (r199058) @@ -113,10 +113,12 @@ extern struct usb_pipe_methods ehci_devi extern struct usb_pipe_methods ehci_device_isoc_fs_methods; extern struct usb_pipe_methods ehci_device_isoc_hs_methods; -static void ehci_do_poll(struct usb_bus *bus); -static void ehci_device_done(struct usb_xfer *xfer, usb_error_t error); -static uint8_t ehci_check_transfer(struct usb_xfer *xfer); -static void ehci_timeout(void *arg); +static void ehci_do_poll(struct usb_bus *); +static void ehci_device_done(struct usb_xfer *, usb_error_t); +static uint8_t ehci_check_transfer(struct usb_xfer *); +static void ehci_timeout(void *); +static void ehci_poll_timeout(void *); + static void ehci_root_intr(ehci_softc_t *sc); struct ehci_std_temp { @@ -243,6 +245,7 @@ ehci_init(ehci_softc_t *sc) DPRINTF("start\n"); usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0); + usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0); #if USB_DEBUG if (ehcidebug > 2) { @@ -520,6 +523,7 @@ ehci_detach(ehci_softc_t *sc) USB_BUS_LOCK(&sc->sc_bus); usb_callout_stop(&sc->sc_tmo_pcd); + usb_callout_stop(&sc->sc_tmo_poll); EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); USB_BUS_UNLOCK(&sc->sc_bus); @@ -532,6 +536,7 @@ ehci_detach(ehci_softc_t *sc) usb_pause_mtx(NULL, hz / 20); usb_callout_drain(&sc->sc_tmo_pcd); + usb_callout_drain(&sc->sc_tmo_poll); } void @@ -1472,6 +1477,28 @@ repeat: } } +/* + * Some EHCI chips from VIA / ATI seem to trigger interrupts before + * writing back the qTD status, or miss signalling occasionally under + * heavy load. If the host machine is too fast, we can miss + * transaction completion - when we scan the active list the + * transaction still seems to be active. This generally exhibits + * itself as a umass stall that never recovers. + * + * We work around this behaviour by setting up this callback after any + * softintr that completes with transactions still pending, giving us + * another chance to check for completion after the writeback has + * taken place. + */ +static void +ehci_poll_timeout(void *arg) +{ + ehci_softc_t *sc = arg; + + DPRINTFN(3, "\n"); + ehci_interrupt_poll(sc); +} + /*------------------------------------------------------------------------* * ehci_interrupt - EHCI interrupt handler * @@ -1539,6 +1566,11 @@ ehci_interrupt(ehci_softc_t *sc) /* poll all the USB transfers */ ehci_interrupt_poll(sc); + if (sc->sc_flags & EHCI_SCFLG_LOSTINTRBUG) { + usb_callout_reset(&sc->sc_tmo_poll, hz / 128, + (void *)&ehci_poll_timeout, sc); + } + done: USB_BUS_UNLOCK(&sc->sc_bus); } Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Sun Nov 8 20:44:55 2009 (r199057) +++ head/sys/dev/usb/controller/ehci.h Sun Nov 8 20:51:15 2009 (r199058) @@ -321,6 +321,7 @@ typedef struct ehci_softc { struct ehci_hw_softc sc_hw; struct usb_bus sc_bus; /* base device */ struct usb_callout sc_tmo_pcd; + struct usb_callout sc_tmo_poll; union ehci_hub_desc sc_hub_desc; struct usb_device *sc_devices[EHCI_MAX_DEVICES]; @@ -348,6 +349,7 @@ typedef struct ehci_softc { #define EHCI_SCFLG_BIGEDESC 0x0008 /* big-endian byte order descriptors */ #define EHCI_SCFLG_BIGEMMIO 0x0010 /* big-endian byte order MMIO */ #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ +#define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ uint8_t sc_offs; /* offset to operational registers */ uint8_t sc_doorbell_disable; /* set on doorbell failure */ Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sun Nov 8 20:44:55 2009 (r199057) +++ head/sys/dev/usb/controller/ehci_pci.c Sun Nov 8 20:51:15 2009 (r199058) @@ -439,6 +439,19 @@ ehci_pci_attach(device_t self) break; } + /* Dropped interrupts workaround */ + switch (pci_get_vendor(self)) { + case PCI_EHCI_VENDORID_ATI: + case PCI_EHCI_VENDORID_VIA: + sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG; + if (bootverbose) + device_printf(self, + "Dropped interrupts workaround enabled\n"); + break; + default: + break; + } + err = ehci_init(sc); if (!err) { err = device_probe_and_attach(sc->sc_bus.bdev); From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 20:54:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7582D1065679; Sun, 8 Nov 2009 20:54:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 641A58FC0A; Sun, 8 Nov 2009 20:54: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 nA8Ks3mc097601; Sun, 8 Nov 2009 20:54:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8Ks30X097596; Sun, 8 Nov 2009 20:54:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082054.nA8Ks30X097596@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 20:54: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: r199059 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 20:54:03 -0000 Author: thompsa Date: Sun Nov 8 20:54:03 2009 New Revision: 199059 URL: http://svn.freebsd.org/changeset/base/199059 Log: improve support for high speed isochronous endpoints which does not run 1:1, but needs intervalling 1:2, 1:4 or 1:8 Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Nov 8 20:51:15 2009 (r199058) +++ head/sys/dev/usb/controller/ehci.c Sun Nov 8 20:54:03 2009 (r199059) @@ -2140,7 +2140,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", xfer, xfer->endpoint); - while (nframes--) { + while (nframes) { if (td == NULL) { panic("%s:%d: out of TD's\n", __FUNCTION__, __LINE__); @@ -2162,21 +2162,26 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru DPRINTFN(2, "status=0x%08x, len=%u\n", status, len); - if (*plen >= len) { - /* - * The length is valid. NOTE: The complete - * length is written back into the status - * field, and not the remainder like with - * other transfer descriptor types. - */ - } else { - /* Invalid length - truncate */ - len = 0; - } + if (xfer->usb_smask & (1 << td_no)) { - *plen = len; + if (*plen >= len) { + /* + * The length is valid. NOTE: The + * complete length is written back + * into the status field, and not the + * remainder like with other transfer + * descriptor types. + */ + } else { + /* Invalid length - truncate */ + len = 0; + } + + *plen = len; + plen++; + nframes--; + } - plen++; td_no++; if ((td_no == 8) || (nframes == 0)) { @@ -2393,10 +2398,9 @@ static void ehci_device_intr_close(struct usb_xfer *xfer) { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - uint8_t slot; - slot = usb_intr_schedule_adjust - (xfer->xroot->udev, -(xfer->max_frame_size), xfer->usb_uframe); + usb_intr_schedule_adjust(xfer->xroot->udev, + -(xfer->max_frame_size), xfer->usb_uframe); sc->sc_intr_stat[xfer->qh_pos]--; @@ -2722,6 +2726,28 @@ ehci_device_isoc_hs_open(struct usb_xfer ehci_itd_t *td; uint32_t temp; uint8_t ds; + uint8_t slot; + + slot = usb_intr_schedule_adjust(xfer->xroot->udev, xfer->max_frame_size, + USB_HS_MICRO_FRAMES_MAX); + + xfer->usb_uframe = slot; + xfer->usb_cmask = 0; + + switch (usbd_xfer_get_fps_shift(xfer)) { + case 0: + xfer->usb_smask = 0xFF; + break; + case 1: + xfer->usb_smask = 0x55 << (slot & 1); + break; + case 2: + xfer->usb_smask = 0x11 << (slot & 3); + break; + default: + xfer->usb_smask = 0x01 << (slot & 7); + break; + } /* initialize all TD's */ @@ -2765,6 +2791,10 @@ ehci_device_isoc_hs_open(struct usb_xfer static void ehci_device_isoc_hs_close(struct usb_xfer *xfer) { + + usb_intr_schedule_adjust(xfer->xroot->udev, + -(xfer->max_frame_size), xfer->usb_uframe); + ehci_device_done(xfer, USB_ERR_CANCELLED); } @@ -2854,7 +2884,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe xfer->qh_pos = xfer->endpoint->isoc_next; - while (nframes--) { + while (nframes) { if (td == NULL) { panic("%s:%d: out of TD's\n", __FUNCTION__, __LINE__); @@ -2874,13 +2904,21 @@ ehci_device_isoc_hs_enter(struct usb_xfe #endif *plen = xfer->max_frame_size; } - status = (EHCI_ITD_SET_LEN(*plen) | - EHCI_ITD_ACTIVE | - EHCI_ITD_SET_PG(0)); - td->itd_status[td_no] = htohc32(sc, status); - itd_offset[td_no] = buf_offset; - buf_offset += *plen; - plen++; + + if (xfer->usb_smask & (1 << td_no)) { + status = (EHCI_ITD_SET_LEN(*plen) | + EHCI_ITD_ACTIVE | + EHCI_ITD_SET_PG(0)); + td->itd_status[td_no] = htohc32(sc, status); + itd_offset[td_no] = buf_offset; + buf_offset += *plen; + plen++; + nframes --; + } else { + td->itd_status[td_no] = 0; /* not active */ + itd_offset[td_no] = buf_offset; + } + td_no++; if ((td_no == 8) || (nframes == 0)) { @@ -2937,7 +2975,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe } /* set IOC bit if we are complete */ if (nframes == 0) { - td->itd_status[7] |= htohc32(sc, EHCI_ITD_IOC); + td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); #if USB_DEBUG @@ -3583,7 +3621,8 @@ ehci_xfer_setup(struct usb_setup_params usbd_transfer_setup_sub(parm); - nitd = (xfer->nframes + 7) / 8; + nitd = ((xfer->nframes + 7) / 8) << + usbd_xfer_get_fps_shift(xfer); } else { Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Sun Nov 8 20:51:15 2009 (r199058) +++ head/sys/dev/usb/usb_core.h Sun Nov 8 20:54:03 2009 (r199059) @@ -165,6 +165,7 @@ struct usb_xfer { uint8_t usb_cmask; uint8_t usb_uframe; uint8_t usb_state; + uint8_t fps_shift; /* down shift of FPS, 0..3 */ usb_error_t error; Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sun Nov 8 20:51:15 2009 (r199058) +++ head/sys/dev/usb/usb_transfer.c Sun Nov 8 20:54:03 2009 (r199059) @@ -416,9 +416,15 @@ usbd_transfer_setup_sub(struct usb_setup case USB_SPEED_LOW: case USB_SPEED_FULL: frame_limit = USB_MAX_FS_ISOC_FRAMES_PER_XFER; + xfer->fps_shift = 0; break; default: frame_limit = USB_MAX_HS_ISOC_FRAMES_PER_XFER; + xfer->fps_shift = edesc->bInterval; + if (xfer->fps_shift > 0) + xfer->fps_shift--; + if (xfer->fps_shift > 3) + xfer->fps_shift = 3; break; } @@ -1826,6 +1832,23 @@ usbd_xfer_get_frame(struct usb_xfer *xfe return (&xfer->frbuffers[frindex]); } +/*------------------------------------------------------------------------* + * usbd_xfer_get_fps_shift + * + * The following function is only useful for isochronous transfers. It + * returns how many times the frame execution rate has been shifted + * down. + * + * Return value: + * Success: 0..3 + * Failure: 0 + *------------------------------------------------------------------------*/ +uint8_t +usbd_xfer_get_fps_shift(struct usb_xfer *xfer) +{ + return (xfer->fps_shift); +} + usb_frlength_t usbd_xfer_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex) { Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sun Nov 8 20:51:15 2009 (r199058) +++ head/sys/dev/usb/usbdi.h Sun Nov 8 20:54:03 2009 (r199059) @@ -478,6 +478,7 @@ void usbd_xfer_set_frame_offset(struct u usb_frlength_t usbd_xfer_max_len(struct usb_xfer *xfer); usb_frlength_t usbd_xfer_max_framelen(struct usb_xfer *xfer); usb_frcount_t usbd_xfer_max_frames(struct usb_xfer *xfer); +uint8_t usbd_xfer_get_fps_shift(struct usb_xfer *xfer); usb_frlength_t usbd_xfer_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex); void usbd_xfer_set_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex, From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 21:00:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D1FB1065697; Sun, 8 Nov 2009 21:00:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73FA08FC1C; Sun, 8 Nov 2009 21:00: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 nA8L0oM5097807; Sun, 8 Nov 2009 21:00:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8L0o9w097805; Sun, 8 Nov 2009 21:00:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082100.nA8L0o9w097805@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 21: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: r199060 - head/sys/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 21:00:50 -0000 Author: thompsa Date: Sun Nov 8 21:00:50 2009 New Revision: 199060 URL: http://svn.freebsd.org/changeset/base/199060 Log: Improve support for High-speed USB audio devices. - fix issues regarding the mixer, where the interface number was not set in time. - fix wrong use of resolution parameter. Submitted by: Hans Petter Selasky Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Sun Nov 8 20:54:03 2009 (r199059) +++ head/sys/dev/sound/usb/uaudio.c Sun Nov 8 21:00:50 2009 (r199060) @@ -105,10 +105,9 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def &uaudio_default_channels, 0, "uaudio default sample channels"); #endif -#define UAUDIO_MINFRAMES 16 /* must be factor of 8 due HS-USB */ +#define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 24 /* rounds */ -#define UAUDIO_MINFRAMES_ALIGN(x) ((x) & ~(UAUDIO_MINFRAMES - 1)) #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) @@ -119,7 +118,7 @@ struct uaudio_mixer_node { int32_t maxval; #define MIX_MAX_CHAN 8 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ - uint32_t delta; + uint32_t mod; /* modulus */ uint32_t mul; uint32_t ctl; @@ -169,7 +168,7 @@ struct uaudio_chan { * buffer */ uint32_t intr_size; /* in bytes */ - uint32_t block_size; + uint32_t intr_frames; /* in units */ uint32_t sample_rate; uint32_t format; uint32_t pcm_format[2]; @@ -410,7 +409,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, @@ -420,7 +419,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, @@ -433,7 +432,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, @@ -443,7 +442,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, @@ -506,7 +505,6 @@ static const struct usb_config .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, .bufsize = sizeof(struct usb_device_request), - .flags = {}, .callback = &umidi_write_clear_stall_callback, .timeout = 1000, /* 1 second */ .interval = 50, /* 50ms */ @@ -517,7 +515,6 @@ static const struct usb_config .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, .bufsize = sizeof(struct usb_device_request), - .flags = {}, .callback = &umidi_read_clear_stall_callback, .timeout = 1000, /* 1 second */ .interval = 50, /* 50ms */ @@ -577,6 +574,8 @@ uaudio_attach(device_t dev) sc->sc_play_chan.priv_sc = sc; sc->sc_rec_chan.priv_sc = sc; sc->sc_udev = uaa->device; + sc->sc_mixer_iface_index = uaa->info.bIfaceIndex; + sc->sc_mixer_iface_no = uaa->info.bIfaceNum; if (usb_test_quirk(uaa, UQ_AUDIO_SWAP_LR)) sc->sc_uq_audio_swap_lr = 1; @@ -600,9 +599,6 @@ uaudio_attach(device_t dev) uaudio_mixer_fill_info(sc, uaa->device, id); - sc->sc_mixer_iface_index = uaa->info.bIfaceIndex; - sc->sc_mixer_iface_no = uaa->info.bIfaceNum; - DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); @@ -1119,34 +1115,11 @@ done: * next audio transfer. */ static void -uaudio_setup_blockcount(struct uaudio_chan *ch, usb_frcount_t max_frames, +uaudio_setup_blockcount(struct uaudio_chan *ch, uint32_t *total, uint32_t *blockcount) { - uint32_t temp; - uint32_t isiz; - - /* allow dynamic sizing of play buffer */ - isiz = ch->intr_size; - - /* allow dynamic sizing of play buffer */ - temp = isiz / ch->bytes_per_frame; - - /* align units */ - temp = UAUDIO_MINFRAMES_ALIGN(temp); - - /* range check - min */ - if (temp == 0) - temp = UAUDIO_MINFRAMES; - - /* range check - max */ - if (temp > max_frames) - temp = max_frames; - - /* store blockcount */ - *blockcount = temp; - - /* compute the total length */ - *total = temp * ch->bytes_per_frame; + *total = ch->intr_size; + *blockcount = ch->intr_frames; } static void @@ -1162,8 +1135,12 @@ uaudio_chan_play_callback(struct usb_xfe usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); - uaudio_setup_blockcount(ch, usbd_xfer_max_frames(xfer), - &total, &blockcount); + uaudio_setup_blockcount(ch, &total, &blockcount); + + if (ch->end == ch->start) { + DPRINTF("no buffer!\n"); + return; + } switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -1187,10 +1164,6 @@ tr_transferred: for (n = 0; n != blockcount; n++) usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame); - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - break; - } DPRINTFN(6, "transfer %d bytes\n", total); offset = 0; @@ -1235,17 +1208,23 @@ uaudio_chan_record_callback(struct usb_x uint32_t blockcount; uint32_t offset0; uint32_t offset1; + uint32_t mfl; int len; - int actlen, nframes; + int actlen; + int nframes; usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); + mfl = usbd_xfer_max_framelen(xfer); - uaudio_setup_blockcount(ch, usbd_xfer_max_frames(xfer), - &total, &blockcount); + uaudio_setup_blockcount(ch, &total, &blockcount); + + if (ch->end == ch->start) { + DPRINTF("no buffer!\n"); + return; + } switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -tr_transferred: if (actlen < total) { DPRINTF("short transfer, " "%d of %d bytes\n", actlen, total); @@ -1254,11 +1233,11 @@ tr_transferred: } offset0 = 0; + pc = usbd_xfer_get_frame(xfer, 0); for (n = 0; n != nframes; n++) { offset1 = offset0; - pc = usbd_xfer_get_frame(xfer, 0); len = usbd_xfer_frame_len(xfer, n); while (len > 0) { @@ -1279,36 +1258,26 @@ tr_transferred: } } - offset0 += ch->bytes_per_frame; + offset0 += mfl; } chn_intr(ch->pcm_ch); case USB_ST_SETUP: - if (ch->bytes_per_frame > usbd_xfer_max_framelen(xfer)) { - DPRINTF("bytes per transfer, %d, " - "exceeds maximum, %d!\n", - ch->bytes_per_frame, - usbd_xfer_max_framelen(xfer)); - return; - } +tr_setup: usbd_xfer_set_frames(xfer, blockcount); for (n = 0; n < blockcount; n++) { - usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame); + usbd_xfer_set_frame_len(xfer, n, mfl); } - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - return; - } usbd_transfer_submit(xfer); - return; + break; default: /* Error */ if (error == USB_ERR_CANCELLED) { - return; + break; } - goto tr_transferred; + goto tr_setup; } } @@ -1319,38 +1288,26 @@ uaudio_chan_init(struct uaudio_softc *sc struct uaudio_chan *ch = ((dir == PCMDIR_PLAY) ? &sc->sc_play_chan : &sc->sc_rec_chan); uint32_t buf_size; + uint32_t frames; uint8_t endpoint; + uint8_t blocks; uint8_t iface_index; uint8_t alt_index; + uint8_t fps_shift; usb_error_t err; - /* compute required buffer size */ - buf_size = (ch->bytes_per_frame * UAUDIO_MINFRAMES); - - /* setup interrupt interval */ - ch->intr_size = buf_size; + if (usbd_get_isoc_fps(sc->sc_udev) < 8000) { + /* FULL speed USB */ + frames = 8; + } else { + /* HIGH speed USB */ + frames = UAUDIO_NFRAMES; + } - /* double buffering */ - buf_size *= 2; + /* compute required buffer size */ - ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); - if (ch->buf == NULL) { - goto error; - } - if (sndbuf_setup(b, ch->buf, buf_size) != 0) { - goto error; - } - ch->start = ch->buf; - ch->end = ch->buf + buf_size; - ch->cur = ch->buf; - ch->pcm_ch = c; - ch->pcm_mtx = c->lock; - ch->pcm_buf = b; + buf_size = (ch->bytes_per_frame * frames); - if (ch->pcm_mtx == NULL) { - DPRINTF("ERROR: PCM channels does not have a mutex!\n"); - goto error; - } /* setup play/record format */ ch->pcm_cap.fmtlist = ch->pcm_format; @@ -1370,7 +1327,6 @@ uaudio_chan_init(struct uaudio_softc *sc ch->pcm_cap.fmtlist[1] = 0; - /* set alternate interface corresponding to the mode */ endpoint = ch->p_ed1->bEndpointAddress; @@ -1407,6 +1363,43 @@ uaudio_chan_init(struct uaudio_softc *sc DPRINTF("could not allocate USB transfers!\n"); goto error; } + + fps_shift = usbd_xfer_get_fps_shift(ch->xfer[0]); + + /* setup frame sizes */ + ch->intr_size = buf_size; + ch->intr_frames = (frames >> fps_shift); + ch->bytes_per_frame <<= fps_shift; + + if (ch->intr_frames == 0) { + DPRINTF("frame shift is too high!\n"); + goto error; + } + + /* setup double buffering */ + buf_size *= 2; + blocks = 2; + + ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); + if (ch->buf == NULL) + goto error; + if (sndbuf_setup(b, ch->buf, buf_size) != 0) + goto error; + if (sndbuf_resize(b, blocks, ch->intr_size)) + goto error; + + ch->start = ch->buf; + ch->end = ch->buf + buf_size; + ch->cur = ch->buf; + ch->pcm_ch = c; + ch->pcm_mtx = c->lock; + ch->pcm_buf = b; + + if (ch->pcm_mtx == NULL) { + DPRINTF("ERROR: PCM channels does not have a mutex!\n"); + goto error; + } + return (ch); error: @@ -1431,30 +1424,13 @@ uaudio_chan_free(struct uaudio_chan *ch) int uaudio_chan_set_param_blocksize(struct uaudio_chan *ch, uint32_t blocksize) { - uaudio_chan_set_param_fragments(ch, blocksize, 0 - 1); - - return (ch->block_size); + return (ch->intr_size); } int uaudio_chan_set_param_fragments(struct uaudio_chan *ch, uint32_t blocksize, uint32_t blockcount) { - /* we only support one size */ - blocksize = ch->intr_size; - blockcount = 2; - - if ((sndbuf_getblksz(ch->pcm_buf) != blocksize) || - (sndbuf_getblkcnt(ch->pcm_buf) != blockcount)) { - DPRINTFN(1, "resizing to %u x " - "%u bytes\n", blockcount, blocksize); - if (sndbuf_resize(ch->pcm_buf, blockcount, blocksize)) { - DPRINTFN(0, "failed to resize sound buffer, count=%u, " - "size=%u\n", blockcount, blocksize); - } - } - ch->block_size = sndbuf_getblksz(ch->pcm_buf); - return (1); } @@ -1591,12 +1567,12 @@ uaudio_mixer_add_ctl(struct uaudio_softc DPRINTF("adding %d\n", mc->ctl); } - mc->delta = 0; if (mc->type == MIX_ON_OFF) { mc->minval = 0; mc->maxval = 1; + mc->mod = 1; } else if (mc->type == MIX_SELECTOR) { - + mc->mod = 1; } else { /* determine min and max values */ @@ -1607,21 +1583,30 @@ uaudio_mixer_add_ctl(struct uaudio_softc mc->maxval = uaudio_mixer_get(sc->sc_udev, GET_MAX, mc); - mc->maxval = 1 + uaudio_mixer_signext(mc->type, mc->maxval); + mc->maxval = uaudio_mixer_signext(mc->type, mc->maxval); + + /* check if max and min was swapped */ + + if (mc->maxval < mc->minval) { + res = mc->maxval; + mc->maxval = mc->minval; + mc->minval = res; + } + /* compute value range */ mc->mul = mc->maxval - mc->minval; - if (mc->mul == 0) { + if (mc->mul == 0) mc->mul = 1; - } + + /* compute value alignment */ res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); - if (res > 0) { - mc->delta = ((res * 255) + (mc->mul / 2)) / mc->mul; - } + if (res == 0) + res = 1; + mc->mod = mc->mul / res; + if (mc->mod == 0) + mc->mod = 1; } - if (mc->maxval < mc->minval) { - mc->maxval = mc->minval; - } uaudio_mixer_add_ctl_sub(sc, mc); #if USB_DEBUG @@ -3108,7 +3093,21 @@ uaudio_mixer_bsd2value(struct uaudio_mix val = mc->minval; } } else { - val = (((val + (mc->delta / 2)) * mc->mul) / 255) + mc->minval; + + /* compute actual volume */ + val = (val * mc->mul) / 255; + + /* align volume level */ + val = val - (val % mc->mod); + + /* add lower offset */ + val = val + mc->minval; + + /* make sure we don't write a value out of range */ + if (val > mc->maxval) + val = mc->maxval; + else if (val < mc->minval) + val = mc->minval; } DPRINTFN(6, "type=0x%03x val=%d min=%d max=%d val=%d\n", From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 21:07:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61B7106566B; Sun, 8 Nov 2009 21:07:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C55C68FC13; Sun, 8 Nov 2009 21:07: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 nA8L7l0G098004; Sun, 8 Nov 2009 21:07:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8L7l4m098002; Sun, 8 Nov 2009 21:07:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082107.nA8L7l4m098002@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 21:07: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: r199061 - head/sys/dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 21:07:47 -0000 Author: thompsa Date: Sun Nov 8 21:07:47 2009 New Revision: 199061 URL: http://svn.freebsd.org/changeset/base/199061 Log: Add missing mtx_destroy(). Submitted by: Sebastian Huber Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sun Nov 8 21:00:50 2009 (r199060) +++ head/sys/dev/usb/storage/umass.c Sun Nov 8 21:07:47 2009 (r199061) @@ -1669,6 +1669,7 @@ umass_detach(device_t dev) #if (__FreeBSD_version >= 700037) mtx_unlock(&sc->sc_mtx); #endif + mtx_destroy(&sc->sc_mtx); return (0); /* success */ } From owner-svn-src-head@FreeBSD.ORG Sun Nov 8 21:08:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C18B4106566B; Sun, 8 Nov 2009 21:08:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0A4F8FC16; Sun, 8 Nov 2009 21:08: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 nA8L8ooO098073; Sun, 8 Nov 2009 21:08:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA8L8oKO098071; Sun, 8 Nov 2009 21:08:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911082108.nA8L8oKO098071@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Nov 2009 21:08: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: r199062 - head/sys/dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 21:08:50 -0000 Author: thompsa Date: Sun Nov 8 21:08:50 2009 New Revision: 199062 URL: http://svn.freebsd.org/changeset/base/199062 Log: Correct Olympus quirk. Submitted by: Pavel Gubin Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sun Nov 8 21:07:47 2009 (r199061) +++ head/sys/dev/usb/storage/umass.c Sun Nov 8 21:08:50 2009 (r199062) @@ -679,7 +679,7 @@ static const struct umass_devdescr umass WRONG_CSWSIG }, {USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C700, RID_WILDCARD, - UMASS_PROTO_SCSI, + UMASS_PROTO_DEFAULT, NO_GETMAXLUN }, {USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_SDS_HOTFIND_D, RID_WILDCARD, From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 00:16:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680B7106566B; Mon, 9 Nov 2009 00:16:51 +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 573F58FC14; Mon, 9 Nov 2009 00:16: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 nA90GpIs002414; Mon, 9 Nov 2009 00:16:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA90GpCL002412; Mon, 9 Nov 2009 00:16:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911090016.nA90GpCL002412@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Nov 2009 00:16: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: r199065 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 00:16:51 -0000 Author: yongari Date: Mon Nov 9 00:16:50 2009 New Revision: 199065 URL: http://svn.freebsd.org/changeset/base/199065 Log: Correct disabling checksum offloading for BCM5700 B0. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 8 21:42:00 2009 (r199064) +++ head/sys/dev/bge/if_bge.c Mon Nov 9 00:16:50 2009 (r199065) @@ -2743,7 +2743,7 @@ bge_attach(device_t dev) */ if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) { ifp->if_capabilities &= ~IFCAP_HWCSUM; - ifp->if_capenable &= IFCAP_HWCSUM; + ifp->if_capenable &= ~IFCAP_HWCSUM; ifp->if_hwassist = 0; } From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 02:37:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9297F106568F; Mon, 9 Nov 2009 02:37: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 686A38FC1F; Mon, 9 Nov 2009 02:37: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 nA92b2oI005473; Mon, 9 Nov 2009 02:37:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA92b2m7005471; Mon, 9 Nov 2009 02:37:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200911090237.nA92b2m7005471@svn.freebsd.org> From: Xin LI Date: Mon, 9 Nov 2009 02:37: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: r199066 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 02:37:02 -0000 Author: delphij Date: Mon Nov 9 02:37:02 2009 New Revision: 199066 URL: http://svn.freebsd.org/changeset/base/199066 Log: Apply a NetBSD fix (revision 1.12) to handle multi-session bzip2 files as created by pbzip2. Submitted by: mrg (NetBSD.org) MFC after: 1 week Modified: head/usr.bin/gzip/unbzip2.c Modified: head/usr.bin/gzip/unbzip2.c ============================================================================== --- head/usr.bin/gzip/unbzip2.c Mon Nov 9 00:16:50 2009 (r199065) +++ head/usr.bin/gzip/unbzip2.c Mon Nov 9 02:37:02 2009 (r199066) @@ -1,4 +1,4 @@ -/* $NetBSD: unbzip2.c,v 1.11 2008/04/28 20:24:13 martin Exp $ */ +/* $NetBSD: unbzip2.c,v 1.12 2009/10/11 05:17:20 mrg Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ unbzip2(int in, int out, char *pre, size if (bytes_in) *bytes_in = prelen; - while (ret >= BZ_OK && ret != BZ_STREAM_END) { + while (ret == BZ_OK) { if (bzs.avail_in == 0 && !end_of_file) { ssize_t n; @@ -88,7 +88,7 @@ unbzip2(int in, int out, char *pre, size case BZ_OK: if (ret == BZ_OK && end_of_file) maybe_err("read"); - if (!tflag) { + if (!tflag && bzs.avail_out != BUFLEN) { ssize_t n; n = write(out, outbuf, BUFLEN - bzs.avail_out); @@ -96,7 +96,13 @@ unbzip2(int in, int out, char *pre, size maybe_err("write"); bytes_out += n; } - break; + if (ret == BZ_STREAM_END && !end_of_file) { + if (BZ2_bzDecompressEnd(&bzs) != BZ_OK || + BZ2_bzDecompressInit(&bzs, 0, 0) != BZ_OK) + maybe_errx("bzip2 re-init"); + ret = BZ_OK; + } + break; case BZ_DATA_ERROR: maybe_warnx("bzip2 data integrity error"); @@ -109,7 +115,10 @@ unbzip2(int in, int out, char *pre, size case BZ_MEM_ERROR: maybe_warnx("bzip2 out of memory"); break; - + + default: + maybe_warnx("unknown bzip2 error: %d", ret); + break; } } From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 02:54:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB9C106566B; Mon, 9 Nov 2009 02:54:16 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0D858FC0C; Mon, 9 Nov 2009 02:54: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 nA92sGpU005924; Mon, 9 Nov 2009 02:54:16 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA92sG1G005921; Mon, 9 Nov 2009 02:54:16 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <200911090254.nA92sG1G005921@svn.freebsd.org> From: Jun Kuriyama Date: Mon, 9 Nov 2009 02:54: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: r199067 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 02:54:17 -0000 Author: kuriyama Date: Mon Nov 9 02:54:16 2009 New Revision: 199067 URL: http://svn.freebsd.org/changeset/base/199067 Log: - Add hw.clflush_disable loader tunable to avoid panic (trap 9) at map_invalidate_cache_range() even if CPU is not Intel. - This tunable can be set to -1 (default), 0 and 1. -1 is same as current behavior, which automatically disable CLFLUSH on Intel CPUs without CPUID_SS (should be occured on Xen only). You can specify 1 when this panic happened on non-Intel CPUs (such as AMD's). Because disabling CLFLUSH may reduce performance, you can try with setting 0 on Intel CPUs without SS to use CLFLUSH feature. Reviewed by: kib Reported by: karl, kuriyama Related to: kern/138863 Modified: head/sys/amd64/amd64/initcpu.c head/sys/i386/i386/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Mon Nov 9 02:37:02 2009 (r199066) +++ head/sys/amd64/amd64/initcpu.c Mon Nov 9 02:54:16 2009 (r199067) @@ -47,6 +47,13 @@ __FBSDID("$FreeBSD$"); static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); +/* + * -1: automatic (default) + * 0: keep enable CLFLUSH + * 1: force disable CLFLUSH + */ +static int hw_clflush_disable = -1; +TUNABLE_INT("hw.clflush_disable", &hw_clflush_disable); int cpu; /* Are we 386, 386sx, 486, etc? */ u_int cpu_feature; /* Feature flags */ @@ -169,6 +176,16 @@ initializecpu(void) * XXXKIB: (temporary) hack to work around traps generated when * CLFLUSHing APIC registers window. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); + if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && + hw_clflush_disable == -1) + cpu_feature &= ~CPUID_CLFSH; + /* + * Allow to disable CLFLUSH feature manually by + * hw.clflush_disable tunable. This may help Xen guest on some AMD + * CPUs. + */ + if (hw_clflush_disable == 1) { cpu_feature &= ~CPUID_CLFSH; + } } Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Nov 9 02:37:02 2009 (r199066) +++ head/sys/i386/i386/initcpu.c Mon Nov 9 02:54:16 2009 (r199067) @@ -75,6 +75,13 @@ static void init_mendocino(void); static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); +/* + * -1: automatic (default) + * 0: keep enable CLFLUSH + * 1: force disable CLFLUSH + */ +static int hw_clflush_disable = -1; +TUNABLE_INT("hw.clflush_disable", &hw_clflush_disable); /* Must *NOT* be BSS or locore will bzero these after setting them */ int cpu = 0; /* Are we 386, 386sx, 486, etc? */ @@ -721,8 +728,18 @@ initializecpu(void) * XXXKIB: (temporary) hack to work around traps generated when * CLFLUSHing APIC registers window. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); + if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && + hw_clflush_disable == -1) + cpu_feature &= ~CPUID_CLFSH; + /* + * Allow to disable CLFLUSH feature manually by + * hw.clflush_disable tunable. This may help Xen guest on some AMD + * CPUs. + */ + if (hw_clflush_disable == 1) { cpu_feature &= ~CPUID_CLFSH; + } #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) /* From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 07:28:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B5D2106566B; Mon, 9 Nov 2009 07:28: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 EE4C78FC14; Mon, 9 Nov 2009 07:28: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 nA97STmC011963; Mon, 9 Nov 2009 07:28:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA97STW8011960; Mon, 9 Nov 2009 07:28:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200911090728.nA97STW8011960@svn.freebsd.org> From: Xin LI Date: Mon, 9 Nov 2009 07: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: r199069 - head/sys/dev/arcmsr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 07:28:30 -0000 Author: delphij Date: Mon Nov 9 07:28:29 2009 New Revision: 199069 URL: http://svn.freebsd.org/changeset/base/199069 Log: Initialize the whole message unit's DMA buffer to zero, this fixes a panic during boot when ARC1200 is being used with certain motherboard models. This commit brings the driver to the same state of vendor's 1.20.00.16 release. Many thanks to Areca for their continued support to FreeBSD. Reported by: Jirka Mikulas Submitted by: Erich Chen (Areca) Obtained from: ftp://ftp.areca.com.tw/RaidCards/AP_Drivers/FreeBSD/DRIVER/SourceCode/arcmsr-freebsd-1.20.00.16-91010.zip MFC after: 3 days Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Mon Nov 9 07:19:25 2009 (r199068) +++ head/sys/dev/arcmsr/arcmsr.c Mon Nov 9 07:28:29 2009 (r199069) @@ -55,6 +55,8 @@ ** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error ** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** bus_dmamem_alloc() with BUS_DMA_ZERO ****************************************************************************************** * $FreeBSD$ */ @@ -2903,7 +2905,7 @@ static u_int32_t arcmsr_initialize(devic } /* Allocation for our srbs */ if(bus_dmamem_alloc(acb->srb_dmat, (void **)&acb->uncacheptr - , BUS_DMA_WAITOK | BUS_DMA_COHERENT, &acb->srb_dmamap) != 0) { + , BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, &acb->srb_dmamap) != 0) { bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Mon Nov 9 07:19:25 2009 (r199068) +++ head/sys/dev/arcmsr/arcmsr.h Mon Nov 9 07:28:29 2009 (r199069) @@ -37,7 +37,7 @@ ************************************************************************** * $FreeBSD$ */ -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2007-10-07" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.16 2009-10-10" #define ARCMSR_SCSI_INITIATOR_ID 255 #define ARCMSR_DEV_SECTOR_SIZE 512 #define ARCMSR_MAX_XFER_SECTORS 4096 From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 09:12:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4A901065676; Mon, 9 Nov 2009 09:12:45 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D429E8FC2A; Mon, 9 Nov 2009 09:12: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 nA99Cj84014449; Mon, 9 Nov 2009 09:12:45 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA99CjGm014447; Mon, 9 Nov 2009 09:12:45 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <200911090912.nA99CjGm014447@svn.freebsd.org> From: Oleg Bulyzhin Date: Mon, 9 Nov 2009 09:12: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: r199073 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 09:12:46 -0000 Author: oleg Date: Mon Nov 9 09:12:45 2009 New Revision: 199073 URL: http://svn.freebsd.org/changeset/base/199073 Log: style(9): add missing parentheses Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Mon Nov 9 08:54:47 2009 (r199072) +++ head/sys/netinet/ipfw/ip_dummynet.c Mon Nov 9 09:12:45 2009 (r199073) @@ -252,7 +252,7 @@ static int dummynet_io(struct mbuf **, i #define QUEUE_IS_IDLE(q) ((q)->head == NULL && (q)->S == (q)->F + 1 && \ curr_time > (q)->idle_time + 1 && \ ((q)->numbytes + (curr_time - (q)->idle_time - 1) * \ - (q)->fs->pipe->bandwidth >= q->fs->pipe->burst)) + (q)->fs->pipe->bandwidth >= (q)->fs->pipe->burst)) /* * Heap management functions. From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 09:27:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8D58106568D; Mon, 9 Nov 2009 09:27:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D814E8FC0A; Mon, 9 Nov 2009 09:27: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 nA99R9J2014845; Mon, 9 Nov 2009 09:27:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA99R91d014842; Mon, 9 Nov 2009 09:27:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911090927.nA99R91d014842@svn.freebsd.org> From: Alexander Motin Date: Mon, 9 Nov 2009 09:27: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: r199074 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 09:27:10 -0000 Author: mav Date: Mon Nov 9 09:27:09 2009 New Revision: 199074 URL: http://svn.freebsd.org/changeset/base/199074 Log: Add more ICH10 chip IDs. Submitted by: Dmitry S. Luhtionov Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Mon Nov 9 09:12:45 2009 (r199073) +++ head/sys/dev/ata/ata-pci.h Mon Nov 9 09:27:09 2009 (r199074) @@ -196,6 +196,10 @@ struct ata_pci_controller { #define ATA_I82801JD_AH 0x3a028086 #define ATA_I82801JD_R1 0x3a058086 #define ATA_I82801JD_S2 0x3a068086 +#define ATA_I82801JI_S1 0x3a208086 +#define ATA_I82801JI_AH 0x3a228086 +#define ATA_I82801JI_R1 0x3a258086 +#define ATA_I82801JI_S2 0x3a268086 #define ATA_I31244 0x32008086 #define ATA_ITE_ID 0x1283 Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Nov 9 09:12:45 2009 (r199073) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Nov 9 09:27:09 2009 (r199074) @@ -135,6 +135,10 @@ ata_intel_probe(device_t dev) { ATA_I82801JD_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JD_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JD_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, + { ATA_I82801JI_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, + { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, + { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, + { ATA_I82801JI_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 11:23:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43CF0106566B; Mon, 9 Nov 2009 11:23:38 +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 336398FC2B; Mon, 9 Nov 2009 11:23: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 nA9BNctp019380; Mon, 9 Nov 2009 11:23:38 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9BNcxk019378; Mon, 9 Nov 2009 11:23:38 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200911091123.nA9BNcxk019378@svn.freebsd.org> From: Rui Paulo Date: Mon, 9 Nov 2009 11:23: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: r199076 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 11:23:38 -0000 Author: rpaulo Date: Mon Nov 9 11:23:37 2009 New Revision: 199076 URL: http://svn.freebsd.org/changeset/base/199076 Log: The isr_intval in ieee80211req_scan_result structure should be 16 bit. This makes ifconfig list scan display the correct beacon interval (previously it would int overflow). As a side effect, this makes the ieee80211req_scan_result word aligned. Submitted by: Paul B Mahol Modified: head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Nov 9 10:13:24 2009 (r199075) +++ head/sys/net80211/ieee80211_ioctl.h Mon Nov 9 11:23:37 2009 (r199076) @@ -790,7 +790,7 @@ struct ieee80211req_scan_result { uint16_t isr_flags; /* channel flags */ int8_t isr_noise; int8_t isr_rssi; - uint8_t isr_intval; /* beacon interval */ + uint16_t isr_intval; /* beacon interval */ uint8_t isr_capinfo; /* capabilities */ uint8_t isr_erp; /* ERP element */ uint8_t isr_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 11:39:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 783D71065676; Mon, 9 Nov 2009 11:39:51 +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 673928FC18; Mon, 9 Nov 2009 11:39:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA9BdpY1019883; Mon, 9 Nov 2009 11:39:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9BdpAU019880; Mon, 9 Nov 2009 11:39:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911091139.nA9BdpAU019880@svn.freebsd.org> From: Alexander Motin Date: Mon, 9 Nov 2009 11:39: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: r199079 - head/sbin/camcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 11:39:51 -0000 Author: mav Date: Mon Nov 9 11:39:51 2009 New Revision: 199079 URL: http://svn.freebsd.org/changeset/base/199079 Log: Add support for ATA Power Management. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Mon Nov 9 11:32:34 2009 (r199078) +++ head/sbin/camcontrol/camcontrol.8 Mon Nov 9 11:39:51 2009 (r199079) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 4, 2009 +.Dd November 9, 2009 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -165,6 +165,20 @@ .Op Fl w .Op Fl y .Nm +.Ic idle +.Op device id +.Op generic args +.Op Fl t Ar time +.Nm +.Ic standby +.Op device id +.Op generic args +.Op Fl t Ar time +.Nm +.Ic sleep +.Op device id +.Op generic args +.Nm .Ic help .Sh DESCRIPTION The @@ -821,6 +835,15 @@ The user will not be asked about the timeout if a timeout is specified on the command line. .El +.It Ic idle +Put ATA device into IDLE state. Optional parameter specifies automatic +idle timer value in seconds. +.It Ic standby +Put ATA device into STANDBY state. Optional parameter specifies automatic +standby timer value in seconds. +.It Ic sleep +Put ATA device into SLEEP state. Note that the only way get device out of +this state may be reset. .It Ic help Print out verbose usage information. .El Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Nov 9 11:32:34 2009 (r199078) +++ head/sbin/camcontrol/camcontrol.c Mon Nov 9 11:39:51 2009 (r199079) @@ -74,7 +74,10 @@ typedef enum { CAM_CMD_DETACH = 0x00000010, CAM_CMD_REPORTLUNS = 0x00000011, CAM_CMD_READCAP = 0x00000012, - CAM_CMD_IDENTIFY = 0x00000013 + CAM_CMD_IDENTIFY = 0x00000013, + CAM_CMD_IDLE = 0x00000014, + CAM_CMD_STANDBY = 0x00000015, + CAM_CMD_SLEEP = 0x00000016 } cam_cmdmask; typedef enum { @@ -154,6 +157,9 @@ struct camcontrol_opts option_table[] = {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"}, {"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"}, + {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, + {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, + {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -217,6 +223,8 @@ static int scsireportluns(struct cam_dev char *combinedopt, int retry_count, int timeout); static int scsireadcapacity(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); +static int atapm(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); #endif /* MINIMALISTIC */ camcontrol_optret @@ -4128,6 +4136,91 @@ bailout: return (retval); } +static int +atapm(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout) +{ + union ccb *ccb; + int retval = 0; + int t = -1; + char c; + u_char cmd, sc; + + ccb = cam_getccb(device); + + if (ccb == NULL) { + warnx("%s: error allocating ccb", __func__); + return (1); + } + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 't': + t = atoi(optarg); + break; + default: + break; + } + } + if (strcmp(argv[1], "idle") == 0) { + if (t == -1) + cmd = ATA_IDLE_IMMEDIATE; + else + cmd = ATA_IDLE_CMD; + } else if (strcmp(argv[1], "standby") == 0) { + if (t == -1) + cmd = ATA_STANDBY_IMMEDIATE; + else + cmd = ATA_STANDBY_CMD; + } else { + cmd = ATA_SLEEP; + t = -1; + } + if (t < 0) + sc = 0; + else if (t <= (240 * 5)) + sc = t / 5; + else if (t <= (11 * 30 * 60)) + sc = t / (30 * 60) + 241; + else + sc = 253; + cam_fill_ataio(&ccb->ataio, + retry_count, + NULL, + /*flags*/CAM_DIR_NONE, + MSG_SIMPLE_Q_TAG, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000); + ata_28bit_cmd(&ccb->ataio, cmd, 0, 0, sc); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (arglist & CAM_ARG_ERR_RECOVER) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending command"); + + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + + retval = 1; + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); + retval = 1; + goto bailout; + } +bailout: + cam_freeccb(ccb); + return (retval); +} + #endif /* MINIMALISTIC */ void @@ -4166,6 +4259,9 @@ usage(int verbose) " [-R syncrate][-v][-T ]\n" " [-U][-W bus_width]\n" " camcontrol format [dev_id][generic args][-q][-r][-w][-y]\n" +" camcontrol idle [dev_id][generic args][-t time]\n" +" camcontrol standby [dev_id][generic args][-t time]\n" +" camcontrol sleep [dev_id][generic args]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!verbose) @@ -4193,6 +4289,9 @@ usage(int verbose) "tags report or set the number of transaction slots for a device\n" "negotiate report or set device negotiation parameters\n" "format send the SCSI FORMAT UNIT command to the named device\n" +"idle send the ATA IDLE command to the named device\n" +"standby send the ATA STANDBY command to the named device\n" +"sleep send the ATA SLEEP command to the named device\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -4259,7 +4358,9 @@ usage(int verbose) "-q be quiet, don't print status messages\n" "-r run in report only mode\n" "-w don't send immediate format command\n" -"-y don't ask any questions\n"); +"-y don't ask any questions\n" +"idle/standby arguments:\n" +"-t number of seconds before respective state.\n"); #endif /* MINIMALISTIC */ } @@ -4555,6 +4656,13 @@ main(int argc, char **argv) combinedopt, retry_count, timeout); break; + case CAM_CMD_IDLE: + case CAM_CMD_STANDBY: + case CAM_CMD_SLEEP: + error = atapm(cam_dev, argc, argv, + combinedopt, retry_count, + timeout); + break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:14:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 603C1106568B; Mon, 9 Nov 2009 12:14:05 +0000 (UTC) (envelope-from popdump@googlemail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id A06208FC08; Mon, 9 Nov 2009 12:14:04 +0000 (UTC) Received: by ewy18 with SMTP id 18so312197ewy.43 for ; Mon, 09 Nov 2009 04:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=F5M4RLrqSzdM2M1y3gvDqQoNJMSWs2gr6vdvyuK4FIw=; b=frxIzKN165pnnfHFNq/StEa/wTtTfhSmXwDtRJkgdz6ayhvmZ27C4jBuXs/DD+8HUW 8bRkv4vdjbbd987y1O5SgkcvbY3OdgWzmZcIunIdqeJsQeMEOI74F+qAATnu4Rh49vEP a4TEhLd21nQv+3gBIdSYXQKhQQOW3gsXKkYH4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; b=eM0Tu7r8ba5pkZw7PGuOVDw/9z+cKBUPKcBSTTUZBPhlTB38bwp9TsHv0gnNG0sVST VbCmIbjSpfI7dtvusRzO7fTeeOQndZtpBeDTvaSQJ1GJvQTatzp2vj54N2f+smYyzWVC ERNgaudW5zc2xhMQk6hZCygMZaMCGTR1LcE8A= MIME-Version: 1.0 Sender: popdump@googlemail.com Received: by 10.213.110.14 with SMTP id l14mr833742ebp.82.1257767622408; Mon, 09 Nov 2009 03:53:42 -0800 (PST) Date: Mon, 9 Nov 2009 11:53:42 +0000 X-Google-Sender-Auth: 5748846c12ad9cfe Message-ID: <6a3f63de0911090353h21201f05we3c3fe0cc0b8ab9a@mail.gmail.com> From: Robert Kent To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199074 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:14:05 -0000 On Mon, 9 Nov 2009 09:27:09 +0000 (UTC) Alexander Motin wrote: > Author: mav > Date: Mon Nov 9 09:27:09 2009 > New Revision: 199074 > URL: http://svn.freebsd.org/changeset/base/199074 > > Log: > Add more ICH10 chip IDs. > > Submitted by: Dmitry S. Luhtionov > > Modified: > head/sys/dev/ata/ata-pci.h > head/sys/dev/ata/chipsets/ata-intel.c What are the chances of getting some ICH9-M chip IDs? The chipset, according to Intel, is a SATA300 type, but the AHCI driver only picks this up as 1.5gbps. The PCI details are: ahci0@pci0:0:31:2: class=0x010601 card=0x833810f7 chip=0x29298086 rev=0x03 hdr=0x00 vendor = 'Intel Corporation' device = '82801IB/IR/IH (ICH9 Family) Mobile SATA AHCI Controller' class = mass storage subclass = SATA cap 05[80] = MSI supports 16 messages enabled with 1 message cap 01[70] = powerspec 3 supports D0 D3 current D0 cap 12[a8] = SATA Index-Data Pair cap 13[b0] = PCI Advanced Features: FLR TP -- -- http://rob.tel From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:18:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB03106568F; Mon, 9 Nov 2009 12:18:46 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id B4DF98FC12; Mon, 9 Nov 2009 12:18:45 +0000 (UTC) Received: by fxm27 with SMTP id 27so1052953fxm.3 for ; Mon, 09 Nov 2009 04:18:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=M3pMMoaIWjeHcRL56M/nWD5XJt8xjeDlxVcDiUNw5dQ=; b=qvhhWS1Vi6rt1JIpba7v5v28Ep0+AHgTZqoQIDT7ZLGs6747k8apo05hNNHQloghfG 1blWCc1KnZyS0f48fWrSNGm2mCw04X+PUVFNTw3FysF2pNjBJ1WAkewFqAWK4nfMe/Gp MZ5XDBbXQA3ex9p2udkP0ZX1ezoNnIAnjhmXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=LESXAE8dQaIaG6lXBjy1y7aJkilvpRqffR5VxgTpGYBccfRhjQ3eCDA0C+EpM6eP3u dEnu3rhodcmLJ8SmrVbm0rs3VLmTfn4KTWzZLXRrrY0+yH2V8ENZmaXQSasCbYdlYCBe +UtKrjnm56iR0Pz76Sd5OTmoOsidQoRNa1Chg= Received: by 10.204.154.85 with SMTP id n21mr1879853bkw.171.1257769124690; Mon, 09 Nov 2009 04:18:44 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 14sm723169fxm.15.2009.11.09.04.18.43 (version=SSLv3 cipher=RC4-MD5); Mon, 09 Nov 2009 04:18:43 -0800 (PST) Sender: Alexander Motin Message-ID: <4AF808A1.6050309@FreeBSD.org> Date: Mon, 09 Nov 2009 14:18:41 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: Robert Kent References: <6a3f63de0911090353h21201f05we3c3fe0cc0b8ab9a@mail.gmail.com> In-Reply-To: <6a3f63de0911090353h21201f05we3c3fe0cc0b8ab9a@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199074 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:18:46 -0000 Robert Kent wrote: > On Mon, 9 Nov 2009 09:27:09 +0000 (UTC) > Alexander Motin wrote: > >> Author: mav >> Date: Mon Nov 9 09:27:09 2009 >> New Revision: 199074 >> URL: http://svn.freebsd.org/changeset/base/199074 >> >> Log: >> Add more ICH10 chip IDs. >> >> Submitted by: Dmitry S. Luhtionov >> >> Modified: >> head/sys/dev/ata/ata-pci.h >> head/sys/dev/ata/chipsets/ata-intel.c > > What are the chances of getting some ICH9-M chip IDs? Data welcome. > The chipset, according to Intel, is a SATA300 type, but the AHCI driver > only picks this up as 1.5gbps. Some mobile chipsets limited to 1.5Gbps by hardware, second by BIOS, third by drive capabilities. First is inevitable, second is difficult to override, as these registers are write-once, third depends from drive. > The PCI details are: Please for every mode: Legacy, RAID, AHCI, ... And better in private. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:29:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E962106566B; Mon, 9 Nov 2009 12:29:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 435698FC13; Mon, 9 Nov 2009 12:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA9CT0qF021042; Mon, 9 Nov 2009 12:29:00 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9CT0Bp021040; Mon, 9 Nov 2009 12:29:00 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911091229.nA9CT0Bp021040@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 9 Nov 2009 12:29: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: r199080 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:29:00 -0000 Author: ume Date: Mon Nov 9 12:28:59 2009 New Revision: 199080 URL: http://svn.freebsd.org/changeset/base/199080 Log: Add ja_JP.UTF-8 catalog. Reviewed by: hrs, nork, takawata MFC after: 1 week Added: head/lib/libc/nls/ja_JP.UTF-8.msg (contents, props changed) Modified: head/lib/libc/nls/Makefile.inc Modified: head/lib/libc/nls/Makefile.inc ============================================================================== --- head/lib/libc/nls/Makefile.inc Mon Nov 9 11:39:51 2009 (r199079) +++ head/lib/libc/nls/Makefile.inc Mon Nov 9 12:28:59 2009 (r199080) @@ -23,6 +23,7 @@ NLS+= fr_FR.ISO8859-1 NLS+= gl_ES.ISO8859-1 NLS+= hu_HU.ISO8859-2 NLS+= it_IT.ISO8859-15 +NLS+= ja_JP.UTF-8 NLS+= ko_KR.UTF-8 NLS+= ko_KR.eucKR NLS+= mn_MN.UTF-8 Added: head/lib/libc/nls/ja_JP.UTF-8.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/nls/ja_JP.UTF-8.msg Mon Nov 9 12:28:59 2009 (r199080) @@ -0,0 +1,249 @@ +$ $FreeBSD$ +$ +$ Message catalog for C locale (template) +$ +$ strerror() support catalog +$ +$set 1 +$ EPERM +1 許可されていない操作です +$ ENOENT +2 そのようなファイルまたはディレクトリはありません +$ ESRCH +3 そのようなプロセスはありません +$ EINTR +4 システムコールが中断されました +$ EIO +5 入出力エラーです +$ ENXIO +6 デバイスが準備されていません +$ E2BIG +7 引数のリストが長すぎます +$ ENOEXEC +8 無効な実行形式です +$ EBADF +9 無効なファイル記述子です +$ ECHILD +10 子プロセスがありません +$ EDEADLK +11 リソースデッドロックを回避しました +$ ENOMEM +12 メモリの割り当てができません +$ EACCES +13 パーミッションが拒絶されました +$ EFAULT +14 無効なアドレスです +$ ENOTBLK +15 ブロックデバイスが要求されています +$ EBUSY +16 デバイスがビジー状態です +$ EEXIST +17 ファイルが存在します +$ EXDEV +18 デバイスをまたぐリンクです +$ ENODEV +19 デバイスが対応してない操作です +$ ENOTDIR +20 ディレクトリではありません +$ EISDIR +21 ディレクトリです +$ EINVAL +22 無効な引数です +$ ENFILE +23 システム内でオープンされているファイルが多すぎます +$ EMFILE +24 オープンしているファイルが多すぎます +$ ENOTTY +25 デバイスが対応していない ioctl です +$ ETXTBSY +26 テキストファイルがビジー状態です +$ EFBIG +27 ファイルが大きすぎます +$ ENOSPC +28 デバイスの空き領域不足です +$ ESPIPE +29 無効なシークです +$ EROFS +30 読み込み専用ファイルシステムです +$ EMLINK +31 リンク数が多すぎます +$ EPIPE +32 パイプが破壊されてました +$ EDOM +33 数値引数が範囲外です +$ ERANGE +34 結果が大き過ぎます +$ EAGAIN, EWOULDBLOCK +35 リソースが一時的に利用できません +$ EINPROGRESS +36 操作が現在進行中です +$ EALREADY +37 操作は既に進行中です +$ ENOTSOCK +38 ソケットでないものについてソケット操作を行いました +$ EDESTADDRREQ +39 宛先アドレスが要求されています +$ EMSGSIZE +40 メッセージが長すぎます +$ EPROTOTYPE +41 ソケットが対応していないプロトコルタイプです +$ ENOPROTOOPT +42 利用できないプロトコルです +$ EPROTONOSUPPORT +43 対応していないプロトコルです +$ ESOCKTNOSUPPORT +44 対応していないソケットタイプです +$ EOPNOTSUPP +45 対応していない操作です +$ EPFNOSUPPORT +46 対応していないプロトコルファミリです +$ EAFNOSUPPORT +47 プロトコルファミリが対応していないアドレスファミリが指定されました +$ EADDRINUSE +48 アドレスが既に使用中です +$ EADDRNOTAVAIL +49 要求されたアドレスを割り当てできません +$ ENETDOWN +50 ネットワークがダウンしています +$ ENETUNREACH +51 ネットワークに到達できません +$ ENETRESET +52 リセットによりネットワークの接続が失われました +$ ECONNABORTED +53 ソフトウェアによって接続が切断されました +$ ECONNRESET +54 接続が通信相手によってリセットされました +$ ENOBUFS +55 バッファの容量不足です +$ EISCONN +56 ソケットは既に接続されています +$ ENOTCONN +57 ソケットは接続されていません +$ ESHUTDOWN +58 ソケットのシャットダウンの後で送信ができません +$ ETOOMANYREFS +59 処理限界を超える多重参照です +$ ETIMEDOUT +60 操作がタイムアウトしました +$ ECONNREFUSED +61 接続が拒絶されました +$ ELOOP +62 処理限界を超えるシンボリックリンクレベルです +$ ENAMETOOLONG +63 ファイル名が長すぎます +$ EHOSTDOWN +64 ホストがダウンしています +$ EHOSTUNREACH +65 ホストへの経路がありません +$ ENOTEMPTY +66 ディレクトリが空ではありません +$ EPROCLIM +67 プロセスが多すぎます +$ EUSERS +68 ユーザが多すぎます +$ EDQUOT +69 ディスククォータが超過しました +$ ESTALE +70 失効した NFS ファイルハンドルです +$ EREMOTE +71 パス中のリモートのレベルが多すぎます +$ EBADRPC +72 無効な RPC 構造体です +$ ERPCMISMATCH +73 RPC バージョンが間違っています +$ EPROGUNAVAIL +74 RPC プログラムが利用できません +$ EPROGMISMATCH +75 プログラムのバージョンが合っていません +$ EPROCUNAVAIL +76 プログラムでは利用できない procedure です +$ ENOLCK +77 ロックが利用できません +$ ENOSYS +78 関数が実装されていません +$ EFTYPE +79 ファイルの型または形式が不適切です +$ EAUTH +80 認証エラーです +$ ENEEDAUTH +81 認証物が必要です +$ EIDRM +82 識別子は削除されました +$ ENOMSG +83 要求された型のメッセージがありません +$ EOVERFLOW +84 データ型に格納するには大きすぎる値です +$ ECANCELED +85 処理がキャンセルされました +$ EILSEQ +86 不正なバイト列です +$ ENOATTR +87 そのような属性はありません +$ EDOOFUS +88 プログラミングエラーです +$ +$ strsignal() support catalog +$ +$set 2 +$ SIGHUP +1 ハングアップ +$ SIGINT +2 割り込み +$ SIGQUIT +3 中断 +$ SIGILL +4 不正命令 +$ SIGTRAP +5 トレース/BPT トラップ +$ SIGABRT +6 アボートトラップ +$ SIGEMT +7 EMT トラップ +$ SIGFPE +8 浮動小数点例外 +$ SIGKILL +9 Kill された +$ SIGBUS +10 バスエラー +$ SIGSEGV +11 セグメンテーション違反 +$ SIGSYS +12 存在しないシステムコール +$ SIGPIPE +13 パイプ破壊 +$ SIGALRM +14 アラームクロック +$ SIGTERM +15 終了 +$ SIGURG +16 緊急入出力状況 +$ SIGSTOP +17 一時停止 (シグナル) +$ SIGTSTP +18 一時停止 +$ SIGCONT +19 継続 +$ SIGCHLD +20 子プロセスの終了 +$ SIGTTIN +21 一時停止 (tty 入力) +$ SIGTTOU +22 一時停止 (tty 出力) +$ SIGIO +23 入出力可能 +$ SIGXCPU +24 CPU 時間の制限超過 +$ SIGXFSZ +25 ファイルサイズの制限超過 +$ SIGVTALRM +26 仮想タイマの期限超過 +$ SIGPROF +27 プロファイルタイマの期限超過 +$ SIGWINCH +28 ウィンドウサイズの変化 +$ SIGINFO +29 情報要求 +$ SIGUSR1 +30 ユーザ定義シグナル 1 +$ SIGUSR2 +31 ユーザ定義シグナル 2 From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:33:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84CE31065670; Mon, 9 Nov 2009 12:33:47 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7409F8FC13; Mon, 9 Nov 2009 12:33: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 nA9CXl0H021189; Mon, 9 Nov 2009 12:33:47 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9CXlmU021186; Mon, 9 Nov 2009 12:33:47 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911091233.nA9CXlmU021186@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 9 Nov 2009 12:33: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: r199081 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:33:47 -0000 Author: ume Date: Mon Nov 9 12:33:47 2009 New Revision: 199081 URL: http://svn.freebsd.org/changeset/base/199081 Log: Add ja_JP.eucJP catalog. Reviewed by: hrs, nork, takawata MFC after: 1 week Added: head/lib/libc/nls/ja_JP.eucJP.msg (contents, props changed) Modified: head/lib/libc/nls/Makefile.inc Modified: head/lib/libc/nls/Makefile.inc ============================================================================== --- head/lib/libc/nls/Makefile.inc Mon Nov 9 12:28:59 2009 (r199080) +++ head/lib/libc/nls/Makefile.inc Mon Nov 9 12:33:47 2009 (r199081) @@ -24,6 +24,7 @@ NLS+= gl_ES.ISO8859-1 NLS+= hu_HU.ISO8859-2 NLS+= it_IT.ISO8859-15 NLS+= ja_JP.UTF-8 +NLS+= ja_JP.eucJP NLS+= ko_KR.UTF-8 NLS+= ko_KR.eucKR NLS+= mn_MN.UTF-8 Added: head/lib/libc/nls/ja_JP.eucJP.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/nls/ja_JP.eucJP.msg Mon Nov 9 12:33:47 2009 (r199081) @@ -0,0 +1,249 @@ +$ $FreeBSD$ +$ +$ Message catalog for C locale (template) +$ +$ strerror() support catalog +$ +$set 1 +$ EPERM +1 ĤƤʤǤ +$ ENOENT +2 Τ褦ʥեޤϥǥ쥯ȥϤޤ +$ ESRCH +3 Τ褦ʥץϤޤ +$ EINTR +4 ƥॳ뤬Ǥޤ +$ EIO +5 ϥ顼Ǥ +$ ENXIO +6 ǥХƤޤ +$ E2BIG +7 ΥꥹȤĹޤ +$ ENOEXEC +8 ̵ʼ¹ԷǤ +$ EBADF +9 ̵ʥե뵭һҤǤ +$ ECHILD +10 ҥץޤ +$ EDEADLK +11 ꥽ǥåɥå򤷤ޤ +$ ENOMEM +12 γƤǤޤ +$ EACCES +13 ѡߥå󤬵䤵ޤ +$ EFAULT +14 ̵ʥɥ쥹Ǥ +$ ENOTBLK +15 ֥åǥХ׵ᤵƤޤ +$ EBUSY +16 ǥХӥ֤Ǥ +$ EEXIST +17 ե뤬¸ߤޤ +$ EXDEV +18 ǥХޤ󥯤Ǥ +$ ENODEV +19 ǥХбƤʤǤ +$ ENOTDIR +20 ǥ쥯ȥǤϤޤ +$ EISDIR +21 ǥ쥯ȥǤ +$ EINVAL +22 ̵ʰǤ +$ ENFILE +23 ƥǥץ󤵤Ƥե뤬¿ޤ +$ EMFILE +24 ץ󤷤Ƥե뤬¿ޤ +$ ENOTTY +25 ǥХбƤʤ ioctl Ǥ +$ ETXTBSY +26 ƥȥե뤬ӥ֤Ǥ +$ EFBIG +27 ե뤬礭ޤ +$ ENOSPC +28 ǥХζΰ­Ǥ +$ ESPIPE +29 ̵ʥǤ +$ EROFS +30 ɤ߹ѥե륷ƥǤ +$ EMLINK +31 󥯿¿ޤ +$ EPIPE +32 ѥפ˲Ƥޤ +$ EDOM +33 ͰϰϳǤ +$ ERANGE +34 ̤礭᤮ޤ +$ EAGAIN, EWOULDBLOCK +35 ꥽ŪѤǤޤ +$ EINPROGRESS +36 ߿ʹǤ +$ EALREADY +37 ϴ˿ʹǤ +$ ENOTSOCK +38 åȤǤʤΤˤĤƥåԤޤ +$ EDESTADDRREQ +39 襢ɥ쥹׵ᤵƤޤ +$ EMSGSIZE +40 åĹޤ +$ EPROTOTYPE +41 åȤбƤʤץȥ륿פǤ +$ ENOPROTOOPT +42 ѤǤʤץȥǤ +$ EPROTONOSUPPORT +43 бƤʤץȥǤ +$ ESOCKTNOSUPPORT +44 бƤʤåȥפǤ +$ EOPNOTSUPP +45 бƤʤǤ +$ EPFNOSUPPORT +46 бƤʤץȥեߥǤ +$ EAFNOSUPPORT +47 ץȥեߥ꤬бƤʤɥ쥹եߥ꤬ꤵޤ +$ EADDRINUSE +48 ɥ쥹˻Ǥ +$ EADDRNOTAVAIL +49 ׵ᤵ줿ɥ쥹ƤǤޤ +$ ENETDOWN +50 ͥåȥ󤷤Ƥޤ +$ ENETUNREACH +51 ͥåȥãǤޤ +$ ENETRESET +52 ꥻåȤˤͥåȥ³ޤ +$ ECONNABORTED +53 եȥˤä³Ǥޤ +$ ECONNRESET +54 ³̿ˤäƥꥻåȤޤ +$ ENOBUFS +55 Хåե­Ǥ +$ EISCONN +56 åȤϴ³Ƥޤ +$ ENOTCONN +57 åȤ³Ƥޤ +$ ESHUTDOWN +58 åȤΥåȥθǤޤ +$ ETOOMANYREFS +59 ³Ķ¿ŻȤǤ +$ ETIMEDOUT +60 ॢȤޤ +$ ECONNREFUSED +61 ³䤵ޤ +$ ELOOP +62 ³Ķ륷ܥå󥯥٥Ǥ +$ ENAMETOOLONG +63 ե̾Ĺޤ +$ EHOSTDOWN +64 ۥȤ󤷤Ƥޤ +$ EHOSTUNREACH +65 ۥȤؤηϩޤ +$ ENOTEMPTY +66 ǥ쥯ȥ꤬ǤϤޤ +$ EPROCLIM +67 ץ¿ޤ +$ EUSERS +68 桼¿ޤ +$ EDQUOT +69 ǥĶᤷޤ +$ ESTALE +70 NFS եϥɥǤ +$ EREMOTE +71 ѥΥ⡼ȤΥ٥뤬¿ޤ +$ EBADRPC +72 ̵ RPC ¤ΤǤ +$ ERPCMISMATCH +73 RPC С󤬴ְäƤޤ +$ EPROGUNAVAIL +74 RPC ץबѤǤޤ +$ EPROGMISMATCH +75 ץΥС󤬹äƤޤ +$ EPROCUNAVAIL +76 ץǤѤǤʤ procedure Ǥ +$ ENOLCK +77 åѤǤޤ +$ ENOSYS +78 ؿƤޤ +$ EFTYPE +79 եηޤϷŬڤǤ +$ EAUTH +80 ǧڥ顼Ǥ +$ ENEEDAUTH +81 ǧʪɬפǤ +$ EIDRM +82 ̻ҤϺޤ +$ ENOMSG +83 ׵ᤵ줿Υåޤ +$ EOVERFLOW +84 ǡ˳Ǽˤ礭ͤǤ +$ ECANCELED +85 󥻥뤵ޤ +$ EILSEQ +86 ʥХǤ +$ ENOATTR +87 Τ褦°Ϥޤ +$ EDOOFUS +88 ץߥ󥰥顼Ǥ +$ +$ strsignal() support catalog +$ +$set 2 +$ SIGHUP +1 ϥ󥰥å +$ SIGINT +2 +$ SIGQUIT +3 +$ SIGILL +4 ̿ +$ SIGTRAP +5 ȥ졼/BPT ȥå +$ SIGABRT +6 ܡȥȥå +$ SIGEMT +7 EMT ȥå +$ SIGFPE +8 ư㳰 +$ SIGKILL +9 Kill 줿 +$ SIGBUS +10 Х顼 +$ SIGSEGV +11 ơȿ +$ SIGSYS +12 ¸ߤʤƥॳ +$ SIGPIPE +13 ѥ˲ +$ SIGALRM +14 顼९å +$ SIGTERM +15 λ +$ SIGURG +16 ۵Ͼ +$ SIGSTOP +17 (ʥ) +$ SIGTSTP +18 +$ SIGCONT +19 ³ +$ SIGCHLD +20 ҥץνλ +$ SIGTTIN +21 (tty ) +$ SIGTTOU +22 (tty ) +$ SIGIO +23 ϲǽ +$ SIGXCPU +24 CPU ֤Ķ +$ SIGXFSZ +25 ե륵Ķ +$ SIGVTALRM +26 ۥޤδĶ +$ SIGPROF +27 ץե륿ޤδĶ +$ SIGWINCH +28 ɥѲ +$ SIGINFO +29 ׵ +$ SIGUSR1 +30 桼ʥ 1 +$ SIGUSR2 +31 桼ʥ 2 From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:38:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DAB8106566C; Mon, 9 Nov 2009 12:38:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1908FC1C; Mon, 9 Nov 2009 12:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA9CcD43021380; Mon, 9 Nov 2009 12:38:13 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9CcD4b021377; Mon, 9 Nov 2009 12:38:13 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911091238.nA9CcD4b021377@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 9 Nov 2009 12:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199082 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:38:13 -0000 Author: ume Date: Mon Nov 9 12:38:13 2009 New Revision: 199082 URL: http://svn.freebsd.org/changeset/base/199082 Log: Fix comment. Pointed out by: nyan MFC after: 1 week Modified: head/lib/libc/nls/ja_JP.UTF-8.msg head/lib/libc/nls/ja_JP.eucJP.msg Modified: head/lib/libc/nls/ja_JP.UTF-8.msg ============================================================================== --- head/lib/libc/nls/ja_JP.UTF-8.msg Mon Nov 9 12:33:47 2009 (r199081) +++ head/lib/libc/nls/ja_JP.UTF-8.msg Mon Nov 9 12:38:13 2009 (r199082) @@ -1,6 +1,6 @@ $ $FreeBSD$ $ -$ Message catalog for C locale (template) +$ Message catalog for ja_JP.UTF-8 locale $ $ strerror() support catalog $ Modified: head/lib/libc/nls/ja_JP.eucJP.msg ============================================================================== --- head/lib/libc/nls/ja_JP.eucJP.msg Mon Nov 9 12:33:47 2009 (r199081) +++ head/lib/libc/nls/ja_JP.eucJP.msg Mon Nov 9 12:38:13 2009 (r199082) @@ -1,6 +1,6 @@ $ $FreeBSD$ $ -$ Message catalog for C locale (template) +$ Message catalog for ja_JP.eucJP locale $ $ strerror() support catalog $ From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:42:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51204106568F; Mon, 9 Nov 2009 12:42:32 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id EBC748FC1A; Mon, 9 Nov 2009 12:42:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 0878114D9B6A; Mon, 9 Nov 2009 13:42:29 +0100 (CET) X-Virus-Scanned: amavisd-new at example.com Received: from server.mypc.hu ([127.0.0.1]) by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GRnTWZkTXii9; Mon, 9 Nov 2009 13:42:26 +0100 (CET) Received: from [192.168.1.105] (catv-89-132-179-104.catv.broadband.hu [89.132.179.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 5685A14D9B06; Mon, 9 Nov 2009 13:42:26 +0100 (CET) Message-ID: <4AF80E2D.9060704@FreeBSD.org> Date: Mon, 09 Nov 2009 13:42:21 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Hajimu UMEMOTO References: <200911091233.nA9CXlmU021186@svn.freebsd.org> In-Reply-To: <200911091233.nA9CXlmU021186@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199081 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:42:32 -0000 Hajimu UMEMOTO escribió: > Author: ume > Date: Mon Nov 9 12:33:47 2009 > New Revision: 199081 > URL: http://svn.freebsd.org/changeset/base/199081 > > Log: > Add ja_JP.eucJP catalog. > > Reviewed by: hrs, nork, takawata > MFC after: 1 week > When iconv hits HEAD, I plan to add some Makefile magic to just have the catalogs in one encoding and convert that to all the encodings of the locale. But for now, I think we cannot do anything, so the dulicate catalogs are the only solution I think. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:46:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 853AE106566C; Mon, 9 Nov 2009 12:46:59 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 744058FC16; Mon, 9 Nov 2009 12:46: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 nA9Ckxgh021617; Mon, 9 Nov 2009 12:46:59 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9Ckxhk021614; Mon, 9 Nov 2009 12:46:59 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911091246.nA9Ckxhk021614@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 9 Nov 2009 12:46: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: r199083 - in head/lib/libc: net nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:46:59 -0000 Author: ume Date: Mon Nov 9 12:46:59 2009 New Revision: 199083 URL: http://svn.freebsd.org/changeset/base/199083 Log: Add NLS catalogs support to gai_strerror(3). Controlled by NLS define. Modified: head/lib/libc/net/gai_strerror.c head/lib/libc/nls/C.msg Modified: head/lib/libc/net/gai_strerror.c ============================================================================== --- head/lib/libc/net/gai_strerror.c Mon Nov 9 12:38:13 2009 (r199082) +++ head/lib/libc/net/gai_strerror.c Mon Nov 9 12:46:59 2009 (r199083) @@ -30,7 +30,17 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include +#if defined(NLS) +#include +#include +#include +#include +#include +#include "reentrant.h" +#endif +#include "un-namespace.h" /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */ /* for backward compatibility with userland code prior to 2553bis-02 */ @@ -52,9 +62,57 @@ static const char *ai_errlist[] = { "Argument buffer overflow" /* EAI_OVERFLOW */ }; +#if defined(NLS) +static char gai_buf[NL_TEXTMAX]; +static once_t gai_init_once = ONCE_INITIALIZER; +static thread_key_t gai_key; +static int gai_keycreated = 0; + +static void +gai_keycreate(void) +{ + gai_keycreated = (thr_keycreate(&gai_key, free) == 0); +} +#endif + const char * gai_strerror(int ecode) { +#if defined(NLS) + nl_catd catd; + char *buf; + + if (thr_main() != 0) + buf = gai_buf; + else { + if (thr_once(&gai_init_once, gai_keycreate) != 0 || + !gai_keycreated) + goto thr_err; + if ((buf = thr_getspecific(gai_key)) == NULL) { + if ((buf = malloc(sizeof(gai_buf))) == NULL) + goto thr_err; + if (thr_setspecific(gai_key, buf) != 0) { + free(buf); + goto thr_err; + } + } + } + + catd = catopen("libc", NL_CAT_LOCALE); + if (ecode > 0 && ecode < EAI_MAX) + strlcpy(buf, catgets(catd, 3, ecode, ai_errlist[ecode]), + sizeof(gai_buf)); + else if (ecode == 0) + strlcpy(buf, catgets(catd, 3, NL_MSGMAX - 1, "Success"), + sizeof(gai_buf)); + else + strlcpy(buf, catgets(catd, 3, NL_MSGMAX, "Unknown error"), + sizeof(gai_buf)); + catclose(catd); + return buf; + +thr_err: +#endif if (ecode >= 0 && ecode < EAI_MAX) return ai_errlist[ecode]; return "Unknown error"; Modified: head/lib/libc/nls/C.msg ============================================================================== --- head/lib/libc/nls/C.msg Mon Nov 9 12:38:13 2009 (r199082) +++ head/lib/libc/nls/C.msg Mon Nov 9 12:46:59 2009 (r199083) @@ -257,3 +257,39 @@ $ SIGUSR1 30 User defined signal 1 $ SIGUSR2 31 User defined signal 2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsolete) +1 Address family for hostname not supported +$ EAI_AGAIN +2 Temporary failure in name resolution +$ EAI_BADFLAGS +3 Invalid value for ai_flags +$ EAI_FAIL +4 Non-recoverable failure in name resolution +$ EAI_FAMILY +5 ai_family not supported +$ EAI_MEMORY +6 Memory allocation failure +$ 7 (obsolete) +7 No address associated with hostname +$ EAI_NONAME +8 hostname nor servname provided, or not known +$ EAI_SERVICE +9 servname not supported for ai_socktype +$ EAI_SOCKTYPE +10 ai_socktype not supported +$ EAI_SYSTEM +11 System error returned in errno +$ EAI_BADHINTS +12 Invalid value for hints +$ EAI_PROTOCOL +13 Resolved protocol is unknown +$ EAI_OVERFLOW +14 Argument buffer overflow +$ 0 +32766 Success +$ NL_MSGMAX +32767 Unknown error From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 12:59:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC78A1065676; Mon, 9 Nov 2009 12:59:21 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4B2DE8FC18; Mon, 9 Nov 2009 12:59:21 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2D23E.dip.t-dialin.net [217.226.210.62]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 3377A84403A; Mon, 9 Nov 2009 13:59:14 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 89493298CC2; Mon, 9 Nov 2009 13:59:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1257771550; bh=STFhF3QjZgsKnwW9PXoRtnGuYEGGhibEBIqRBtPt+T8=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=vPu4Qc/0qazafI8ruEthuFgL3c3khoMXfd0ZmbFzXIB5IkRGysCpsARTXkoQ+hwnr aER9nWCABeyJKoPecddzCDVVvY70vowKjWojgCFno1P6KIFkWay5PbsZwK5n0gBGUI jRlAIc+hTGo0ANr7XuSGGbswPeKvHUvIw6Y9dWAlH7EdLys/vG6IVkGeCqgTzZ2kvH RfZF+64oYcYHUlMSv1u47yqWvEgeN+Z+uG4owQmnERSlue9pxr2iGlVuxQxevHTJsq xsq+Ld8ZYc4rtlNCmoUMOizygqYi3ZM+Yvm+peAmUwoiAQ9LeSZqPZkW21zMT746fS IhFGoDnppgzpQ== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id nA9Cx90F077421; Mon, 9 Nov 2009 13:59:09 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 09 Nov 2009 13:59:09 +0100 Message-ID: <20091109135909.19604fhtvmaw7yg4@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 09 Nov 2009 13:59:09 +0100 From: Alexander Leidinger To: Alexander Motin References: <200911081433.nA8EXJnp088767@svn.freebsd.org> In-Reply-To: <200911081433.nA8EXJnp088767@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3.5) / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 3377A84403A.DF4C9 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1258376356.8594@bWx0rpjhNz85unO6SSUYEA X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199050 - in head/sys: conf dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 12:59:21 -0000 Quoting Alexander Motin (from Sun, 8 Nov 2009 14:33:19 +0000 (UTC)): > Log: > Introduce define and kernel option ATA_REQUEST_TIMEOUT to control ATA(4) > command timeout. > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Sun Nov 8 14:28:23 2009 (r199049) > +++ head/sys/conf/NOTES Sun Nov 8 14:33:19 2009 (r199050) > @@ -1715,8 +1715,11 @@ hint.ata.1.irq="15" > # > # ATA_STATIC_ID: controller numbering is static ie depends on location > # else the device numbers are dynamically allocated. > +# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request > +# before timing out. > > options ATA_STATIC_ID > +#options ATA_REQUEST_TIMEOUT=10 Don't we use "$default_value + 1" in NOTES? Bye, Alexander. -- : is not an identifier http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 13:00:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F7D01065676; Mon, 9 Nov 2009 13:00:30 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 253508FC14; Mon, 9 Nov 2009 13:00:30 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nA9D0HUK094714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Nov 2009 22:00:21 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 09 Nov 2009 22:00:17 +0900 Message-ID: From: Hajimu UMEMOTO To: Gabor Kovesdan In-Reply-To: <4AF80E2D.9060704@FreeBSD.org> References: <200911091233.nA9CXlmU021186@svn.freebsd.org> <4AF80E2D.9060704@FreeBSD.org> User-Agent: xcite1.58> Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RC2 X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Mon, 09 Nov 2009 22:00:22 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199081 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 13:00:30 -0000 Hi, >>>>> On Mon, 09 Nov 2009 13:42:21 +0100 >>>>> Gabor Kovesdan said: gabor> When iconv hits HEAD, I plan to add some Makefile magic to just have the gabor> catalogs in one encoding and convert that to all the encodings of the gabor> locale. But for now, I think we cannot do anything, so the dulicate gabor> catalogs are the only solution I think. Oh, it's great! I'm looking forward to see it happen. Tcsh does similar thing at runtime using iconv. Our csh has some trick to load libiconv dynamically. BTW, gencat(1) doesn't like ja_JP.SJIS catalog. So, I could not add ja_JP.SJIS one. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 14:26:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07541065672; Mon, 9 Nov 2009 14:26:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1BB8FC22; Mon, 9 Nov 2009 14:26: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 nA9EQNd1023801; Mon, 9 Nov 2009 14:26:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9EQNnH023799; Mon, 9 Nov 2009 14:26:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911091426.nA9EQNnH023799@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 9 Nov 2009 14:26: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: r199084 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 14:26:23 -0000 Author: nwhitehorn Date: Mon Nov 9 14:26:23 2009 New Revision: 199084 URL: http://svn.freebsd.org/changeset/base/199084 Log: Increase the size of the OFW translations buffer to handle G5 systems that use many translation regions in firmware, and add bounds checking to prevent buffer overflows in case even the new value is exceeded. Reported by: Jacob Lambert MFC after: 3 days Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Nov 9 12:46:59 2009 (r199083) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Nov 9 14:26:23 2009 (r199084) @@ -264,7 +264,7 @@ static struct mem_region *pregions; extern u_int phys_avail_count; extern int regions_sz, pregions_sz; extern int ofw_real_mode; -static struct ofw_map translations[64]; +static struct ofw_map translations[96]; extern struct pmap ofw_pmap; @@ -897,6 +897,9 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o panic("moea64_bootstrap: can't get mmu package"); if ((sz = OF_getproplen(mmu, "translations")) == -1) panic("moea64_bootstrap: can't get ofw translation count"); + if (size > sizeof(translations)) + panic("moea64_bootstrap: too many ofw translations (%d)", + sz/sizeof(*translations)); bzero(translations, sz); if (OF_getprop(mmu, "translations", translations, sz) == -1) From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 15:59:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC932106566B; Mon, 9 Nov 2009 15:59:10 +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 A93958FC22; Mon, 9 Nov 2009 15:59: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 nA9FxAZS026088; Mon, 9 Nov 2009 15:59:10 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9FxArx026087; Mon, 9 Nov 2009 15:59:10 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200911091559.nA9FxArx026087@svn.freebsd.org> From: Rui Paulo Date: Mon, 9 Nov 2009 15:59: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: r199086 - in head/sys: conf dev/usb/input modules/usb modules/usb/atp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 15:59:10 -0000 Author: rpaulo Date: Mon Nov 9 15:59:09 2009 New Revision: 199086 URL: http://svn.freebsd.org/changeset/base/199086 Log: Driver for the Apple Touchpad present on MacBook (non-Pro & Pro). Submitted by: Rohit Grover MFC after: 2 months Added: head/sys/dev/usb/input/atp.c (contents, props changed) head/sys/modules/usb/atp/ head/sys/modules/usb/atp/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 9 15:11:37 2009 (r199085) +++ head/sys/conf/files Mon Nov 9 15:59:09 2009 (r199086) @@ -1698,6 +1698,7 @@ dev/usb/misc/udbp.c optional udbp # # USB input drivers # +dev/usb/input/atp.c optional atp dev/usb/input/uhid.c optional uhid dev/usb/input/ukbd.c optional ukbd dev/usb/input/ums.c optional ums Added: head/sys/dev/usb/input/atp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/input/atp.c Mon Nov 9 15:59:09 2009 (r199086) @@ -0,0 +1,2047 @@ +/*- + * Copyright (c) 2009 Rohit Grover + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR atp_debug +#include + +#include + +#define ATP_DRIVER_NAME "atp" + +/* + * Driver specific options: the following options may be set by + * `options' statements in the kernel configuration file. + */ + +/* The multiplier used to translate sensor reported positions to mickeys. */ +#ifndef ATP_SCALE_FACTOR +#define ATP_SCALE_FACTOR 48 +#endif + +/* + * This is the age (in microseconds) beyond which a touch is + * considered to be a slide; and therefore a tap event isn't registered. + */ +#ifndef ATP_TOUCH_TIMEOUT +#define ATP_TOUCH_TIMEOUT 125000 +#endif + +/* + * A double-tap followed by a single-finger slide is treated as a + * special gesture. The driver responds to this gesture by assuming a + * virtual button-press for the lifetime of the slide. The following + * threshold is the maximum time gap (in microseconds) between the two + * tap events preceding the slide for such a gesture. + */ +#ifndef ATP_DOUBLE_TAP_N_DRAG_THRESHOLD +#define ATP_DOUBLE_TAP_N_DRAG_THRESHOLD 200000 +#endif + +/* + * The device provides us only with pressure readings from an array of + * X and Y sensors; for our algorithms, we need to interpret groups + * (typically pairs) of X and Y readings as being related to a single + * finger stroke. We can relate X and Y readings based on their times + * of incidence. The coincidence window should be at least 10000us + * since it is used against values from getmicrotime(), which has a + * precision of around 10ms. + */ +#ifndef ATP_COINCIDENCE_THRESHOLD +#define ATP_COINCIDENCE_THRESHOLD 40000 /* unit: microseconds */ +#if ATP_COINCIDENCE_THRESHOLD > 100000 +#error "ATP_COINCIDENCE_THRESHOLD too large" +#endif +#endif /* #ifndef ATP_COINCIDENCE_THRESHOLD */ + +/* + * The wait duration (in microseconds) after losing a touch contact + * before zombied strokes are reaped and turned into button events. + */ +#define ATP_ZOMBIE_STROKE_REAP_WINDOW 50000 +#if ATP_ZOMBIE_STROKE_REAP_WINDOW > 100000 +#error "ATP_ZOMBIE_STROKE_REAP_WINDOW too large" +#endif + +/* end of driver specific options */ + + +/* Tunables */ +SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); + +#if USB_DEBUG +enum atp_log_level { + ATP_LLEVEL_DISABLED = 0, + ATP_LLEVEL_ERROR, + ATP_LLEVEL_DEBUG, /* for troubleshooting */ + ATP_LLEVEL_INFO, /* for diagnostics */ +}; +static int atp_debug = ATP_LLEVEL_ERROR; /* the default is to only log errors */ +SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW, + &atp_debug, ATP_LLEVEL_ERROR, "ATP debug level"); +#endif /* #if USB_DEBUG */ + +static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT; +SYSCTL_INT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, &atp_touch_timeout, + 125000, "age threshold (in micros) for a touch"); + +static u_int atp_double_tap_threshold = ATP_DOUBLE_TAP_N_DRAG_THRESHOLD; +SYSCTL_INT(_hw_usb_atp, OID_AUTO, double_tap_threshold, CTLFLAG_RW, + &atp_double_tap_threshold, ATP_DOUBLE_TAP_N_DRAG_THRESHOLD, + "maximum time (in micros) between a double-tap"); + +static u_int atp_mickeys_scale_factor = ATP_SCALE_FACTOR; +static int atp_sysctl_scale_factor_handler(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_hw_usb_atp, OID_AUTO, scale_factor, CTLTYPE_UINT | CTLFLAG_RW, + &atp_mickeys_scale_factor, sizeof(atp_mickeys_scale_factor), + atp_sysctl_scale_factor_handler, "IU", "movement scale factor"); + +static u_int atp_small_movement_threshold = ATP_SCALE_FACTOR >> 3; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, small_movement, CTLFLAG_RW, + &atp_small_movement_threshold, ATP_SCALE_FACTOR >> 3, + "the small movement black-hole for filtering noise"); +/* + * The movement threshold for a stroke; this is the maximum difference + * in position which will be resolved as a continuation of a stroke + * component. + */ +static u_int atp_max_delta_mickeys = ((3 * ATP_SCALE_FACTOR) >> 1); +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, max_delta_mickeys, CTLFLAG_RW, + &atp_max_delta_mickeys, ((3 * ATP_SCALE_FACTOR) >> 1), + "max. mickeys-delta which will match against an existing stroke"); +/* + * Strokes which accumulate at least this amount of absolute movement + * from the aggregate of their components are considered as + * slides. Unit: mickeys. + */ +static u_int atp_slide_min_movement = (ATP_SCALE_FACTOR >> 3); +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, slide_min_movement, CTLFLAG_RW, + &atp_slide_min_movement, (ATP_SCALE_FACTOR >> 3), + "strokes with at least this amt. of movement are considered slides"); + +/* + * The minimum age of a stroke for it to be considered mature; this + * helps filter movements (noise) from immature strokes. Units: interrupts. + */ +static u_int atp_stroke_maturity_threshold = 2; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, stroke_maturity_threshold, CTLFLAG_RW, + &atp_stroke_maturity_threshold, 2, + "the minimum age of a stroke for it to be considered mature"); + +/* Accept pressure readings from sensors only if above this value. */ +static u_int atp_sensor_noise_threshold = 2; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, sensor_noise_threshold, CTLFLAG_RW, + &atp_sensor_noise_threshold, 2, + "accept pressure readings from sensors only if above this value"); + +/* Ignore pressure spans with cumulative press. below this value. */ +static u_int atp_pspan_min_cum_pressure = 10; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan_min_cum_pressure, CTLFLAG_RW, + &atp_pspan_min_cum_pressure, 10, + "ignore pressure spans with cumulative press. below this value"); + +/* Maximum allowed width for pressure-spans.*/ +static u_int atp_pspan_max_width = 4; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan_max_width, CTLFLAG_RW, + &atp_pspan_max_width, 4, + "maximum allowed width (in sensors) for pressure-spans"); + + +/* Define the various flavours of devices supported by this driver. */ +enum { + ATP_DEV_PARAMS_0, + ATP_N_DEV_PARAMS +}; +struct atp_dev_params { + u_int data_len; /* for sensor data */ + u_int n_xsensors; + u_int n_ysensors; +} atp_dev_params[ATP_N_DEV_PARAMS] = { + [ATP_DEV_PARAMS_0] = { + .data_len = 64, + .n_xsensors = 20, + .n_ysensors = 10 + }, +}; + +static const struct usb_device_id atp_devs[] = { + /* Core Duo MacBook & MacBook Pro */ + { USB_VPI(USB_VENDOR_APPLE, 0x0217, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0218, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0219, ATP_DEV_PARAMS_0) }, + + /* Core2 Duo MacBook & MacBook Pro */ + { USB_VPI(USB_VENDOR_APPLE, 0x021a, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021b, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021c, ATP_DEV_PARAMS_0) }, + + /* Core2 Duo MacBook3,1 */ + { USB_VPI(USB_VENDOR_APPLE, 0x0229, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x022a, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x022b, ATP_DEV_PARAMS_0) }, +}; + +/* + * The following structure captures the state of a pressure span along + * an axis. Each contact with the touchpad results in separate + * pressure spans along the two axes. + */ +typedef struct atp_pspan { + u_int width; /* in units of sensors */ + u_int cum; /* cumulative compression (from all sensors) */ + u_int cog; /* center of gravity */ + u_int loc; /* location (scaled using the mickeys factor) */ + boolean_t matched; /* to track pspans as they match against strokes. */ +} atp_pspan; + +typedef enum atp_stroke_type { + ATP_STROKE_TOUCH, + ATP_STROKE_SLIDE, +} atp_stroke_type; + +#define ATP_MAX_PSPANS_PER_AXIS 3 + +typedef struct atp_stroke_component { + /* Fields encapsulating the pressure-span. */ + u_int loc; /* location (scaled) */ + u_int cum_pressure; /* cumulative compression */ + u_int max_cum_pressure; /* max cumulative compression */ + boolean_t matched; /*to track components as they match against pspans.*/ + + /* Fields containing information about movement. */ + int delta_mickeys; /* change in location (un-smoothened movement)*/ + int pending; /* cum. of pending short movements */ + int movement; /* current smoothened movement */ +} atp_stroke_component; + +typedef enum atp_axis { + X = 0, + Y = 1 +} atp_axis; + +#define ATP_MAX_STROKES (2 * ATP_MAX_PSPANS_PER_AXIS) + +/* + * The following structure captures a finger contact with the + * touchpad. A stroke comprises two p-span components and some state. + */ +typedef struct atp_stroke { + atp_stroke_type type; + struct timeval ctime; /* create time; for coincident siblings. */ + u_int age; /* + * Unit: interrupts; we maintain + * this value in addition to + * 'ctime' in order to avoid the + * expensive call to microtime() + * at every interrupt. + */ + + atp_stroke_component components[2]; + u_int velocity_squared; /* + * Average magnitude (squared) + * of recent velocity. + */ + u_int cum_movement; /* cum. absolute movement so far */ + + uint32_t flags; /* the state of this stroke */ +#define ATSF_ZOMBIE 0x1 +} atp_stroke; + +#define ATP_FIFO_BUF_SIZE 8 /* bytes */ +#define ATP_FIFO_QUEUE_MAXLEN 50 /* units */ + +enum { + ATP_INTR_DT, + ATP_N_TRANSFER, +}; + +struct atp_softc { + device_t sc_dev; + struct usb_device *sc_usb_device; +#define MODE_LENGTH 8 + char sc_mode_bytes[MODE_LENGTH]; /* device mode */ + struct mtx sc_mutex; /* for synchronization */ + struct usb_xfer *sc_xfer[ATP_N_TRANSFER]; + struct usb_fifo_sc sc_fifo; + + struct atp_dev_params *sc_params; + + mousehw_t sc_hw; + mousemode_t sc_mode; + u_int sc_pollrate; + mousestatus_t sc_status; + u_int sc_state; +#define ATP_ENABLED 0x01 +#define ATP_ZOMBIES_EXIST 0x02 +#define ATP_DOUBLE_TAP_DRAG 0x04 + + u_int sc_left_margin; + u_int sc_right_margin; + + atp_stroke sc_strokes[ATP_MAX_STROKES]; + u_int sc_n_strokes; + + int8_t *sensor_data; /* from interrupt packet */ + int *base_x; /* base sensor readings */ + int *base_y; + int *cur_x; /* current sensor readings */ + int *cur_y; + int *pressure_x; /* computed pressures */ + int *pressure_y; + + u_int sc_idlecount; /* preceding idle interrupts */ +#define ATP_IDLENESS_THRESHOLD 10 + + struct timeval sc_reap_time; + struct timeval sc_reap_ctime; /*ctime of siblings to be reaped*/ +}; + +/* + * The last byte of the sensor data contains status bits; the + * following values define the meanings of these bits. + */ +enum atp_status_bits { + ATP_STATUS_BUTTON = (uint8_t)0x01, /* The button was pressed */ + ATP_STATUS_BASE_UPDATE = (uint8_t)0x04, /* Data from an untouched pad.*/ +}; + +typedef enum interface_mode { + RAW_SENSOR_MODE = (uint8_t)0x04, + HID_MODE = (uint8_t)0x08 +} interface_mode; + +/* + * function prototypes + */ +static usb_fifo_cmd_t atp_start_read; +static usb_fifo_cmd_t atp_stop_read; +static usb_fifo_open_t atp_open; +static usb_fifo_close_t atp_close; +static usb_fifo_ioctl_t atp_ioctl; + +static struct usb_fifo_methods atp_fifo_methods = { + .f_open = &atp_open, + .f_close = &atp_close, + .f_ioctl = &atp_ioctl, + .f_start_read = &atp_start_read, + .f_stop_read = &atp_stop_read, + .basename[0] = ATP_DRIVER_NAME, +}; + +/* device initialization and shutdown */ +static usb_error_t atp_req_get_report(struct usb_device *udev, void *data); +static int atp_set_device_mode(device_t dev, interface_mode mode); +static int atp_enable(struct atp_softc *sc); +static void atp_disable(struct atp_softc *sc); +static int atp_softc_populate(struct atp_softc *); +static void atp_softc_unpopulate(struct atp_softc *); + +/* sensor interpretation */ +static __inline void atp_interpret_sensor_data(const int8_t *, u_int, u_int, + int *); +static __inline void atp_get_pressures(int *, const int *, const int *, int); +static void atp_detect_pspans(int *, u_int, u_int, atp_pspan *, + u_int *); + +/* movement detection */ +static boolean_t atp_match_stroke_component(atp_stroke_component *, + const atp_pspan *); +static void atp_match_strokes_against_pspans(struct atp_softc *, + atp_axis, atp_pspan *, u_int, u_int); +static boolean_t atp_update_strokes(struct atp_softc *, + atp_pspan *, u_int, atp_pspan *, u_int); +static __inline void atp_add_stroke(struct atp_softc *, const atp_pspan *, + const atp_pspan *); +static void atp_add_new_strokes(struct atp_softc *, atp_pspan *, + u_int, atp_pspan *, u_int); +static void atp_advance_stroke_state(struct atp_softc *, + atp_stroke *, boolean_t *); +static void atp_terminate_stroke(struct atp_softc *, u_int); +static __inline boolean_t atp_stroke_has_small_movement(const atp_stroke *); +static __inline void atp_update_pending_mickeys(atp_stroke_component *); +static void atp_compute_smoothening_scale_ratio(atp_stroke *, int *, + int *); +static boolean_t atp_compute_stroke_movement(atp_stroke *); + +/* tap detection */ +static __inline void atp_setup_reap_time(struct atp_softc *, struct timeval *); +static void atp_reap_zombies(struct atp_softc *, u_int *, u_int *); + +/* updating fifo */ +static void atp_reset_buf(struct atp_softc *sc); +static void atp_add_to_queue(struct atp_softc *, int, int, uint32_t); + + +usb_error_t +atp_req_get_report(struct usb_device *udev, void *data) +{ + struct usb_device_request req; + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UR_GET_REPORT; + USETW2(req.wValue, (uint8_t)0x03 /* type */, (uint8_t)0x00 /* id */); + USETW(req.wIndex, 0); + USETW(req.wLength, MODE_LENGTH); + + return (usbd_do_request(udev, NULL /* mutex */, &req, data)); +} + +static int +atp_set_device_mode(device_t dev, interface_mode mode) +{ + struct atp_softc *sc; + usb_device_request_t req; + usb_error_t err; + + if ((mode != RAW_SENSOR_MODE) && (mode != HID_MODE)) + return (ENXIO); + + sc = device_get_softc(dev); + + sc->sc_mode_bytes[0] = mode; + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UR_SET_REPORT; + USETW2(req.wValue, (uint8_t)0x03 /* type */, (uint8_t)0x00 /* id */); + USETW(req.wIndex, 0); + USETW(req.wLength, MODE_LENGTH); + err = usbd_do_request(sc->sc_usb_device, NULL, &req, sc->sc_mode_bytes); + if (err != USB_ERR_NORMAL_COMPLETION) + return (ENXIO); + + return (0); +} + +static int +atp_enable(struct atp_softc *sc) +{ + /* Allocate the dynamic buffers */ + if (atp_softc_populate(sc) != 0) { + atp_softc_unpopulate(sc); + return (ENOMEM); + } + + /* reset status */ + memset(sc->sc_strokes, 0, sizeof(sc->sc_strokes)); + sc->sc_n_strokes = 0; + memset(&sc->sc_status, 0, sizeof(sc->sc_status)); + sc->sc_idlecount = 0; + sc->sc_state |= ATP_ENABLED; + + DPRINTFN(ATP_LLEVEL_INFO, "enabled atp\n"); + return (0); +} + +static void +atp_disable(struct atp_softc *sc) +{ + atp_softc_unpopulate(sc); + + sc->sc_state &= ~ATP_ENABLED; + DPRINTFN(ATP_LLEVEL_INFO, "disabled atp\n"); +} + +/* Allocate dynamic memory for some fields in softc. */ +static int +atp_softc_populate(struct atp_softc *sc) +{ + const struct atp_dev_params *params = sc->sc_params; + + if (params == NULL) { + DPRINTF("params uninitialized!\n"); + return (ENXIO); + } + if (params->data_len) { + sc->sensor_data = malloc(params->data_len * sizeof(int8_t), + M_USB, M_WAITOK); + if (sc->sensor_data == NULL) { + DPRINTF("mem for sensor_data\n"); + return (ENXIO); + } + } + + if (params->n_xsensors != 0) { + sc->base_x = malloc(params->n_xsensors * sizeof(*(sc->base_x)), + M_USB, M_WAITOK); + if (sc->base_x == NULL) { + DPRINTF("mem for sc->base_x\n"); + return (ENXIO); + } + + sc->cur_x = malloc(params->n_xsensors * sizeof(*(sc->cur_x)), + M_USB, M_WAITOK); + if (sc->cur_x == NULL) { + DPRINTF("mem for sc->cur_x\n"); + return (ENXIO); + } + + sc->pressure_x = + malloc(params->n_xsensors * sizeof(*(sc->pressure_x)), + M_USB, M_WAITOK); + if (sc->pressure_x == NULL) { + DPRINTF("mem. for pressure_x\n"); + return (ENXIO); + } + } + + if (params->n_ysensors != 0) { + sc->base_y = malloc(params->n_ysensors * sizeof(*(sc->base_y)), + M_USB, M_WAITOK); + if (sc->base_y == NULL) { + DPRINTF("mem for base_y\n"); + return (ENXIO); + } + + sc->cur_y = malloc(params->n_ysensors * sizeof(*(sc->cur_y)), + M_USB, M_WAITOK); + if (sc->cur_y == NULL) { + DPRINTF("mem for cur_y\n"); + return (ENXIO); + } + + sc->pressure_y = + malloc(params->n_ysensors * sizeof(*(sc->pressure_y)), + M_USB, M_WAITOK); + if (sc->pressure_y == NULL) { + DPRINTF("mem. for pressure_y\n"); + return (ENXIO); + } + } + + return (0); +} + +/* Free dynamic memory allocated for some fields in softc. */ +static void +atp_softc_unpopulate(struct atp_softc *sc) +{ + const struct atp_dev_params *params = sc->sc_params; + + if (params == NULL) { + return; + } + if (params->n_xsensors != 0) { + if (sc->base_x != NULL) { + free(sc->base_x, M_USB); + sc->base_x = NULL; + } + + if (sc->cur_x != NULL) { + free(sc->cur_x, M_USB); + sc->cur_x = NULL; + } + + if (sc->pressure_x != NULL) { + free(sc->pressure_x, M_USB); + sc->pressure_x = NULL; + } + } + if (params->n_ysensors != 0) { + if (sc->base_y != NULL) { + free(sc->base_y, M_USB); + sc->base_y = NULL; + } + + if (sc->cur_y != NULL) { + free(sc->cur_y, M_USB); + sc->cur_y = NULL; + } + + if (sc->pressure_y != NULL) { + free(sc->pressure_y, M_USB); + sc->pressure_y = NULL; + } + } + if (sc->sensor_data != NULL) { + free(sc->sensor_data, M_USB); + sc->sensor_data = NULL; + } +} + +/* + * Interpret the data from the X and Y pressure sensors. This function + * is called separately for the X and Y sensor arrays. The data in the + * USB packet is laid out in the following manner: + * + * sensor_data: + * --,--,Y1,Y2,--,Y3,Y4,--,Y5,...,Y10, ... X1,X2,--,X3,X4 + * indices: 0 1 2 3 4 5 6 7 8 ... 15 ... 20 21 22 23 24 + * + * '--' (in the above) indicates that the value is unimportant. + * + * Information about the above layout was obtained from the + * implementation of the AppleTouch driver in Linux. + * + * parameters: + * sensor_data + * raw sensor data from the USB packet. + * num + * The number of elements in the array 'arr'. + * di_start + * The index of the first data element to be interpreted for + * this sensor array--i.e. when called to interpret the Y + * sensors, di_start passed in as 2, which is the index of Y1 in + * the raw data. + * arr + * The array to be initialized with the readings. + */ +static __inline void +atp_interpret_sensor_data(const int8_t *sensor_data, u_int num, u_int di_start, + int *arr) +{ + u_int i; + u_int di; /* index into sensor data */ + + for (i = 0, di = di_start; i < num; /* empty */ ) { + arr[i++] = sensor_data[di++]; + arr[i++] = sensor_data[di++]; + di++; + } +} + +static __inline void +atp_get_pressures(int *p, const int *cur, const int *base, int n) +{ + int i; + + for (i = 0; i < n; i++) { + p[i] = cur[i] - base[i]; + if (p[i] > 127) + p[i] -= 256; + if (p[i] < -127) + p[i] += 256; + if (p[i] < 0) + p[i] = 0; + + /* + * Shave off pressures below the noise-pressure + * threshold; this will reduce the contribution from + * lower pressure readings. + */ + if (p[i] <= atp_sensor_noise_threshold) + p[i] = 0; /* filter away noise */ + else + p[i] -= atp_sensor_noise_threshold; + } +} + +static void +atp_detect_pspans(int *p, u_int num_sensors, + u_int max_spans, /* max # of pspans permitted */ + atp_pspan *spans, /* finger spans */ + u_int *nspans_p) /* num spans detected */ +{ + u_int i; + int maxp; /* max pressure seen within a span */ + u_int num_spans = 0; + + enum atp_pspan_state { + ATP_PSPAN_INACTIVE, + ATP_PSPAN_INCREASING, + ATP_PSPAN_DECREASING, + } state; /* state of the pressure span */ + + /* + * The following is a simple state machine to track + * the phase of the pressure span. + */ + memset(spans, 0, max_spans * sizeof(atp_pspan)); + maxp = 0; + state = ATP_PSPAN_INACTIVE; + for (i = 0; i < num_sensors; i++) { + if (num_spans >= max_spans) + break; + + if (p[i] == 0) { + if (state == ATP_PSPAN_INACTIVE) { + /* + * There is no pressure information for this + * sensor, and we aren't tracking a finger. + */ + continue; + } else { + state = ATP_PSPAN_INACTIVE; + maxp = 0; + num_spans++; + } + } else { + switch (state) { + case ATP_PSPAN_INACTIVE: + state = ATP_PSPAN_INCREASING; + maxp = p[i]; + break; + + case ATP_PSPAN_INCREASING: + if (p[i] > maxp) + maxp = p[i]; + else if (p[i] <= (maxp >> 1)) + state = ATP_PSPAN_DECREASING; + break; + + case ATP_PSPAN_DECREASING: + if (p[i] > p[i - 1]) { + /* + * This is the beginning of + * another span; change state + * to give the appearance that + * we're starting from an + * inactive span, and then + * re-process this reading in + * the next iteration. + */ + num_spans++; + state = ATP_PSPAN_INACTIVE; + maxp = 0; + i--; + continue; + } + break; + } + + /* Update the finger span with this reading. */ + spans[num_spans].width++; + spans[num_spans].cum += p[i]; + spans[num_spans].cog += p[i] * (i + 1); + } + } + if (state != ATP_PSPAN_INACTIVE) + num_spans++; /* close the last finger span */ + + /* post-process the spans */ + for (i = 0; i < num_spans; i++) { + /* filter away unwanted pressure spans */ + if ((spans[i].cum < atp_pspan_min_cum_pressure) || + (spans[i].width > atp_pspan_max_width)) { + if ((i + 1) < num_spans) { + memcpy(&spans[i], &spans[i + 1], + (num_spans - i - 1) * sizeof(atp_pspan)); + i--; + } + num_spans--; + continue; + } + + /* compute this span's representative location */ + spans[i].loc = spans[i].cog * atp_mickeys_scale_factor / + spans[i].cum; + + spans[i].matched = FALSE; /* not yet matched against a stroke */ + } + + *nspans_p = num_spans; +} + +/* + * Match a pressure-span against a stroke-component. If there is a + * match, update the component's state and return TRUE. + */ +static boolean_t +atp_match_stroke_component(atp_stroke_component *component, + const atp_pspan *pspan) +{ + int delta_mickeys = pspan->loc - component->loc; + + if (abs(delta_mickeys) > atp_max_delta_mickeys) + return (FALSE); /* the finger span is too far out; no match */ + + component->loc = pspan->loc; + component->cum_pressure = pspan->cum; + if (pspan->cum > component->max_cum_pressure) + component->max_cum_pressure = pspan->cum; + + /* + * If the cumulative pressure drops below a quarter of the max, + * then disregard the component's movement. + */ + if (component->cum_pressure < (component->max_cum_pressure >> 2)) + delta_mickeys = 0; + + component->delta_mickeys = delta_mickeys; + return (TRUE); +} + +static void +atp_match_strokes_against_pspans(struct atp_softc *sc, atp_axis axis, + atp_pspan *pspans, u_int n_pspans, u_int repeat_count) +{ + u_int i, j; + u_int repeat_index = 0; + + /* Determine the index of the multi-span. */ + if (repeat_count) { + u_int cum = 0; + for (i = 0; i < n_pspans; i++) { + if (pspans[i].cum > cum) { + repeat_index = i; + cum = pspans[i].cum; + } + } + } + + for (i = 0; i < sc->sc_n_strokes; i++) { + atp_stroke *stroke = &sc->sc_strokes[i]; + if (stroke->components[axis].matched) + continue; /* skip matched components */ + + for (j = 0; j < n_pspans; j++) { + if (pspans[j].matched) + continue; /* skip matched pspans */ + + if (atp_match_stroke_component( + &stroke->components[axis], &pspans[j])) { + /* There is a match. */ + stroke->components[axis].matched = TRUE; + + /* Take care to repeat at the multi-span. */ + if ((repeat_count > 0) && (j == repeat_index)) + repeat_count--; + else + pspans[j].matched = TRUE; + + break; /* skip to the next stroke */ + } + } /* loop over pspans */ + } /* loop over strokes */ +} + +/* + * Update strokes by matching against current pressure-spans. + * Return TRUE if any movement is detected. + */ +static boolean_t +atp_update_strokes(struct atp_softc *sc, atp_pspan *pspans_x, + u_int n_xpspans, atp_pspan *pspans_y, u_int n_ypspans) +{ + u_int i, j; + atp_stroke *stroke; + boolean_t movement = FALSE; + u_int repeat_count = 0; + + /* Reset X and Y components of all strokes as unmatched. */ + for (i = 0; i < sc->sc_n_strokes; i++) { + stroke = &sc->sc_strokes[i]; + stroke->components[X].matched = FALSE; + stroke->components[Y].matched = FALSE; + } + + /* + * Usually, the X and Y pspans come in pairs (the common case + * being a single pair). It is possible, however, that + * multiple contacts resolve to a single pspan along an + * axis, as illustrated in the following: + * + * F = finger-contact + * + * pspan pspan + * +-----------------------+ + * | . . | + * | . . | + * | . . | + * | . . | + * pspan |.........F......F | + * | | + * | | + * | | + * +-----------------------+ + * + * + * The above case can be detected by a difference in the + * number of X and Y pspans. When this happens, X and Y pspans + * aren't easy to pair or match against strokes. + * + * When X and Y pspans differ in number, the axis with the + * smaller number of pspans is regarded as having a repeating + * pspan (or a multi-pspan)--in the above illustration, the + * Y-axis has a repeating pspan. Our approach is to try to + * match the multi-pspan repeatedly against strokes. The + * difference between the number of X and Y pspans gives us a + * crude repeat_count for matching multi-pspans--i.e. the + * multi-pspan along the Y axis (above) has a repeat_count of 1. + */ + repeat_count = abs(n_xpspans - n_ypspans); + + atp_match_strokes_against_pspans(sc, X, pspans_x, n_xpspans, + (((repeat_count != 0) && ((n_xpspans < n_ypspans))) ? + repeat_count : 0)); + atp_match_strokes_against_pspans(sc, Y, pspans_y, n_ypspans, + (((repeat_count != 0) && (n_ypspans < n_xpspans)) ? + repeat_count : 0)); + + /* Update the state of strokes based on the above pspan matches. */ + for (i = 0; i < sc->sc_n_strokes; i++) { + stroke = &sc->sc_strokes[i]; + if (stroke->components[X].matched && + stroke->components[Y].matched) { + atp_advance_stroke_state(sc, stroke, &movement); + } else { + /* + * At least one component of this stroke + * didn't match against current pspans; + * terminate it. + */ + atp_terminate_stroke(sc, i); + } + } + + /* Add new strokes for pairs of unmatched pspans */ + for (i = 0; i < n_xpspans; i++) { + if (pspans_x[i].matched == FALSE) break; + } + for (j = 0; j < n_ypspans; j++) { + if (pspans_y[j].matched == FALSE) break; + } + if ((i < n_xpspans) && (j < n_ypspans)) { +#if USB_DEBUG + if (atp_debug >= ATP_LLEVEL_INFO) { + printf("unmatched pspans:"); + for (; i < n_xpspans; i++) { + if (pspans_x[i].matched) + continue; + printf(" X:[loc:%u,cum:%u]", + pspans_x[i].loc, pspans_x[i].cum); + } + for (; j < n_ypspans; j++) { + if (pspans_y[j].matched) + continue; + printf(" Y:[loc:%u,cum:%u]", + pspans_y[j].loc, pspans_y[j].cum); + } + printf("\n"); + } +#endif /* #if USB_DEBUG */ + if ((n_xpspans == 1) && (n_ypspans == 1)) + /* The common case of a single pair of new pspans. */ + atp_add_stroke(sc, &pspans_x[0], &pspans_y[0]); + else + atp_add_new_strokes(sc, + pspans_x, n_xpspans, + pspans_y, n_ypspans); + } + +#if USB_DEBUG + if (atp_debug >= ATP_LLEVEL_INFO) { + for (i = 0; i < sc->sc_n_strokes; i++) { + atp_stroke *stroke = &sc->sc_strokes[i]; + + printf(" %s%clc:%u,dm:%d,pnd:%d,mv:%d%c" + ",%clc:%u,dm:%d,pnd:%d,mv:%d%c", + (stroke->flags & ATSF_ZOMBIE) ? "zomb:" : "", + (stroke->type == ATP_STROKE_TOUCH) ? '[' : '<', + stroke->components[X].loc, + stroke->components[X].delta_mickeys, + stroke->components[X].pending, + stroke->components[X].movement, + (stroke->type == ATP_STROKE_TOUCH) ? ']' : '>', + (stroke->type == ATP_STROKE_TOUCH) ? '[' : '<', + stroke->components[Y].loc, + stroke->components[Y].delta_mickeys, + stroke->components[Y].pending, + stroke->components[Y].movement, + (stroke->type == ATP_STROKE_TOUCH) ? ']' : '>'); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 16:05:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0EB106566C; Mon, 9 Nov 2009 16:05: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 3E6C78FC23; Mon, 9 Nov 2009 16:05: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 nA9G5XDV026348; Mon, 9 Nov 2009 16:05:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9G5XLQ026346; Mon, 9 Nov 2009 16:05:33 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200911091605.nA9G5XLQ026346@svn.freebsd.org> From: Rui Paulo Date: Mon, 9 Nov 2009 16:05: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: r199087 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 16:05:33 -0000 Author: rpaulo Date: Mon Nov 9 16:05:32 2009 New Revision: 199087 URL: http://svn.freebsd.org/changeset/base/199087 Log: Mention the layout change of ieee80211req_scan_result. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Nov 9 15:59:09 2009 (r199086) +++ head/UPDATING Mon Nov 9 16:05:32 2009 (r199087) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20091109: + The layout of the structure ieee80211req_scan_result has changed. + Applications that require wireless scan results (e.g. ifconfig(8)) + from net80211 need to be recompiled. + 20091025: The iwn(4) driver has been updated to support the 5000 and 5150 series. There's one kernel module for each firmware. Adding "device iwnfw" From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 17:26:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3CE1065672; Mon, 9 Nov 2009 17:26:17 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC658FC16; Mon, 9 Nov 2009 17: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 nA9HQGeQ028257; Mon, 9 Nov 2009 17:26:16 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9HQGuJ028254; Mon, 9 Nov 2009 17:26:16 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911091726.nA9HQGuJ028254@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 9 Nov 2009 17:26: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: r199092 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 17:26:17 -0000 Author: ume Date: Mon Nov 9 17:26:16 2009 New Revision: 199092 URL: http://svn.freebsd.org/changeset/base/199092 Log: Add gai_strerror() catalog for ja_JP.UTF-8 and ja_JP.eucJP. Modified: head/lib/libc/nls/ja_JP.UTF-8.msg head/lib/libc/nls/ja_JP.eucJP.msg Modified: head/lib/libc/nls/ja_JP.UTF-8.msg ============================================================================== --- head/lib/libc/nls/ja_JP.UTF-8.msg Mon Nov 9 16:43:50 2009 (r199091) +++ head/lib/libc/nls/ja_JP.UTF-8.msg Mon Nov 9 17:26:16 2009 (r199092) @@ -247,3 +247,39 @@ $ SIGUSR1 30 ユーザ定義シグナル 1 $ SIGUSR2 31 ユーザ定義シグナル 2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsolete) +1 ホスト名のアドレスファミリーはサポートされません +$ EAI_AGAIN +2 名前解決での一時的な失敗 +$ EAI_BADFLAGS +3 ai_flags の値が無効 +$ EAI_FAIL +4 名前解決での回復不能な失敗 +$ EAI_FAMILY +5 ai_family はサポートされません +$ EAI_MEMORY +6 メモリ割り当て失敗 +$ 7 (obsolete) +7 ホスト名に対応するアドレスはありません +$ EAI_NONAME +8 ホスト名かサービス名が指定されない、または不明 +$ EAI_SERVICE +9 サービス名は ai_socktype に対してサポートされません +$ EAI_SOCKTYPE +10 ai_socktype はサポートされません +$ EAI_SYSTEM +11 システムエラー、errno 参照 +$ EAI_BADHINTS +12 hints の値が無効 +$ EAI_PROTOCOL +13 解決されたプロトコルは不明です +$ EAI_OVERFLOW +14 引数バッファオーバフロー +$ 0 +32766 成功 +$ NL_MSGMAX +32767 不明なエラー Modified: head/lib/libc/nls/ja_JP.eucJP.msg ============================================================================== --- head/lib/libc/nls/ja_JP.eucJP.msg Mon Nov 9 16:43:50 2009 (r199091) +++ head/lib/libc/nls/ja_JP.eucJP.msg Mon Nov 9 17:26:16 2009 (r199092) @@ -247,3 +247,39 @@ $ SIGUSR1 30 桼ʥ 1 $ SIGUSR2 31 桼ʥ 2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsolete) +1 ۥ̾Υɥ쥹եߥ꡼ϥݡȤޤ +$ EAI_AGAIN +2 ̾ǤΰŪʼ +$ EAI_BADFLAGS +3 ai_flags ̵ͤ +$ EAI_FAIL +4 ̾Ǥβǽʼ +$ EAI_FAMILY +5 ai_family ϥݡȤޤ +$ EAI_MEMORY +6 Ƽ +$ 7 (obsolete) +7 ۥ̾б륢ɥ쥹Ϥޤ +$ EAI_NONAME +8 ۥ̾ӥ̾ꤵʤޤ +$ EAI_SERVICE +9 ӥ̾ ai_socktype ФƥݡȤޤ +$ EAI_SOCKTYPE +10 ai_socktype ϥݡȤޤ +$ EAI_SYSTEM +11 ƥ२顼errno +$ EAI_BADHINTS +12 hints ̵ͤ +$ EAI_PROTOCOL +13 褵줿ץȥǤ +$ EAI_OVERFLOW +14 ХåեХե +$ 0 +32766 +$ NL_MSGMAX +32767 ʥ顼 From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 18:20:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 938021065676; Mon, 9 Nov 2009 18:20:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 19F7D8FC16; Mon, 9 Nov 2009 18:20:38 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 74C8E581BD; Mon, 9 Nov 2009 12:20:37 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 7lkeJiFUy2KQ; Mon, 9 Nov 2009 12:20:37 -0600 (CST) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-55-200.icecube.wisc.edu [172.16.55.200]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 55DC758176; Mon, 9 Nov 2009 12:20:37 -0600 (CST) Message-ID: <4AF85D75.1010605@freebsd.org> Date: Mon, 09 Nov 2009 12:20:37 -0600 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.23 (X11/20090909) MIME-Version: 1.0 To: Alexander Motin References: <200911091139.nA9BdpAU019880@svn.freebsd.org> In-Reply-To: <200911091139.nA9BdpAU019880@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199079 - head/sbin/camcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 18:20:38 -0000 Alexander Motin wrote: > Author: mav > Date: Mon Nov 9 11:39:51 2009 > New Revision: 199079 > URL: http://svn.freebsd.org/changeset/base/199079 > > Log: > Add support for ATA Power Management. > > Modified: > head/sbin/camcontrol/camcontrol.8 > head/sbin/camcontrol/camcontrol.c > [...] > +static int > +atapm(struct cam_device *device, int argc, char **argv, > + char *combinedopt, int retry_count, int timeout) > +{ > + union ccb *ccb; > + int retval = 0; > + int t = -1; > + char c; > > [...] > + > + while ((c = getopt(argc, argv, combinedopt)) != -1) { > + switch (c) { > + case 't': > + t = atoi(optarg); > + break; > + default: > + break; > + } > + } This broke world on PowerPC, where char is unsigned. Could you change the type of c to int, or explicitly mark it signed? -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 18:22:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id EB9821065670; Mon, 9 Nov 2009 18:22:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Mon, 9 Nov 2009 13:22:38 -0500 User-Agent: KMail/1.6.2 References: <200911062032.nA6KWRXb027876@svn.freebsd.org> <200911061647.00983.jhb@freebsd.org> In-Reply-To: <200911061647.00983.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911091322.40212.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199002 - in head/sys: dev/fb dev/pci isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 18:22:59 -0000 On Friday 06 November 2009 04:47 pm, John Baldwin wrote: > On Friday 06 November 2009 3:32:26 pm Jung-uk Kim wrote: > > Author: jkim > > Date: Fri Nov 6 20:32:26 2009 > > New Revision: 199002 > > URL: http://svn.freebsd.org/changeset/base/199002 > > > > Log: > > Remove duplicate suspend/resume code from vga_pci.c and let > > vga(4) > > register > > > itself to an associated PCI device if it exists. It is little > > bit hackish but it should fix build without frame buffer driver > > since r198964. Fix some style(9) nits in vga_isa.c while we are > > here. > > Hmm, did you consider having vga_isa use an identify routine to > attach itself as a child of vgapci0? The hack of knowing the first > thing in the softc is a pointer is really gross and I'd rather avoid > it. Just creating a child of vgapci0 will automatically cause > suspend and resume to work w/o vgapci having to have any special > knowledge about vga_isa. In fact, I did consider it. However, lack of my new bus foo prevented me from doing the right thing AND fixing the build breakage at the same. I'll try little harder today. BTW, syscons <-> fb <-> vga <-> vgapci <-> etc. relationship is amazingly confusing. :-( Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 18:24:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A980F1065693; Mon, 9 Nov 2009 18:24:35 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 62B8F8FC15; Mon, 9 Nov 2009 18:24:35 +0000 (UTC) Received: from [192.168.1.4] (adsl-19-213-63.bna.bellsouth.net [68.19.213.63]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id nA9IOXas088869 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 9 Nov 2009 13:24:33 -0500 (EST) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: Jung-uk Kim In-Reply-To: <200911091322.40212.jkim@FreeBSD.org> References: <200911062032.nA6KWRXb027876@svn.freebsd.org> <200911061647.00983.jhb@freebsd.org> <200911091322.40212.jkim@FreeBSD.org> Content-Type: text/plain Organization: FreeBSD Date: Mon, 09 Nov 2009 12:24:27 -0600 Message-Id: <1257791067.27939.25.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC, SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r199002 - in head/sys: dev/fb dev/pci isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 18:24:35 -0000 On Mon, 2009-11-09 at 13:22 -0500, Jung-uk Kim wrote: > On Friday 06 November 2009 04:47 pm, John Baldwin wrote: > > On Friday 06 November 2009 3:32:26 pm Jung-uk Kim wrote: > > > Author: jkim > > > Date: Fri Nov 6 20:32:26 2009 > > > New Revision: 199002 > > > URL: http://svn.freebsd.org/changeset/base/199002 > > > > > > Log: > > > Remove duplicate suspend/resume code from vga_pci.c and let > > > vga(4) > > > > register > > > > > itself to an associated PCI device if it exists. It is little > > > bit hackish but it should fix build without frame buffer driver > > > since r198964. Fix some style(9) nits in vga_isa.c while we are > > > here. > > > > Hmm, did you consider having vga_isa use an identify routine to > > attach itself as a child of vgapci0? The hack of knowing the first > > thing in the softc is a pointer is really gross and I'd rather avoid > > it. Just creating a child of vgapci0 will automatically cause > > suspend and resume to work w/o vgapci having to have any special > > knowledge about vga_isa. > > In fact, I did consider it. However, lack of my new bus foo prevented > me from doing the right thing AND fixing the build breakage at the > same. I'll try little harder today. > > BTW, syscons <-> fb <-> vga <-> vgapci <-> etc. relationship is > amazingly confusing. :-( Agreed, this is one of the things that has kept me from working on kms... robert. > Jung-uk Kim -- Robert Noland FreeBSD From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 18:40:20 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 84A85106568B; Mon, 9 Nov 2009 18:40:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Robert Noland Date: Mon, 9 Nov 2009 13:39:52 -0500 User-Agent: KMail/1.6.2 References: <200911062032.nA6KWRXb027876@svn.freebsd.org> <200911091322.40212.jkim@FreeBSD.org> <1257791067.27939.25.camel@balrog.2hip.net> In-Reply-To: <1257791067.27939.25.camel@balrog.2hip.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911091340.06459.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r199002 - in head/sys: dev/fb dev/pci isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 18:40:20 -0000 On Monday 09 November 2009 01:24 pm, Robert Noland wrote: > On Mon, 2009-11-09 at 13:22 -0500, Jung-uk Kim wrote: > > On Friday 06 November 2009 04:47 pm, John Baldwin wrote: > > > On Friday 06 November 2009 3:32:26 pm Jung-uk Kim wrote: > > > > Author: jkim > > > > Date: Fri Nov 6 20:32:26 2009 > > > > New Revision: 199002 > > > > URL: http://svn.freebsd.org/changeset/base/199002 > > > > > > > > Log: > > > > Remove duplicate suspend/resume code from vga_pci.c and let > > > > vga(4) > > > > > > register > > > > > > > itself to an associated PCI device if it exists. It is > > > > little bit hackish but it should fix build without frame > > > > buffer driver since r198964. Fix some style(9) nits in > > > > vga_isa.c while we are here. > > > > > > Hmm, did you consider having vga_isa use an identify routine to > > > attach itself as a child of vgapci0? The hack of knowing the > > > first thing in the softc is a pointer is really gross and I'd > > > rather avoid it. Just creating a child of vgapci0 will > > > automatically cause suspend and resume to work w/o vgapci > > > having to have any special knowledge about vga_isa. > > > > In fact, I did consider it. However, lack of my new bus foo > > prevented me from doing the right thing AND fixing the build > > breakage at the same. I'll try little harder today. > > > > BTW, syscons <-> fb <-> vga <-> vgapci <-> etc. relationship is > > amazingly confusing. :-( > > Agreed, this is one of the things that has kept me from working on > kms... Oh, are you actually thinking about implementing KMS? How about KGI? http://www.kgi-project.org/ Whatever we do in this area, we will stall this newly resurrected project again, unfortunately. In fact, I am afraid I might have already. :-( Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 18:50:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 266DF106566B; Mon, 9 Nov 2009 18:50: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 F10388FC19; Mon, 9 Nov 2009 18:50: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 nA9IoYim030548; Mon, 9 Nov 2009 18:50:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9IoYWB030547; Mon, 9 Nov 2009 18:50:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911091850.nA9IoYWB030547@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Nov 2009 18:50: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: r199096 - in head/lib/libc: stdio string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 18:50:35 -0000 Author: jhb Date: Mon Nov 9 18:50:34 2009 New Revision: 199096 URL: http://svn.freebsd.org/changeset/base/199096 Log: Purge some duplicate mergeinfo. Modified: Directory Properties: head/lib/libc/stdio/asprintf.c (props changed) head/lib/libc/string/ffsll.c (props changed) head/lib/libc/string/flsll.c (props changed) head/lib/libc/string/wcpcpy.c (props changed) head/lib/libc/string/wcpncpy.c (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 19:21:09 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57619106568B; Mon, 9 Nov 2009 19:21:09 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id EE5F58FC1E; Mon, 9 Nov 2009 19:21:08 +0000 (UTC) Received: from [192.168.1.4] (adsl-19-213-63.bna.bellsouth.net [68.19.213.63]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id nA9JL5wX089144 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 9 Nov 2009 14:21:06 -0500 (EST) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: Jung-uk Kim In-Reply-To: <200911091340.06459.jkim@FreeBSD.org> References: <200911062032.nA6KWRXb027876@svn.freebsd.org> <200911091322.40212.jkim@FreeBSD.org> <1257791067.27939.25.camel@balrog.2hip.net> <200911091340.06459.jkim@FreeBSD.org> Content-Type: text/plain Organization: FreeBSD Date: Mon, 09 Nov 2009 13:21:00 -0600 Message-Id: <1257794460.27939.33.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC, SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r199002 - in head/sys: dev/fb dev/pci isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 19:21:09 -0000 On Mon, 2009-11-09 at 13:39 -0500, Jung-uk Kim wrote: > On Monday 09 November 2009 01:24 pm, Robert Noland wrote: > > On Mon, 2009-11-09 at 13:22 -0500, Jung-uk Kim wrote: > > > On Friday 06 November 2009 04:47 pm, John Baldwin wrote: > > > > On Friday 06 November 2009 3:32:26 pm Jung-uk Kim wrote: > > > > > Author: jkim > > > > > Date: Fri Nov 6 20:32:26 2009 > > > > > New Revision: 199002 > > > > > URL: http://svn.freebsd.org/changeset/base/199002 > > > > > > > > > > Log: > > > > > Remove duplicate suspend/resume code from vga_pci.c and let > > > > > vga(4) > > > > > > > > register > > > > > > > > > itself to an associated PCI device if it exists. It is > > > > > little bit hackish but it should fix build without frame > > > > > buffer driver since r198964. Fix some style(9) nits in > > > > > vga_isa.c while we are here. > > > > > > > > Hmm, did you consider having vga_isa use an identify routine to > > > > attach itself as a child of vgapci0? The hack of knowing the > > > > first thing in the softc is a pointer is really gross and I'd > > > > rather avoid it. Just creating a child of vgapci0 will > > > > automatically cause suspend and resume to work w/o vgapci > > > > having to have any special knowledge about vga_isa. > > > > > > In fact, I did consider it. However, lack of my new bus foo > > > prevented me from doing the right thing AND fixing the build > > > breakage at the same. I'll try little harder today. > > > > > > BTW, syscons <-> fb <-> vga <-> vgapci <-> etc. relationship is > > > amazingly confusing. :-( > > > > Agreed, this is one of the things that has kept me from working on > > kms... > > Oh, are you actually thinking about implementing KMS? It is going to become more and more difficult to maintain drm without it. Intel does at least somewhat support GEM w/o KMS, but radeon has opted to simplify the approach and only support TTM/KMS as a single code path. They are technically seperate features, but we will mostly be on our own if we do one without the other. Nouveau also has KMS support now, though I am not certain if they are supporting the non-KMS path as well. As more and more functionality is incorporated in KMS, the legacy paths in Xorg will start to bit rot and we will be left in more of a predicament than I am now... robert. > How about KGI? > > http://www.kgi-project.org/ > > Whatever we do in this area, we will stall this newly resurrected > project again, unfortunately. In fact, I am afraid I might have > already. :-( > > Jung-uk Kim -- Robert Noland FreeBSD From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 19:47:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A1D610656CB; Mon, 9 Nov 2009 19:47:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 206C18FC13; Mon, 9 Nov 2009 19:47: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 nA9Jllo8032156; Mon, 9 Nov 2009 19:47:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9JlljR032154; Mon, 9 Nov 2009 19:47:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911091947.nA9JlljR032154@svn.freebsd.org> From: Alexander Motin Date: Mon, 9 Nov 2009 19:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199101 - head/sbin/camcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 19:47:47 -0000 Author: mav Date: Mon Nov 9 19:47:46 2009 New Revision: 199101 URL: http://svn.freebsd.org/changeset/base/199101 Log: Fix variable type. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Nov 9 19:26:28 2009 (r199100) +++ head/sbin/camcontrol/camcontrol.c Mon Nov 9 19:47:46 2009 (r199101) @@ -4143,7 +4143,7 @@ atapm(struct cam_device *device, int arg union ccb *ccb; int retval = 0; int t = -1; - char c; + int c; u_char cmd, sc; ccb = cam_getccb(device); From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 19:53:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB3E1065672; Mon, 9 Nov 2009 19:53: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 85B6E8FC28; Mon, 9 Nov 2009 19:53: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 nA9JrYb6032319; Mon, 9 Nov 2009 19:53:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9JrYTL032315; Mon, 9 Nov 2009 19:53:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200911091953.nA9JrYTL032315@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 9 Nov 2009 19:53: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: r199102 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 19:53:34 -0000 Author: trasz Date: Mon Nov 9 19:53:34 2009 New Revision: 199102 URL: http://svn.freebsd.org/changeset/base/199102 Log: Remove ifdefed out part of code, which seems to have originated a decade ago in OpenBSD. As it is now, there is no way for this to be useful, since IPsec is free to forward packets via whatever interface it wants, so checking capabilities of the interface passed from ip_output (fetched from the routing table) serves no purpose. Discussed with: sam@ Modified: head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_ipsec.h head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Mon Nov 9 19:47:46 2009 (r199101) +++ head/sys/netinet/ip_ipsec.c Mon Nov 9 19:53:34 2009 (r199102) @@ -260,8 +260,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) * -1 = packet was reinjected and stop processing packet */ int -ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error, - struct ifnet **ifp) +ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error) { #ifdef IPSEC struct secpolicy *sp = NULL; @@ -390,20 +389,6 @@ ip_ipsec_output(struct mbuf **m, struct } else { /* No IPsec processing for this packet. */ } -#ifdef notyet - /* - * If deferred crypto processing is needed, check that - * the interface supports it. - */ - mtag = m_tag_find(*m, PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED, NULL); - if (mtag != NULL && ifp != NULL && - ((*ifp)->if_capenable & IFCAP_IPSEC) == 0) { - /* notify IPsec to do its own crypto */ - ipsp_skipcrypto_unmark((struct tdb_ident *)(mtag + 1)); - *error = EHOSTUNREACH; - goto bad; - } -#endif } done: if (sp != NULL) Modified: head/sys/netinet/ip_ipsec.h ============================================================================== --- head/sys/netinet/ip_ipsec.h Mon Nov 9 19:47:46 2009 (r199101) +++ head/sys/netinet/ip_ipsec.h Mon Nov 9 19:53:34 2009 (r199102) @@ -36,6 +36,5 @@ int ip_ipsec_filtertunnel(struct mbuf *) int ip_ipsec_fwd(struct mbuf *); int ip_ipsec_input(struct mbuf *); int ip_ipsec_mtu(struct mbuf *, int); -int ip_ipsec_output(struct mbuf **, struct inpcb *, int *, int *, - struct ifnet **); +int ip_ipsec_output(struct mbuf **, struct inpcb *, int *, int *); #endif Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Nov 9 19:47:46 2009 (r199101) +++ head/sys/netinet/ip_output.c Mon Nov 9 19:53:34 2009 (r199102) @@ -466,7 +466,7 @@ again: sendit: #ifdef IPSEC - switch(ip_ipsec_output(&m, inp, &flags, &error, &ifp)) { + switch(ip_ipsec_output(&m, inp, &flags, &error)) { case 1: goto bad; case -1: From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 20:29:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E019F1065679; Mon, 9 Nov 2009 20:29:10 +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 CDEBA8FC12; Mon, 9 Nov 2009 20:29: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 nA9KTAt2033150; Mon, 9 Nov 2009 20:29:10 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9KTAj1033145; Mon, 9 Nov 2009 20:29:10 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200911092029.nA9KTAj1033145@svn.freebsd.org> From: Roman Divacky Date: Mon, 9 Nov 2009 20:29: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: r199104 - in head/sys: amd64/isa dev/fdc dev/ieee488 i386/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 20:29:11 -0000 Author: rdivacky Date: Mon Nov 9 20:29:10 2009 New Revision: 199104 URL: http://svn.freebsd.org/changeset/base/199104 Log: Make isa_dma functions MPSAFE by introducing its own private lock. These functions are selfcontained (ie. they touch only isa_dma.c static variables and hardware) so a private lock is sufficient to prevent races. This changes only i386/amd64 while there are also isa_dma functions for ia64/sparc64. Sparc64 are ones empty stubs and ia64 ones are unused as ia64 does not have isa (says marcel). This patch removes explicit locking of Giant from a few drivers (there are some that requires this but lack ones - this patch fixes this) and also removes the need for implicit locking of Giant from attach routines where it's provided by newbus. Approved by: ed (mentor, implicit) Reviewed by: jhb, attilio (glanced by) Tested by: Giovanni Trematerra IA64 clue: marcel Modified: head/sys/amd64/isa/isa_dma.c head/sys/dev/fdc/fdc.c head/sys/dev/ieee488/ibfoo.c head/sys/i386/isa/isa_dma.c Modified: head/sys/amd64/isa/isa_dma.c ============================================================================== --- head/sys/amd64/isa/isa_dma.c Mon Nov 9 19:56:53 2009 (r199103) +++ head/sys/amd64/isa/isa_dma.c Mon Nov 9 20:29:10 2009 (r199104) @@ -71,6 +71,8 @@ static u_int8_t dma_bounced = 0; static u_int8_t dma_busy = 0; /* Used in isa_dmastart() */ static u_int8_t dma_inuse = 0; /* User for acquire/release */ static u_int8_t dma_auto_mode = 0; +static struct mtx isa_dma_lock; +MTX_SYSINIT(isa_dma_lock, &isa_dma_lock, "isa DMA lock", MTX_DEF); #define VALID_DMA_MASK (7) @@ -84,39 +86,56 @@ int isa_dma_init(int chan, u_int bouncebufsize, int flag) { void *buf; - - /* - * If a DMA channel is shared, both drivers have to call isa_dma_init - * since they don't know that the other driver will do it. - * Just return if we're already set up good. - * XXX: this only works if they agree on the bouncebuf size. This - * XXX: is typically the case since they are multiple instances of - * XXX: the same driver. - */ - if (dma_bouncebuf[chan] != NULL) - return (0); + int contig; #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) panic("isa_dma_init: channel out of range"); #endif - dma_bouncebufsize[chan] = bouncebufsize; /* Try malloc() first. It works better if it works. */ buf = malloc(bouncebufsize, M_DEVBUF, flag); if (buf != NULL) { - if (isa_dmarangecheck(buf, bouncebufsize, chan) == 0) { - dma_bouncebuf[chan] = buf; - return (0); + if (isa_dmarangecheck(buf, bouncebufsize, chan) != 0) { + free(buf, M_DEVBUF); + buf = NULL; } - free(buf, M_DEVBUF); + contig = 0; } - buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul, 0xfffffful, + + if (buf == NULL) { + buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul, 0xfffffful, 1ul, chan & 4 ? 0x20000ul : 0x10000ul); + contig = 1; + } + if (buf == NULL) return (ENOMEM); + + mtx_lock(&isa_dma_lock); + /* + * If a DMA channel is shared, both drivers have to call isa_dma_init + * since they don't know that the other driver will do it. + * Just return if we're already set up good. + * XXX: this only works if they agree on the bouncebuf size. This + * XXX: is typically the case since they are multiple instances of + * XXX: the same driver. + */ + if (dma_bouncebuf[chan] != NULL) { + if (contig) + contigfree(buf, bouncebufsize, M_DEVBUF); + else + free(buf, M_DEVBUF); + mtx_unlock(&isa_dma_lock); + return (0); + } + + dma_bouncebufsize[chan] = bouncebufsize; dma_bouncebuf[chan] = buf; + + mtx_unlock(&isa_dma_lock); + return (0); } @@ -133,12 +152,15 @@ isa_dma_acquire(chan) panic("isa_dma_acquire: channel out of range"); #endif + mtx_lock(&isa_dma_lock); if (dma_inuse & (1 << chan)) { printf("isa_dma_acquire: channel %d already in use\n", chan); + mtx_unlock(&isa_dma_lock); return (EBUSY); } dma_inuse |= (1 << chan); dma_auto_mode &= ~(1 << chan); + mtx_unlock(&isa_dma_lock); return (0); } @@ -155,8 +177,11 @@ isa_dma_release(chan) if (chan & ~VALID_DMA_MASK) panic("isa_dma_release: channel out of range"); + mtx_lock(&isa_dma_lock); if ((dma_inuse & (1 << chan)) == 0) printf("isa_dma_release: channel %d not in use\n", chan); +#else + mtx_lock(&isa_dma_lock); #endif if (dma_busy & (1 << chan)) { @@ -171,6 +196,8 @@ isa_dma_release(chan) dma_inuse &= ~(1 << chan); dma_auto_mode &= ~(1 << chan); + + mtx_unlock(&isa_dma_lock); } /* @@ -186,6 +213,7 @@ isa_dmacascade(chan) panic("isa_dmacascade: channel out of range"); #endif + mtx_lock(&isa_dma_lock); /* set dma channel mode, and set dma channel mode */ if ((chan & 4) == 0) { outb(DMA1_MODE, DMA37MD_CASCADE | chan); @@ -194,6 +222,7 @@ isa_dmacascade(chan) outb(DMA2_MODE, DMA37MD_CASCADE | (chan & 3)); outb(DMA2_SMSK, chan & 3); } + mtx_unlock(&isa_dma_lock); } /* @@ -206,8 +235,11 @@ isa_dmastart(int flags, caddr_t addr, u_ vm_paddr_t phys; int waport; caddr_t newaddr; + int dma_range_checked; - GIANT_REQUIRED; + /* translate to physical */ + phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); + dma_range_checked = isa_dmarangecheck(addr, nbytes, chan); #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -217,8 +249,11 @@ isa_dmastart(int flags, caddr_t addr, u_ || (chan >= 4 && (nbytes > (1<<17) || (uintptr_t)addr & 1))) panic("isa_dmastart: impossible request"); + mtx_lock(&isa_dma_lock); if ((dma_inuse & (1 << chan)) == 0) printf("isa_dmastart: channel %d not acquired\n", chan); +#else + mtx_lock(&isa_dma_lock); #endif #if 0 @@ -233,7 +268,7 @@ isa_dmastart(int flags, caddr_t addr, u_ dma_busy |= (1 << chan); - if (isa_dmarangecheck(addr, nbytes, chan)) { + if (dma_range_checked) { if (dma_bouncebuf[chan] == NULL || dma_bouncebufsize[chan] < nbytes) panic("isa_dmastart: bad bounce buffer"); @@ -246,9 +281,6 @@ isa_dmastart(int flags, caddr_t addr, u_ addr = newaddr; } - /* translate to physical */ - phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); - if (flags & ISADMA_RAW) { dma_auto_mode |= (1 << chan); } else { @@ -323,6 +355,7 @@ isa_dmastart(int flags, caddr_t addr, u_ /* unmask channel */ outb(DMA2_SMSK, chan & 3); } + mtx_unlock(&isa_dma_lock); } void @@ -336,6 +369,7 @@ isa_dmadone(int flags, caddr_t addr, int printf("isa_dmadone: channel %d not acquired\n", chan); #endif + mtx_lock(&isa_dma_lock); if (((dma_busy & (1 << chan)) == 0) && (dma_auto_mode & (1 << chan)) == 0 ) printf("isa_dmadone: channel %d not busy\n", chan); @@ -351,6 +385,7 @@ isa_dmadone(int flags, caddr_t addr, int dma_bounced &= ~(1 << chan); } dma_busy &= ~(1 << chan); + mtx_unlock(&isa_dma_lock); } /* @@ -367,8 +402,6 @@ isa_dmarangecheck(caddr_t va, u_int leng vm_offset_t endva; u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); - GIANT_REQUIRED; - endva = (vm_offset_t)round_page((vm_offset_t)va + length); for (; va < (caddr_t) endva ; va += PAGE_SIZE) { phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va)); @@ -420,13 +453,15 @@ isa_dmarangecheck(caddr_t va, u_int leng * or -1 if the channel requested is not active. * */ -int -isa_dmastatus(int chan) +static int +isa_dmastatus_locked(int chan) { u_long cnt = 0; int ffport, waport; u_long low1, high1, low2, high2; + mtx_assert(&isa_dma_lock, MA_OWNED); + /* channel active? */ if ((dma_inuse & (1 << chan)) == 0) { printf("isa_dmastatus: channel %d not active\n", chan); @@ -472,6 +507,18 @@ isa_dmastatus(int chan) return(cnt); } +int +isa_dmastatus(int chan) +{ + int status; + + mtx_lock(&isa_dma_lock); + status = isa_dmastatus_locked(chan); + mtx_unlock(&isa_dma_lock); + + return (status); +} + /* * Reached terminal count yet ? */ @@ -491,12 +538,16 @@ isa_dmatc(int chan) int isa_dmastop(int chan) { + int status; + + mtx_lock(&isa_dma_lock); if ((dma_inuse & (1 << chan)) == 0) printf("isa_dmastop: channel %d not acquired\n", chan); if (((dma_busy & (1 << chan)) == 0) && ((dma_auto_mode & (1 << chan)) == 0)) { printf("chan %d not busy\n", chan); + mtx_unlock(&isa_dma_lock); return -2 ; } @@ -505,7 +556,12 @@ isa_dmastop(int chan) } else { outb(DMA2_SMSK, (chan & 3) | 4 /* disable mask */); } - return(isa_dmastatus(chan)); + + status = isa_dmastatus_locked(chan); + + mtx_unlock(&isa_dma_lock); + + return (status); } /* Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Mon Nov 9 19:56:53 2009 (r199103) +++ head/sys/dev/fdc/fdc.c Mon Nov 9 20:29:10 2009 (r199104) @@ -781,11 +781,9 @@ fdc_worker(struct fdc_data *fdc) /* Disable ISADMA if we bailed while it was active */ if (fd != NULL && (fd->flags & FD_ISADMA)) { - mtx_lock(&Giant); isa_dmadone( bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE, fd->fd_ioptr, fd->fd_iosize, fdc->dmachan); - mtx_unlock(&Giant); mtx_lock(&fdc->fdc_mtx); fd->flags &= ~FD_ISADMA; mtx_unlock(&fdc->fdc_mtx); @@ -958,11 +956,9 @@ fdc_worker(struct fdc_data *fdc) /* Setup ISADMA if we need it and have it */ if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_FMT)) && !(fdc->flags & FDC_NODMA)) { - mtx_lock(&Giant); isa_dmastart( bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE, fd->fd_ioptr, fd->fd_iosize, fdc->dmachan); - mtx_unlock(&Giant); mtx_lock(&fdc->fdc_mtx); fd->flags |= FD_ISADMA; mtx_unlock(&fdc->fdc_mtx); @@ -1040,11 +1036,9 @@ fdc_worker(struct fdc_data *fdc) /* Finish DMA */ if (fd->flags & FD_ISADMA) { - mtx_lock(&Giant); isa_dmadone( bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE, fd->fd_ioptr, fd->fd_iosize, fdc->dmachan); - mtx_unlock(&Giant); mtx_lock(&fdc->fdc_mtx); fd->flags &= ~FD_ISADMA; mtx_unlock(&fdc->fdc_mtx); Modified: head/sys/dev/ieee488/ibfoo.c ============================================================================== --- head/sys/dev/ieee488/ibfoo.c Mon Nov 9 19:56:53 2009 (r199103) +++ head/sys/dev/ieee488/ibfoo.c Mon Nov 9 20:29:10 2009 (r199104) @@ -397,18 +397,14 @@ dma_idata(struct upd7210 *u, u_char *dat KASSERT(u->dmachan >= 0, ("Bogus dmachan %d", u->dmachan)); ib = u->ibfoo; ib->mode = DMA_IDATA; - mtx_lock(&Giant); isa_dmastart(ISADMA_READ, data, len, u->dmachan); - mtx_unlock(&Giant); mtx_lock(&u->mutex); upd7210_wr(u, IMR1, IXR1_ENDRX); upd7210_wr(u, IMR2, IMR2_DMAI); gpib_ib_wait_xfer(u, ib); mtx_unlock(&u->mutex); - mtx_lock(&Giant); j = isa_dmastatus(u->dmachan); isa_dmadone(ISADMA_READ, data, len, u->dmachan); - mtx_unlock(&Giant); return (len - j); } @@ -790,14 +786,12 @@ gpib_ib_open(struct cdev *dev, int oflag mtx_unlock(&u->mutex); if (u->dmachan >= 0) { - mtx_lock(&Giant); error = isa_dma_acquire(u->dmachan); if (!error) { error = isa_dma_init(u->dmachan, PAGE_SIZE, M_WAITOK); if (error) isa_dma_release(u->dmachan); } - mtx_unlock(&Giant); } if (error) { @@ -855,9 +849,7 @@ gpib_ib_close(struct cdev *dev, int ofla free(ib, M_IBFOO); if (u->dmachan >= 0) { - mtx_lock(&Giant); isa_dma_release(u->dmachan); - mtx_unlock(&Giant); } mtx_lock(&u->mutex); u->busy = 0; Modified: head/sys/i386/isa/isa_dma.c ============================================================================== --- head/sys/i386/isa/isa_dma.c Mon Nov 9 19:56:53 2009 (r199103) +++ head/sys/i386/isa/isa_dma.c Mon Nov 9 20:29:10 2009 (r199104) @@ -69,6 +69,8 @@ static u_int8_t dma_bounced = 0; static u_int8_t dma_busy = 0; /* Used in isa_dmastart() */ static u_int8_t dma_inuse = 0; /* User for acquire/release */ static u_int8_t dma_auto_mode = 0; +static struct mtx isa_dma_lock; +MTX_SYSINIT(isa_dma_lock, &isa_dma_lock, "isa DMA lock", MTX_DEF); #define VALID_DMA_MASK (7) @@ -82,39 +84,56 @@ int isa_dma_init(int chan, u_int bouncebufsize, int flag) { void *buf; - - /* - * If a DMA channel is shared, both drivers have to call isa_dma_init - * since they don't know that the other driver will do it. - * Just return if we're already set up good. - * XXX: this only works if they agree on the bouncebuf size. This - * XXX: is typically the case since they are multiple instances of - * XXX: the same driver. - */ - if (dma_bouncebuf[chan] != NULL) - return (0); + int contig; #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) panic("isa_dma_init: channel out of range"); #endif - dma_bouncebufsize[chan] = bouncebufsize; /* Try malloc() first. It works better if it works. */ buf = malloc(bouncebufsize, M_DEVBUF, flag); if (buf != NULL) { - if (isa_dmarangecheck(buf, bouncebufsize, chan) == 0) { - dma_bouncebuf[chan] = buf; - return (0); + if (isa_dmarangecheck(buf, bouncebufsize, chan) != 0) { + free(buf, M_DEVBUF); + buf = NULL; } - free(buf, M_DEVBUF); + contig = 0; } - buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul, 0xfffffful, + + if (buf == NULL) { + buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul, 0xfffffful, 1ul, chan & 4 ? 0x20000ul : 0x10000ul); + contig = 1; + } + if (buf == NULL) return (ENOMEM); + + mtx_lock(&isa_dma_lock); + /* + * If a DMA channel is shared, both drivers have to call isa_dma_init + * since they don't know that the other driver will do it. + * Just return if we're already set up good. + * XXX: this only works if they agree on the bouncebuf size. This + * XXX: is typically the case since they are multiple instances of + * XXX: the same driver. + */ + if (dma_bouncebuf[chan] != NULL) { + if (contig) + contigfree(buf, bouncebufsize, M_DEVBUF); + else + free(buf, M_DEVBUF); + mtx_unlock(&isa_dma_lock); + return (0); + } + + dma_bouncebufsize[chan] = bouncebufsize; dma_bouncebuf[chan] = buf; + + mtx_unlock(&isa_dma_lock); + return (0); } @@ -131,12 +150,15 @@ isa_dma_acquire(chan) panic("isa_dma_acquire: channel out of range"); #endif + mtx_lock(&isa_dma_lock); if (dma_inuse & (1 << chan)) { printf("isa_dma_acquire: channel %d already in use\n", chan); + mtx_unlock(&isa_dma_lock); return (EBUSY); } dma_inuse |= (1 << chan); dma_auto_mode &= ~(1 << chan); + mtx_unlock(&isa_dma_lock); return (0); } @@ -153,8 +175,11 @@ isa_dma_release(chan) if (chan & ~VALID_DMA_MASK) panic("isa_dma_release: channel out of range"); + mtx_lock(&isa_dma_lock); if ((dma_inuse & (1 << chan)) == 0) printf("isa_dma_release: channel %d not in use\n", chan); +#else + mtx_lock(&isa_dma_lock); #endif if (dma_busy & (1 << chan)) { @@ -169,6 +194,8 @@ isa_dma_release(chan) dma_inuse &= ~(1 << chan); dma_auto_mode &= ~(1 << chan); + + mtx_unlock(&isa_dma_lock); } /* @@ -184,6 +211,7 @@ isa_dmacascade(chan) panic("isa_dmacascade: channel out of range"); #endif + mtx_lock(&isa_dma_lock); /* set dma channel mode, and set dma channel mode */ if ((chan & 4) == 0) { outb(DMA1_MODE, DMA37MD_CASCADE | chan); @@ -192,6 +220,7 @@ isa_dmacascade(chan) outb(DMA2_MODE, DMA37MD_CASCADE | (chan & 3)); outb(DMA2_SMSK, chan & 3); } + mtx_unlock(&isa_dma_lock); } /* @@ -204,8 +233,11 @@ isa_dmastart(int flags, caddr_t addr, u_ vm_paddr_t phys; int waport; caddr_t newaddr; + int dma_range_checked; - GIANT_REQUIRED; + /* translate to physical */ + phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); + dma_range_checked = isa_dmarangecheck(addr, nbytes, chan); #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -215,8 +247,11 @@ isa_dmastart(int flags, caddr_t addr, u_ || (chan >= 4 && (nbytes > (1<<17) || (u_int)addr & 1))) panic("isa_dmastart: impossible request"); + mtx_lock(&isa_dma_lock); if ((dma_inuse & (1 << chan)) == 0) printf("isa_dmastart: channel %d not acquired\n", chan); +#else + mtx_lock(&isa_dma_lock); #endif #if 0 @@ -231,7 +266,7 @@ isa_dmastart(int flags, caddr_t addr, u_ dma_busy |= (1 << chan); - if (isa_dmarangecheck(addr, nbytes, chan)) { + if (dma_range_checked) { if (dma_bouncebuf[chan] == NULL || dma_bouncebufsize[chan] < nbytes) panic("isa_dmastart: bad bounce buffer"); @@ -244,9 +279,6 @@ isa_dmastart(int flags, caddr_t addr, u_ addr = newaddr; } - /* translate to physical */ - phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); - if (flags & ISADMA_RAW) { dma_auto_mode |= (1 << chan); } else { @@ -321,6 +353,7 @@ isa_dmastart(int flags, caddr_t addr, u_ /* unmask channel */ outb(DMA2_SMSK, chan & 3); } + mtx_unlock(&isa_dma_lock); } void @@ -334,6 +367,7 @@ isa_dmadone(int flags, caddr_t addr, int printf("isa_dmadone: channel %d not acquired\n", chan); #endif + mtx_lock(&isa_dma_lock); if (((dma_busy & (1 << chan)) == 0) && (dma_auto_mode & (1 << chan)) == 0 ) printf("isa_dmadone: channel %d not busy\n", chan); @@ -349,6 +383,7 @@ isa_dmadone(int flags, caddr_t addr, int dma_bounced &= ~(1 << chan); } dma_busy &= ~(1 << chan); + mtx_unlock(&isa_dma_lock); } /* @@ -365,8 +400,6 @@ isa_dmarangecheck(caddr_t va, u_int leng vm_offset_t endva; u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); - GIANT_REQUIRED; - endva = (vm_offset_t)round_page((vm_offset_t)va + length); for (; va < (caddr_t) endva ; va += PAGE_SIZE) { phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va)); @@ -419,13 +452,15 @@ isa_dmarangecheck(caddr_t va, u_int leng * or -1 if the channel requested is not active. * */ -int -isa_dmastatus(int chan) +static int +isa_dmastatus_locked(int chan) { u_long cnt = 0; int ffport, waport; u_long low1, high1, low2, high2; + mtx_assert(&isa_dma_lock, MA_OWNED); + /* channel active? */ if ((dma_inuse & (1 << chan)) == 0) { printf("isa_dmastatus: channel %d not active\n", chan); @@ -471,6 +506,18 @@ isa_dmastatus(int chan) return(cnt); } +int +isa_dmastatus(int chan) +{ + int status; + + mtx_lock(&isa_dma_lock); + status = isa_dmastatus_locked(chan); + mtx_unlock(&isa_dma_lock); + + return (status); +} + /* * Reached terminal count yet ? */ @@ -490,12 +537,16 @@ isa_dmatc(int chan) int isa_dmastop(int chan) { + int status; + + mtx_lock(&isa_dma_lock); if ((dma_inuse & (1 << chan)) == 0) printf("isa_dmastop: channel %d not acquired\n", chan); if (((dma_busy & (1 << chan)) == 0) && ((dma_auto_mode & (1 << chan)) == 0)) { printf("chan %d not busy\n", chan); + mtx_unlock(&isa_dma_lock); return -2 ; } @@ -504,7 +555,12 @@ isa_dmastop(int chan) } else { outb(DMA2_SMSK, (chan & 3) | 4 /* disable mask */); } - return(isa_dmastatus(chan)); + + status = isa_dmastatus_locked(chan); + + mtx_unlock(&isa_dma_lock); + + return (status); } /* From owner-svn-src-head@FreeBSD.ORG Mon Nov 9 20:49:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54BB010656A7; Mon, 9 Nov 2009 20:49:13 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7528FC18; Mon, 9 Nov 2009 20:49: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 nA9KnDos033847; Mon, 9 Nov 2009 20:49:13 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9KnDNL033845; Mon, 9 Nov 2009 20:49:13 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200911092049.nA9KnDNL033845@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 9 Nov 2009 20:49: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: r199107 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 20:49:13 -0000 Author: edwin Date: Mon Nov 9 20:49:12 2009 New Revision: 199107 URL: http://svn.freebsd.org/changeset/base/199107 Log: MFV of r199105, tzdata2009r: - Three Australian stations in Antarctica have changed their time zone: Casey moved from UTC+8 to UTC+11 Davis moved from UTC+7 to UTC+5 Mawson moved from UTC+6 to UTC+5 The changes occurred on 2009-10-18 at 02:00 (local times). MFC after: 3 days Modified: head/share/zoneinfo/antarctica Directory Properties: head/share/zoneinfo/ (props changed) Modified: head/share/zoneinfo/antarctica ============================================================================== --- head/share/zoneinfo/antarctica Mon Nov 9 20:45:25 2009 (r199106) +++ head/share/zoneinfo/antarctica Mon Nov 9 20:49:12 2009 (r199107) @@ -1,5 +1,5 @@ #
-# @(#)antarctica	8.5
+# @(#)antarctica	8.6
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -80,15 +80,38 @@ Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u
 # Davis, Vestfold Hills, -6835+07759, since 1957-01-13
 #	(except 1964-11 - 1969-02)
 # Mawson, Holme Bay, -6736+06253, since 1954-02-13
+
+# From Steffen Thorsen (2009-03-11):
+# Three Australian stations in Antarctica have changed their time zone:
+# Casey moved from UTC+8 to UTC+11
+# Davis moved from UTC+7 to UTC+5
+# Mawson moved from UTC+6 to UTC+5
+# The changes occurred on 2009-10-18 at 02:00 (local times).
+#
+# Government source: (Australian Antarctic Division)
+# 
+# http://www.aad.gov.au/default.asp?casid=37079
+# 
+#
+# We have more background information here:
+# 
+# http://www.timeanddate.com/news/time/antarctica-new-times.html
+# 
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Casey	0	-	zzz	1969
-			8:00	-	WST	# Western (Aus) Standard Time
+			8:00	-	WST	2009 Oct 18 2:00
+						# Western (Aus) Standard Time
+			11:00	-	CAST	# Casey Time
 Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
 			7:00	-	DAVT	1964 Nov # Davis Time
 			0	-	zzz	1969 Feb
-			7:00	-	DAVT
+			7:00	-	DAVT	2009 Oct 18 2:0
+			5:00	-	DAVT
 Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
-			6:00	-	MAWT	# Mawson Time
+			6:00	-	MAWT	2009 Oct 18 2:00
+						# Mawson Time
+			5:00	-	MAWT
 # References:
 # 
 # Casey Weather (1998-02-26)

From owner-svn-src-head@FreeBSD.ORG  Mon Nov  9 21:12:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 326F71065694;
	Mon,  9 Nov 2009 21:12:29 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 217C78FC21;
	Mon,  9 Nov 2009 21:12: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 nA9LCThH034476;
	Mon, 9 Nov 2009 21:12:29 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9LCTxX034474;
	Mon, 9 Nov 2009 21:12:29 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200911092112.nA9LCTxX034474@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Mon, 9 Nov 2009 21:12: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: r199108 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 09 Nov 2009 21:12:29 -0000

Author: nwhitehorn
Date: Mon Nov  9 21:12:28 2009
New Revision: 199108
URL: http://svn.freebsd.org/changeset/base/199108

Log:
  Spell sz correctly.
  
  Pointed out by:	jmallett

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Mon Nov  9 20:49:12 2009	(r199107)
+++ head/sys/powerpc/aim/mmu_oea64.c	Mon Nov  9 21:12:28 2009	(r199108)
@@ -897,7 +897,7 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 		panic("moea64_bootstrap: can't get mmu package");
 	    if ((sz = OF_getproplen(mmu, "translations")) == -1)
 		panic("moea64_bootstrap: can't get ofw translation count");
-	    if (size > sizeof(translations))
+	    if (sz > sizeof(translations))
 		panic("moea64_bootstrap: too many ofw translations (%d)",
 		      sz/sizeof(*translations));
 

From owner-svn-src-head@FreeBSD.ORG  Mon Nov  9 22:01:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EC500106566C;
	Mon,  9 Nov 2009 22:01:58 +0000 (UTC)
	(envelope-from gonzo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB2CF8FC17;
	Mon,  9 Nov 2009 22:01: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 nA9M1wIG036293;
	Mon, 9 Nov 2009 22:01:58 GMT (envelope-from gonzo@svn.freebsd.org)
Received: (from gonzo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9M1w3a036290;
	Mon, 9 Nov 2009 22:01:58 GMT (envelope-from gonzo@svn.freebsd.org)
Message-Id: <200911092201.nA9M1w3a036290@svn.freebsd.org>
From: Oleksandr Tymoshenko 
Date: Mon, 9 Nov 2009 22:01: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: r199114 - head/sys/mips/mips
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 09 Nov 2009 22:01:59 -0000

Author: gonzo
Date: Mon Nov  9 22:01:58 2009
New Revision: 199114
URL: http://svn.freebsd.org/changeset/base/199114

Log:
  Unbreak booting of FreeBSD/mips by merging r195429 from projects/mips:
  - Move dpcpu initialization to mips_proc0_init. It's
      more appropriate place for it. Besides dpcpu_init
      requires pmap module to be initialized and calling it
      int pmap.c hangs the system

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

Modified: head/sys/mips/mips/machdep.c
==============================================================================
--- head/sys/mips/mips/machdep.c	Mon Nov  9 21:54:34 2009	(r199113)
+++ head/sys/mips/mips/machdep.c	Mon Nov  9 22:01:58 2009	(r199114)
@@ -274,6 +274,9 @@ mips_proc0_init(void)
 	    (thread0.td_kstack_pages - 1) * PAGE_SIZE) - 1;
 	thread0.td_frame = &thread0.td_pcb->pcb_regs;
 
+	/* Steal memory for the dynamic per-cpu area. */
+	dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0);
+
 	/*
 	 * There is no need to initialize md_upte array for thread0 as it's
 	 * located in .bss section and should be explicitly zeroed during 

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Mon Nov  9 21:54:34 2009	(r199113)
+++ head/sys/mips/mips/pmap.c	Mon Nov  9 22:01:58 2009	(r199114)
@@ -331,9 +331,6 @@ again:
 	msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE);
 	msgbufinit(msgbufp, MSGBUF_SIZE);
 
-	/* Steal memory for the dynamic per-cpu area. */
-	dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0);
-
 	/*
 	 * Steal thread0 kstack.
 	 */

From owner-svn-src-head@FreeBSD.ORG  Mon Nov  9 22:52:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C4A41065670;
	Mon,  9 Nov 2009 22:52:48 +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 B13488FC19;
	Mon,  9 Nov 2009 22:52:47 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 3D1411CCF3; Mon,  9 Nov 2009 23:52:44 +0100 (CET)
Date: Mon, 9 Nov 2009 23:52:44 +0100
From: Ed Schouten 
To: Jun Kuriyama 
Message-ID: <20091109225244.GB64905@hoeg.nl>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes"
Content-Disposition: inline
In-Reply-To: <200911090254.nA92sG1G005921@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 09 Nov 2009 22:52:48 -0000


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

Hi Jun,

* Jun Kuriyama  wrote:
>   - Add hw.clflush_disable loader tunable to avoid panic (trap 9) at
>     map_invalidate_cache_range() even if CPU is not Intel.
>   - This tunable can be set to -1 (default), 0 and 1.  -1 is same as
>     current behavior, which automatically disable CLFLUSH on Intel CPUs
>     without CPUID_SS (should be occured on Xen only).  You can specify 1
>     when this panic happened on non-Intel CPUs (such as AMD's).  Because
>     disabling CLFLUSH may reduce performance, you can try with setting 0
>     on Intel CPUs without SS to use CLFLUSH feature.
>  =20
>   Reviewed by:	kib
>   Reported by:	karl, kuriyama
>   Related to:	kern/138863

Unfortunately it seems to lock up my Intel Core 2 Duo boxes.

Systems affected:

- Apple MacBook3,1
- Dell SC440

--=20
 Ed Schouten 
 WWW: http://80386.nl/

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr4nTwACgkQ52SDGA2eCwX8VgCfZRjMLAy1XnVmZ53rTpZj94zB
WAIAnimLe4w887ojteHfFQpE9bruUecF
=1chi
-----END PGP SIGNATURE-----

--jq0ap7NbKX2Kqbes--

From owner-svn-src-head@FreeBSD.ORG  Mon Nov  9 22:58:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 628301065693;
	Mon,  9 Nov 2009 22:58:30 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5172B8FC30;
	Mon,  9 Nov 2009 22: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 nA9MwU82037660;
	Mon, 9 Nov 2009 22:58:30 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9MwUDj037658;
	Mon, 9 Nov 2009 22:58:30 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200911092258.nA9MwUDj037658@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 9 Nov 2009 22:58: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: r199115 - head/sys/dev/bge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 09 Nov 2009 22:58:30 -0000

Author: yongari
Date: Mon Nov  9 22:58:30 2009
New Revision: 199115
URL: http://svn.freebsd.org/changeset/base/199115

Log:
  Add missing bus_dmamap_sync(9) before issuing kick command.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Mon Nov  9 22:01:58 2009	(r199114)
+++ head/sys/dev/bge/if_bge.c	Mon Nov  9 22:58:30 2009	(r199115)
@@ -3826,6 +3826,9 @@ bge_start_locked(struct ifnet *ifp)
 		/* No packets were dequeued. */
 		return;
 
+	bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
+	    sc->bge_cdata.bge_tx_ring_map,
+	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	/* Transmit. */
 	bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx);
 	/* 5700 b2 errata */

From owner-svn-src-head@FreeBSD.ORG  Mon Nov  9 23:09:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BED5F1065672;
	Mon,  9 Nov 2009 23:09:18 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ACEE88FC15;
	Mon,  9 Nov 2009 23:09: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 nA9N9IOk037911;
	Mon, 9 Nov 2009 23:09:18 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA9N9IKY037909;
	Mon, 9 Nov 2009 23:09:18 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200911092309.nA9N9IKY037909@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 9 Nov 2009 23:09: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: r199116 - head/sys/dev/bge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 09 Nov 2009 23:09:18 -0000

Author: yongari
Date: Mon Nov  9 23:09:18 2009
New Revision: 199116
URL: http://svn.freebsd.org/changeset/base/199116

Log:
  Zero out Tx/Rx descriptors before using them. Also add missing
  bus_dmamap_sync(9) after Tx descriptor initialization.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Mon Nov  9 22:58:30 2009	(r199115)
+++ head/sys/dev/bge/if_bge.c	Mon Nov  9 23:09:18 2009	(r199116)
@@ -1046,6 +1046,7 @@ bge_init_rx_ring_std(struct bge_softc *s
 {
 	int error, i;
 
+	bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ);
 	sc->bge_std = 0;
 	for (i = 0; i < BGE_SSLOTS; i++) {
 		if ((error = bge_newbuf_std(sc, i)) != 0)
@@ -1089,6 +1090,7 @@ bge_init_rx_ring_jumbo(struct bge_softc 
 	struct bge_rcb *rcb;
 	int error, i;
 
+	bzero(sc->bge_ldata.bge_rx_jumbo_ring, BGE_JUMBO_RX_RING_SZ);
 	sc->bge_jumbo = 0;
 	for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) {
 		if ((error = bge_newbuf_jumbo(sc, i)) != 0)
@@ -1161,6 +1163,11 @@ bge_init_tx_ring(struct bge_softc *sc)
 	sc->bge_txcnt = 0;
 	sc->bge_tx_saved_considx = 0;
 
+	bzero(sc->bge_ldata.bge_tx_ring, BGE_TX_RING_SZ);
+	bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
+	    sc->bge_cdata.bge_tx_ring_map,
+	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
 	/* Initialize transmit producer index for host-memory send ring. */
 	sc->bge_tx_prodidx = 0;
 	bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, sc->bge_tx_prodidx);

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 00:14:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17C07106568B;
	Tue, 10 Nov 2009 00:14:02 +0000 (UTC)
	(envelope-from kuriyama@FreeBSD.org)
Received: from scarlet.imgsrc.co.jp (scarlet.imgsrc.co.jp [202.235.195.9])
	by mx1.freebsd.org (Postfix) with ESMTP id D2CD58FC1A;
	Tue, 10 Nov 2009 00:14:01 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by scarlet.imgsrc.co.jp (Postfix) with ESMTP id 688B667895;
	Tue, 10 Nov 2009 08:47:36 +0900 (JST)
X-Virus-Scanned: IMG SRC scanner at mail.imgsrc.co.jp (scarlet)
Received: from scarlet.imgsrc.co.jp ([127.0.0.1])
	by localhost (scarlet.imgsrc.co.jp [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id dSj-35sZOguq; Tue, 10 Nov 2009 08:47:36 +0900 (JST)
Received: from cebu.s2factory.co.jp (corsica.s2factory.co.jp [122.220.15.114])
	by scarlet.imgsrc.co.jp (Postfix) with ESMTP id 2605F6787B;
	Tue, 10 Nov 2009 08:47:36 +0900 (JST)
Date: Tue, 10 Nov 2009 08:47:36 +0900
Message-ID: <7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
From: Jun Kuriyama 
To: Ed Schouten 
In-Reply-To: <20091109225244.GB64905@hoeg.nl>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
User-Agent: Wanderlust/2.14.0 (Africa) Emacs/23.1 Mule/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset=US-ASCII
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 00:14:02 -0000

At Mon, 9 Nov 2009 23:52:44 +0100,
ed@80386.nl wrote:
> * Jun Kuriyama  wrote:
> >   - Add hw.clflush_disable loader tunable to avoid panic (trap 9) at
> >     map_invalidate_cache_range() even if CPU is not Intel.
> >   - This tunable can be set to -1 (default), 0 and 1.  -1 is same as
> >     current behavior, which automatically disable CLFLUSH on Intel CPUs
> >     without CPUID_SS (should be occured on Xen only).  You can specify 1
> >     when this panic happened on non-Intel CPUs (such as AMD's).  Because
> >     disabling CLFLUSH may reduce performance, you can try with setting 0
> >     on Intel CPUs without SS to use CLFLUSH feature.
> >   
> >   Reviewed by:	kib
> >   Reported by:	karl, kuriyama
> >   Related to:	kern/138863
> 
> Unfortunately it seems to lock up my Intel Core 2 Duo boxes.
> 
> Systems affected:
> 
> - Apple MacBook3,1
> - Dell SC440

Thank you for your report!

(1) On MacBook, lock up occured on real hardware?  Not on hypervisor?
(2) On both system, is there no problem before this commit?


-- 
Jun Kuriyama  // FreeBSD Project
          // S2 Factory, Inc.

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 00:48:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EAF49106568B;
	Tue, 10 Nov 2009 00:48: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 D9D1F8FC18;
	Tue, 10 Nov 2009 00:48:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAA0mORV040379;
	Tue, 10 Nov 2009 00:48:24 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAA0mOdT040377;
	Tue, 10 Nov 2009 00:48:24 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200911100048.nAA0mOdT040377@svn.freebsd.org>
From: Xin LI 
Date: Tue, 10 Nov 2009 00:48: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: r199123 - head/contrib/ee
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 00:48:25 -0000

Author: delphij
Date: Tue Nov 10 00:48:24 2009
New Revision: 199123
URL: http://svn.freebsd.org/changeset/base/199123

Log:
  Add a minimal change to prevent NULL deference in ee(1).
  
  To repeat the problem, one can press "Ctrl+C" and then enter "0".
  
  Submitted by:	Alexander Best 

Modified:
  head/contrib/ee/ee.c

Modified: head/contrib/ee/ee.c
==============================================================================
--- head/contrib/ee/ee.c	Tue Nov 10 00:46:08 2009	(r199122)
+++ head/contrib/ee/ee.c	Tue Nov 10 00:48:24 2009	(r199123)
@@ -1989,7 +1989,7 @@ char *cmd_str;
 	int number;
 	int i;
 	char *ptr;
-	char *direction = NULL;
+	char *direction = "d";
 	struct text *t_line;
 
 	ptr = cmd_str;

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 03:18:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04DC0106566C;
	Tue, 10 Nov 2009 03:18:50 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E85138FC17;
	Tue, 10 Nov 2009 03:18: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 nAA3InSE045260;
	Tue, 10 Nov 2009 03:18:49 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAA3Inqe045258;
	Tue, 10 Nov 2009 03:18:49 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200911100318.nAA3Inqe045258@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 10 Nov 2009 03:18:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199127 - head/share/man/man5
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 03:18:50 -0000

Author: dougb
Date: Tue Nov 10 03:18:49 2009
New Revision: 199127
URL: http://svn.freebsd.org/changeset/base/199127

Log:
  Add a note about no hostname leading to "Amnesiac" on the console
  
  The text is inspired by the PR, but more in line with the existing text
  
  PR:		docs/140434
  Submitted by:	Jason Helfman 

Modified:
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Tue Nov 10 01:12:00 2009	(r199126)
+++ head/share/man/man5/rc.conf.5	Tue Nov 10 03:18:49 2009	(r199127)
@@ -351,6 +351,9 @@ If
 .Xr dhclient 8
 is used to set the hostname via DHCP,
 this variable should be set to an empty string.
+If this value remains unset when the system is done booting
+your console login will display a default hostname of
+.Dq Amnesiac.
 .It Va nisdomainname
 .Pq Vt str
 The NIS domain name of this host, or

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 03:56:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C42911065670;
	Tue, 10 Nov 2009 03:56:51 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3B048FC15;
	Tue, 10 Nov 2009 03: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 nAA3upbq046060;
	Tue, 10 Nov 2009 03:56:51 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAA3upWS046057;
	Tue, 10 Nov 2009 03:56:51 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911100356.nAA3upWS046057@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Tue, 10 Nov 2009 03:56: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: r199128 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 03:56:51 -0000

Author: ume
Date: Tue Nov 10 03:56:51 2009
New Revision: 199128
URL: http://svn.freebsd.org/changeset/base/199128

Log:
  Add Japanese catalogue entries for newer errnos: EBADMSG, EMULTIHOP,
  ENOLINK, EPROTO, ENOTCAPABLE.

Modified:
  head/lib/libc/nls/ja_JP.UTF-8.msg
  head/lib/libc/nls/ja_JP.eucJP.msg

Modified: head/lib/libc/nls/ja_JP.UTF-8.msg
==============================================================================
--- head/lib/libc/nls/ja_JP.UTF-8.msg	Tue Nov 10 03:18:49 2009	(r199127)
+++ head/lib/libc/nls/ja_JP.UTF-8.msg	Tue Nov 10 03:56:51 2009	(r199128)
@@ -181,6 +181,16 @@ $ ENOATTR
 87 そのような属性はありません
 $ EDOOFUS
 88 プログラミングエラーです
+$ EBADMSG
+89 無効なメッセージです
+$ EMULTIHOP
+90 マルチホップが試みられました
+$ ENOLINK
+91 リンクが切断されています
+$ EPROTO
+92 プロトコルエラーです
+$ ENOTCAPABLE
+93 ケーパビリティが不足です
 $
 $ strsignal() support catalog
 $

Modified: head/lib/libc/nls/ja_JP.eucJP.msg
==============================================================================
--- head/lib/libc/nls/ja_JP.eucJP.msg	Tue Nov 10 03:18:49 2009	(r199127)
+++ head/lib/libc/nls/ja_JP.eucJP.msg	Tue Nov 10 03:56:51 2009	(r199128)
@@ -181,6 +181,16 @@ $ ENOATTR
 87 Τ褦°Ϥޤ
 $ EDOOFUS
 88 ץߥ󥰥顼Ǥ
+$ EBADMSG
+89 ̵ʥåǤ
+$ EMULTIHOP
+90 ޥۥåפߤޤ
+$ ENOLINK
+91 󥯤ǤƤޤ
+$ EPROTO
+92 ץȥ륨顼Ǥ
+$ ENOTCAPABLE
+93 ѥӥƥ­Ǥ
 $
 $ strsignal() support catalog
 $

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 05:59:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB1611065672;
	Tue, 10 Nov 2009 05:59:12 +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 78C458FC13;
	Tue, 10 Nov 2009 05:59:12 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 26BB61CCF3; Tue, 10 Nov 2009 06:59:11 +0100 (CET)
Date: Tue, 10 Nov 2009 06:59:11 +0100
From: Ed Schouten 
To: Jun Kuriyama 
Message-ID: <20091110055910.GC64905@hoeg.nl>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
	<7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="7qSK/uQB79J36Y4o"
Content-Disposition: inline
In-Reply-To: <7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
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: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 05:59:13 -0000


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

Hello Jun,

* Jun Kuriyama  wrote:
> (1) On MacBook, lock up occured on real hardware?  Not on hypervisor?

Nope. The MacBook does use Apple's Boot Camp, but I can't say whether
that can be considered to be a hypervisor. What happens, is that the
system just locks up after probing all the device. It doesn't mount the
root device anymore.

> (2) On both system, is there no problem before this commit?

I bisected it and the revision before this one does boot. I'll
experiment with the tunables this afternoon. I really had to get some
sleep last night, so I couldn't investigate it any further.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--7qSK/uQB79J36Y4o
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr5AS4ACgkQ52SDGA2eCwWKTwCfXZFBxJpv92f/gP4wsTQ39Vq4
/kwAn3BMGC0+xG2jKstYzOxkD6Lst/rV
=ZIuB
-----END PGP SIGNATURE-----

--7qSK/uQB79J36Y4o--

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 06:11:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 709F1106566C;
	Tue, 10 Nov 2009 06:11:19 +0000 (UTC)
	(envelope-from kuriyama@FreeBSD.org)
Received: from scarlet.imgsrc.co.jp (scarlet.imgsrc.co.jp [202.235.195.9])
	by mx1.freebsd.org (Postfix) with ESMTP id 350B48FC0A;
	Tue, 10 Nov 2009 06:11:19 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by scarlet.imgsrc.co.jp (Postfix) with ESMTP id 05ED5678D9;
	Tue, 10 Nov 2009 15:11:18 +0900 (JST)
X-Virus-Scanned: IMG SRC scanner at mail.imgsrc.co.jp (scarlet)
Received: from scarlet.imgsrc.co.jp ([127.0.0.1])
	by localhost (scarlet.imgsrc.co.jp [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id r2Zlq0fwivVV; Tue, 10 Nov 2009 15:11:17 +0900 (JST)
Received: from cebu.s2factory.co.jp (corsica.s2factory.co.jp [122.220.15.114])
	by scarlet.imgsrc.co.jp (Postfix) with ESMTP id CA1E2678CD;
	Tue, 10 Nov 2009 15:11:17 +0900 (JST)
Date: Tue, 10 Nov 2009 15:11:17 +0900
Message-ID: <7mvdhigb96.wl%kuriyama@s2factory.co.jp>
From: Jun Kuriyama 
To: Ed Schouten 
In-Reply-To: <20091110055910.GC64905@hoeg.nl>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
	<7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
	<20091110055910.GC64905@hoeg.nl>
User-Agent: Wanderlust/2.14.0 (Africa) Emacs/23.1 Mule/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset=US-ASCII
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 06:11:19 -0000

At Tue, 10 Nov 2009 06:59:11 +0100,
ed@80386.nl wrote:
> > (1) On MacBook, lock up occured on real hardware?  Not on hypervisor?
> 
> Nope. The MacBook does use Apple's Boot Camp, but I can't say whether
> that can be considered to be a hypervisor. What happens, is that the
> system just locks up after probing all the device. It doesn't mount the
> root device anymore.

Hmm, I think Boot Camp is not hypervisor, and should be treated as
real hardware.  Which architecture (i386/amd64) you are using?

> > (2) On both system, is there no problem before this commit?
> 
> I bisected it and the revision before this one does boot. I'll
> experiment with the tunables this afternoon. I really had to get some
> sleep last night, so I couldn't investigate it any further.

You can try with hw.clflush_disable="1" in loader.conf.  If you can
boot with it, I must be mistaken something (anyway its my fault).

Can you show me CPUID line at boot message (of course from the kernel
you can boot) like this?

> CPU: Dual-Core AMD Opteron(tm) Processor 2210 (1800.07-MHz K8-class CPU)
>   Origin = "AuthenticAMD"  Id = 0x40f12  Stepping = 2
>   Features=0x178bfbff
>   Features2=0x2001
>   AMD Features=0xea500800


-- 
Jun Kuriyama  // FreeBSD Project
          // S2 Factory, Inc.

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 07:20:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1FD86106566B;
	Tue, 10 Nov 2009 07:20:52 +0000 (UTC) (envelope-from ed@80386.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id B372F8FC17;
	Tue, 10 Nov 2009 07:20:51 +0000 (UTC)
Received: from [131.155.199.38] (wlan-199038.nbw.tue.nl [131.155.199.38])
	(Authenticated sender: ed)
	by palm.hoeg.nl (Postfix) with ESMTPSA id 0AC861CCF3;
	Tue, 10 Nov 2009 08:20:49 +0100 (CET)
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
	<7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
	<20091110055910.GC64905@hoeg.nl>
	<7mvdhigb96.wl%kuriyama@s2factory.co.jp>
Message-Id: <5523DBB0-28C6-46DD-83F9-AE135CEA1793@80386.nl>
From: Ed Schouten 
To: Jun Kuriyama 
In-Reply-To: <7mvdhigb96.wl%kuriyama@s2factory.co.jp>
Content-Type: text/plain;
	charset=us-ascii;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit
X-Mailer: iPod Mail (7D11)
Mime-Version: 1.0 (iPod Mail 7D11)
Date: Tue, 10 Nov 2009 08:20:22 +0100
Cc: "svn-src-head@freebsd.org" ,
	"svn-src-all@freebsd.org" ,
	"src-committers@freebsd.org" ,
	Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 07:20:52 -0000

Both systems run amd64. I'll try the tunable when I get back home.  
Thanks!

-- 
  Ed Schouten  (from iPod)
  WWW: http://80386.nl/

On 10 nov 2009, at 07:11, Jun Kuriyama  wrote:

> At Tue, 10 Nov 2009 06:59:11 +0100,
> ed@80386.nl wrote:
>>> (1) On MacBook, lock up occured on real hardware?  Not on  
>>> hypervisor?
>>
>> Nope. The MacBook does use Apple's Boot Camp, but I can't say whether
>> that can be considered to be a hypervisor. What happens, is that the
>> system just locks up after probing all the device. It doesn't mount  
>> the
>> root device anymore.
>
> Hmm, I think Boot Camp is not hypervisor, and should be treated as
> real hardware.  Which architecture (i386/amd64) you are using?
>
>>> (2) On both system, is there no problem before this commit?
>>
>> I bisected it and the revision before this one does boot. I'll
>> experiment with the tunables this afternoon. I really had to get some
>> sleep last night, so I couldn't investigate it any further.
>
> You can try with hw.clflush_disable="1" in loader.conf.  If you can
> boot with it, I must be mistaken something (anyway its my fault).
>
> Can you show me CPUID line at boot message (of course from the kernel
> you can boot) like this?
>
>> CPU: Dual-Core AMD Opteron(tm) Processor 2210 (1800.07-MHz K8-class  
>> CPU)
>>  Origin = "AuthenticAMD"  Id = 0x40f12  Stepping = 2
>>   
>> Features= 
>> 0x178bfbff< 
>> FPU, 
>> VME, 
>> DE, 
>> PSE, 
>> TSC, 
>> MSR, 
>> PAE, 
>> MCE, 
>> CX8, 
>> APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
>>  Features2=0x2001
>>  AMD Features=0xea500800> 3DNow!>
>
>
> -- 
> Jun Kuriyama  // FreeBSD Project
>          // S2 Factory, Inc.
>

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 09:44:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B23C3106566B;
	Tue, 10 Nov 2009 09:44:57 +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 A164C8FC0C;
	Tue, 10 Nov 2009 09:44: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 nAA9iu4E053398;
	Tue, 10 Nov 2009 09:44:56 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAA9iupI053397;
	Tue, 10 Nov 2009 09:44:56 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911100944.nAA9iupI053397@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Tue, 10 Nov 2009 09:44: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: r199130 - head/sbin/reboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 09:44:57 -0000

Author: des
Date: Tue Nov 10 09:44:55 2009
New Revision: 199130
URL: http://svn.freebsd.org/changeset/base/199130

Log:
  More rational usage()

Modified:
  head/sbin/reboot/reboot.c

Modified: head/sbin/reboot/reboot.c
==============================================================================
--- head/sbin/reboot/reboot.c	Tue Nov 10 04:02:03 2009	(r199129)
+++ head/sbin/reboot/reboot.c	Tue Nov 10 09:44:55 2009	(r199130)
@@ -216,10 +216,12 @@ restart:
 }
 
 static void
-usage()
+usage(void)
 {
-	(void)fprintf(stderr, "usage: %s [-%slnpq] [-k kernel]\n",
-	    getprogname(), dohalt ? "" : "d");
+
+	(void)fprintf(stderr, dohalt ?
+	    "usage: halt [-lnpq] [-k kernel]\n" :
+	    "usage: reboot [-dlnpq] [-k kernel]\n");
 	exit(1);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 09:45:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2402106568F;
	Tue, 10 Nov 2009 09:45:43 +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 E125D8FC18;
	Tue, 10 Nov 2009 09:45: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 nAA9jhEw053462;
	Tue, 10 Nov 2009 09:45:43 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAA9jhGH053459;
	Tue, 10 Nov 2009 09:45:43 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911100945.nAA9jhGH053459@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Tue, 10 Nov 2009 09:45: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: r199131 - in head: crypto/openssh secure/lib/libssh
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 09:45:44 -0000

Author: des
Date: Tue Nov 10 09:45:43 2009
New Revision: 199131
URL: http://svn.freebsd.org/changeset/base/199131

Log:
  Fix globbing
  
  Noticed by:	delphij, David Cornejo 
  Forgotten by:	des

Modified:
  head/crypto/openssh/ssh_namespace.h
  head/secure/lib/libssh/Makefile

Modified: head/crypto/openssh/ssh_namespace.h
==============================================================================
--- head/crypto/openssh/ssh_namespace.h	Tue Nov 10 09:44:55 2009	(r199130)
+++ head/crypto/openssh/ssh_namespace.h	Tue Nov 10 09:45:43 2009	(r199131)
@@ -223,6 +223,8 @@
 #define get_u32					ssh_get_u32
 #define get_u64					ssh_get_u64
 #define getrrsetbyname				ssh_getrrsetbyname
+#define glob					ssh_glob
+#define globfree				ssh_globfree
 #define host_hash				ssh_host_hash
 #define hostfile_read_key			ssh_hostfile_read_key
 #define hpdelim					ssh_hpdelim

Modified: head/secure/lib/libssh/Makefile
==============================================================================
--- head/secure/lib/libssh/Makefile	Tue Nov 10 09:44:55 2009	(r199130)
+++ head/secure/lib/libssh/Makefile	Tue Nov 10 09:45:43 2009	(r199131)
@@ -19,7 +19,7 @@ SRCS=	acss.c authfd.c authfile.c bufaux.
 # compiled directly into sshd instead.
 
 # Portability layer
-SRCS+=	bsd-misc.c fmt_scaled.c getrrsetbyname.c \
+SRCS+=	bsd-misc.c fmt_scaled.c getrrsetbyname.c glob.c \
 	openssl-compat.c port-tun.c strtonum.c vis.c xcrypt.c xmmap.c
 # FreeBSD additions
 SRCS+=	version.c

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 09:46:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E4461065696;
	Tue, 10 Nov 2009 09:46:53 +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 244748FC23;
	Tue, 10 Nov 2009 09:46: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 nAA9krMh053520;
	Tue, 10 Nov 2009 09:46:53 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAA9krUT053517;
	Tue, 10 Nov 2009 09:46:53 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911100946.nAA9krUT053517@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 10 Nov 2009 09:46: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: r199132 - head/sys/dev/siis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 09:46:53 -0000

Author: mav
Date: Tue Nov 10 09:46:52 2009
New Revision: 199132
URL: http://svn.freebsd.org/changeset/base/199132

Log:
  MFp4:
  Organize device IDs and add some more of them.

Modified:
  head/sys/dev/siis/siis.c
  head/sys/dev/siis/siis.h

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Tue Nov 10 09:45:43 2009	(r199131)
+++ head/sys/dev/siis/siis.c	Tue Nov 10 09:46:52 2009	(r199132)
@@ -89,24 +89,37 @@ static void siispoll(struct cam_sim *sim
 
 MALLOC_DEFINE(M_SIIS, "SIIS driver", "SIIS driver data buffers");
 
+static struct {
+	uint32_t	id;
+	const char	*name;
+	int		ports;
+} siis_ids[] = {
+	{0x31241095,	"SiI3124",	4},
+	{0x31248086,	"SiI3124",	4},
+	{0x31321095,	"SiI3132",	2},
+	{0x02421095,	"SiI3132",	2},
+	{0x02441095,	"SiI3132",	2},
+	{0x31311095,	"SiI3131",	1},
+	{0x35311095,	"SiI3531",	1},
+	{0,		NULL,		0}
+};
+
 static int
 siis_probe(device_t dev)
 {
+	char buf[64];
+	int i;
 	uint32_t devid = pci_get_devid(dev);
 
-	if (devid == SIIS_SII3124) {
-		device_set_desc_copy(dev, "SiI3124 SATA2 controller");
-	} else if (devid == SIIS_SII3132 ||
-		   devid == SIIS_SII3132_1 ||
-		   devid == SIIS_SII3132_2) {
-		device_set_desc_copy(dev, "SiI3132 SATA2 controller");
-	} else if (devid == SIIS_SII3531) {
-		device_set_desc_copy(dev, "SiI3531 SATA2 controller");
-	} else {
-		return (ENXIO);
+	for (i = 0; siis_ids[i].id != 0; i++) {
+		if (siis_ids[i].id == devid) {
+			snprintf(buf, sizeof(buf), "%s SATA2 controller",
+			    siis_ids[i].name);
+			device_set_desc_copy(dev, buf);
+			return (BUS_PROBE_VENDOR);
+		}
 	}
-
-	return (BUS_PROBE_VENDOR);
+	return (ENXIO);
 }
 
 static int
@@ -115,8 +128,12 @@ siis_attach(device_t dev)
 	struct siis_controller *ctlr = device_get_softc(dev);
 	uint32_t devid = pci_get_devid(dev);
 	device_t child;
-	int	error, unit;
+	int	error, i, unit;
 
+	for (i = 0; siis_ids[i].id != 0; i++) {
+		if (siis_ids[i].id == devid)
+			break;
+	}
 	ctlr->dev = dev;
 	/* Global memory */
 	ctlr->r_grid = PCIR_BAR(0);
@@ -146,8 +163,7 @@ siis_attach(device_t dev)
 	/* Reset controller */
 	siis_resume(dev);
 	/* Number of HW channels */
-	ctlr->channels = (devid == SIIS_SII3124) ? 4 :
-	    (devid == SIIS_SII3531 ? 1 : 2);
+	ctlr->channels = siis_ids[i].ports;
 	/* Setup interrupts. */
 	if (siis_setup_interrupt(dev)) {
 		bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem);

Modified: head/sys/dev/siis/siis.h
==============================================================================
--- head/sys/dev/siis/siis.h	Tue Nov 10 09:45:43 2009	(r199131)
+++ head/sys/dev/siis/siis.h	Tue Nov 10 09:46:52 2009	(r199132)
@@ -137,12 +137,6 @@
 
 #define ATA_SACTIVE                     16
 
-#define SIIS_SII3124		0x31241095
-#define SIIS_SII3132		0x31321095
-#define SIIS_SII3132_1		0x02421095
-#define SIIS_SII3132_2		0x02441095
-#define SIIS_SII3531		0x35311095
-
 /*
  * Global registers
  */

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 10:34:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C89B71065679;
	Tue, 10 Nov 2009 10:34: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 B728A8FC14;
	Tue, 10 Nov 2009 10:34: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 nAAAYi35055977;
	Tue, 10 Nov 2009 10:34:44 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAAYia3055971;
	Tue, 10 Nov 2009 10:34:44 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911101034.nAAAYia3055971@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Tue, 10 Nov 2009 10:34: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: r199133 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 10:34:44 -0000

Author: des
Date: Tue Nov 10 10:34:44 2009
New Revision: 199133
URL: http://svn.freebsd.org/changeset/base/199133

Log:
  Remove a bunch of code used to detect SMP on ((i386 && !pc98) || amd64) and
  offer to install an SMP kernel.  The way this worked was: on supported
  platforms, code to read ACPI tables and BIOS MP tables was compiled into
  sysinstall, and if an SMP kernel config was present in the source tree when
  sysinstall was built, code that called it was also compiled.  Since we
  haven't had SMP kernel configs in years, the latter was never compiled and
  the former never ran.
  
  This only removes dead and unreachable code; it does *not* remove the NCpus
  variable, nor the code that sets it to 1, nor the code that asks the user to
  select a kernel from a list.
  
  Discussed with:	re@, randi@ and others

Deleted:
  head/usr.sbin/sysinstall/acpi.c
  head/usr.sbin/sysinstall/acpidump.h
  head/usr.sbin/sysinstall/biosmptable.c
Modified:
  head/usr.sbin/sysinstall/Makefile
  head/usr.sbin/sysinstall/dist.c
  head/usr.sbin/sysinstall/install.c
  head/usr.sbin/sysinstall/menus.c
  head/usr.sbin/sysinstall/sysinstall.8

Modified: head/usr.sbin/sysinstall/Makefile
==============================================================================
--- head/usr.sbin/sysinstall/Makefile	Tue Nov 10 09:46:52 2009	(r199132)
+++ head/usr.sbin/sysinstall/Makefile	Tue Nov 10 10:34:44 2009	(r199133)
@@ -23,37 +23,6 @@ CFLAGS+= -I${.CURDIR}/../../gnu/lib/libd
 DPADD=	${LIBDIALOG} ${LIBNCURSES} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO}
 LDADD=	-ldialog -lncurses -lutil -ldisk -lftpio
 
-#
-# When distributions have both UP and SMP kernels sysinstall
-# will probe for the number of cpus on the target machine and
-# automatically select which is appropriate.  This can be overridden
-# through the menus or both kernels can be installed (with the
-# most "appropriate" one setup as /boot/kernel).  For now this
-# is done for i386 and amd64; for other systems support must be
-# added to identify the cpu count if acpi and MPTable probing
-# is insufficient.
-#
-# The unmber of cpus probed is passed through the environment in
-# VAR_NCPUS ("ncpus") to scripts.
-#
-# Note that WITH_SMP is a compile time option that enables the
-# builtin menus for the SMP kernel configuration.  If this kernel
-# is not built (see release/Makefile) then this should not be
-# enabled as sysinstall may try to select an SMP kernel config
-# where none is available.  This option should not be needed--we
-# should probe for an SMP kernel in the distribution but doing
-# that is painful because of media changes and the structure of
-# sysinstall so for now it's a priori.
-#
-.if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "amd64"
-SRCS+=	acpi.c biosmptable.c
-.if exists(${.CURDIR}/../../sys/${MACHINE}/conf/SMP)
-CFLAGS+=-DWITH_SMP	
-.endif
-DPADD+=	${LIBDEVINFO}
-LDADD+=	-ldevinfo
-.endif
-
 CLEANFILES=	makedevs.c rtermcap
 CLEANFILES+=	keymap.tmp keymap.h countries.tmp countries.h
 

Modified: head/usr.sbin/sysinstall/dist.c
==============================================================================
--- head/usr.sbin/sysinstall/dist.c	Tue Nov 10 09:46:52 2009	(r199132)
+++ head/usr.sbin/sysinstall/dist.c	Tue Nov 10 10:34:44 2009	(r199133)
@@ -99,9 +99,6 @@ static Distribution DistTable[] = {
 /* The kernel distributions */
 static Distribution KernelDistTable[] = {
     DTE_TARBALL("GENERIC",  &KernelDists, KERNEL_GENERIC, "/boot"),
-#ifdef WITH_SMP
-    DTE_TARBALL("SMP", 	    &KernelDists, KERNEL_SMP,	  "/boot"),
-#endif
     DTE_END,
 };
 
@@ -207,12 +204,7 @@ distConfig(dialogMenuItem *self)
 int
 selectKernel(void)
 {
-#ifdef WITH_SMP
-    /* select default kernel based on deduced cpu count */
-    return NCpus > 1 ? DIST_KERNEL_SMP : DIST_KERNEL_GENERIC;
-#else
     return DIST_KERNEL_GENERIC;
-#endif
 }
 
 int

Modified: head/usr.sbin/sysinstall/install.c
==============================================================================
--- head/usr.sbin/sysinstall/install.c	Tue Nov 10 09:46:52 2009	(r199132)
+++ head/usr.sbin/sysinstall/install.c	Tue Nov 10 10:34:44 2009	(r199133)
@@ -938,20 +938,12 @@ installFixupKernel(dialogMenuItem *self,
     /* All of this is done only as init, just to be safe */
     if (RunningAsInit) {
 	/*
-	 * Install something as /boot/kernel.  Prefer SMP
-	 * over GENERIC--this should handle the case where
-	 * both SMP and GENERIC are installed (otherwise we
-	 * select the one kernel that was installed).
+	 * Install something as /boot/kernel.
 	 *
 	 * NB: we assume any existing kernel has been saved
 	 *     already and the /boot/kernel we remove is empty.
 	 */
 	vsystem("rm -rf /boot/kernel");
-#if WITH_SMP
-	if (dists & DIST_KERNEL_SMP)
-		vsystem("mv /boot/SMP /boot/kernel");
-	else
-#endif
 		vsystem("mv /boot/GENERIC /boot/kernel");
     }
     return DITEM_SUCCESS | DITEM_RESTORE;
@@ -1255,11 +1247,6 @@ installVarDefaults(dialogMenuItem *self)
 	variable_set2(SYSTEM_STATE,		"init", 0);
     variable_set2(VAR_NEWFS_ARGS,		"-b 16384 -f 2048", 0);
     variable_set2(VAR_CONSTERM,                 "NO", 0);
-#if (defined(__i386__) && !defined(PC98)) || defined(__amd64__)
-    NCpus = acpi_detect();
-    if (NCpus == -1)
-	NCpus = biosmptable_detect();
-#endif
     if (NCpus <= 0)
 	NCpus = 1;
     snprintf(ncpus, sizeof(ncpus), "%u", NCpus);

Modified: head/usr.sbin/sysinstall/menus.c
==============================================================================
--- head/usr.sbin/sysinstall/menus.c	Tue Nov 10 09:46:52 2009	(r199132)
+++ head/usr.sbin/sysinstall/menus.c	Tue Nov 10 10:34:44 2009	(r199133)
@@ -1031,10 +1031,6 @@ DMenu MenuKernelDistributions = {
 	NULL,		clearKernel, NULL, NULL, ' ', ' ', ' ' },
       { " GENERIC",	"GENERIC kernel configuration",
 	dmenuFlagCheck,	dmenuSetFlag, NULL, &KernelDists, '[', 'X', ']', DIST_KERNEL_GENERIC },
-#ifdef WITH_SMP
-      { " SMP",		"GENERIC symmetric multiprocessor kernel configuration",
-	dmenuFlagCheck,	dmenuSetFlag,	NULL, &KernelDists, '[', 'X', ']', DIST_KERNEL_SMP },
-#endif
       { NULL } },
 };
 

Modified: head/usr.sbin/sysinstall/sysinstall.8
==============================================================================
--- head/usr.sbin/sysinstall/sysinstall.8	Tue Nov 10 09:46:52 2009	(r199132)
+++ head/usr.sbin/sysinstall/sysinstall.8	Tue Nov 10 10:34:44 2009	(r199133)
@@ -413,8 +413,6 @@ Possible distribution values are:
 The base binary distribution.
 .It Li GENERIC
 The GENERIC kernel.
-.It Li SMP
-A kernel suitable for multiple processor systems.
 .It Li doc
 Miscellaneous documentation
 .It Li games

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 10:42:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB9601065670;
	Tue, 10 Nov 2009 10:42:48 +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 BA92D8FC0C;
	Tue, 10 Nov 2009 10:42:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAAAgmBO056193;
	Tue, 10 Nov 2009 10:42:48 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAAgmWN056191;
	Tue, 10 Nov 2009 10:42:48 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911101042.nAAAgmWN056191@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Tue, 10 Nov 2009 10:42:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199134 - head/tools/regression/lib/libutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 10:42:48 -0000

Author: des
Date: Tue Nov 10 10:42:48 2009
New Revision: 199134
URL: http://svn.freebsd.org/changeset/base/199134

Log:
  Check fork() return value

Modified:
  head/tools/regression/lib/libutil/test-flopen.c

Modified: head/tools/regression/lib/libutil/test-flopen.c
==============================================================================
--- head/tools/regression/lib/libutil/test-flopen.c	Tue Nov 10 10:34:44 2009	(r199133)
+++ head/tools/regression/lib/libutil/test-flopen.c	Tue Nov 10 10:42:48 2009	(r199134)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2009 Dag-Erling Codan Smrgrav
+ * Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -161,7 +161,10 @@ test_flopen_lock_child(void)
 	if (fd1 < 0) {
 		result = strerror(errno);
 	} else {
-		if ((pid = fork()) == 0) {
+		pid = fork();
+		if (pid == -1) {
+			result = strerror(errno);
+		} else if (pid == 0) {
 			select(0, 0, 0, 0, 0);
 			_exit(0);
 		}

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 11:39:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED88F1065676;
	Tue, 10 Nov 2009 11:39:17 +0000 (UTC)
	(envelope-from keramida@freebsd.org)
Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr
	[150.140.141.169])
	by mx1.freebsd.org (Postfix) with ESMTP id 45EFD8FC08;
	Tue, 10 Nov 2009 11:39:17 +0000 (UTC)
Received: from mail.ceid.upatras.gr (unknown [10.1.0.143])
	by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 1807BEB4822;
	Tue, 10 Nov 2009 13:39:15 +0200 (EET)
Received: from localhost (europa.ceid.upatras.gr [127.0.0.1])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id CF333452AF;
	Tue, 10 Nov 2009 13:39:15 +0200 (EET)
X-Virus-Scanned: amavisd-new at ceid.upatras.gr
Received: from mail.ceid.upatras.gr ([127.0.0.1])
	by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id Ar+GamtFQtPE; Tue, 10 Nov 2009 13:39:15 +0200 (EET)
Received: from kobe.laptop (ppp-94-64-208-216.home.otenet.gr [94.64.208.216])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id 44ACC452A4;
	Tue, 10 Nov 2009 13:39:15 +0200 (EET)
Received: from kobe.laptop (kobe.laptop [127.0.0.1])
	by kobe.laptop (8.14.3/8.14.3) with ESMTP id nAABdEmV057503
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 10 Nov 2009 13:39:14 +0200 (EET)
	(envelope-from keramida@freebsd.org)
Received: (from keramida@localhost)
	by kobe.laptop (8.14.3/8.14.3/Submit) id nAABdEbJ057502;
	Tue, 10 Nov 2009 13:39:14 +0200 (EET)
	(envelope-from keramida@freebsd.org)
From: Giorgos Keramidas 
To: Alexander Motin 
References: <200911081433.nA8EXJnp088767@svn.freebsd.org>
Date: Tue, 10 Nov 2009 13:39:14 +0200
In-Reply-To: <200911081433.nA8EXJnp088767@svn.freebsd.org> (Alexander Motin's
	message of "Sun, 8 Nov 2009 14:33:19 +0000 (UTC)")
Message-ID: <87my2uip7h.fsf@kobe.laptop>
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: r199050 - in head/sys: conf dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 11:39:18 -0000

On Sun, 8 Nov 2009 14:33:19 +0000 (UTC), Alexander Motin  wrote:
> Author: mav
> Date: Sun Nov  8 14:33:19 2009
> New Revision: 199050
> URL: http://svn.freebsd.org/changeset/base/199050
>
> Log:
>   Introduce define and kernel option ATA_REQUEST_TIMEOUT to control ATA(4)
>   command timeout.
>
>   Submitted by:	keramida

Neat.  One more local patch I can delete now.  Thanks :-)


From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 11:43:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37D80106566B;
	Tue, 10 Nov 2009 11:43: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 230DE8FC12;
	Tue, 10 Nov 2009 11: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 nAABh7a2057892;
	Tue, 10 Nov 2009 11:43:07 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAABh7Kg057874;
	Tue, 10 Nov 2009 11:43:07 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200911101143.nAABh7Kg057874@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 10 Nov 2009 11:43: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: r199135 - in head/sys: amd64/amd64 arm/arm i386/i386
	ia64/ia64 mips/include mips/mips powerpc/aim powerpc/booke
	sparc64/include sparc64/sparc64 sun4v/sun4v sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 11:43:08 -0000

Author: kib
Date: Tue Nov 10 11:43:07 2009
New Revision: 199135
URL: http://svn.freebsd.org/changeset/base/199135

Log:
  Extract the code that records syscall results in the frame into MD
  function cpu_set_syscall_retval().
  
  Suggested by:	marcel
  Reviewed by:	marcel, davidxu
  PowerPC, ARM, ia64 changes:	marcel
  Sparc64 tested and reviewed by:	marius, also sunv reviewed
  MIPS tested by:	gonzo
  MFC after:	1 month

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/arm/arm/trap.c
  head/sys/arm/arm/vm_machdep.c
  head/sys/i386/i386/trap.c
  head/sys/i386/i386/vm_machdep.c
  head/sys/ia64/ia64/trap.c
  head/sys/ia64/ia64/vm_machdep.c
  head/sys/mips/include/pcb.h
  head/sys/mips/mips/trap.c
  head/sys/mips/mips/vm_machdep.c
  head/sys/powerpc/aim/trap.c
  head/sys/powerpc/aim/vm_machdep.c
  head/sys/powerpc/booke/trap.c
  head/sys/powerpc/booke/vm_machdep.c
  head/sys/sparc64/include/pcb.h
  head/sys/sparc64/sparc64/trap.c
  head/sys/sparc64/sparc64/vm_machdep.c
  head/sys/sun4v/sun4v/trap.c
  head/sys/sun4v/sun4v/vm_machdep.c
  head/sys/sys/proc.h

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/amd64/amd64/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -1007,39 +1007,7 @@ syscall(struct trapframe *frame)
 #endif
 	}
 
-	switch (error) {
-	case 0:
-		frame->tf_rax = td->td_retval[0];
-		frame->tf_rdx = td->td_retval[1];
-		frame->tf_rflags &= ~PSL_C;
-		break;
-
-	case ERESTART:
-		/*
-		 * Reconstruct pc, we know that 'syscall' is 2 bytes.
-		 * We have to do a full context restore so that %r10
-		 * (which was holding the value of %rcx) is restored for
-		 * the next iteration.
-		 */
-		frame->tf_rip -= frame->tf_err;
-		frame->tf_r10 = frame->tf_rcx;
-		td->td_pcb->pcb_flags |= PCB_FULLCTX;
-		break;
-
-	case EJUSTRETURN:
-		break;
-
-	default:
- 		if (p->p_sysent->sv_errsize) {
- 			if (error >= p->p_sysent->sv_errsize)
-  				error = -1;	/* XXX */
-   			else
-  				error = p->p_sysent->sv_errtbl[error];
-		}
-		frame->tf_rax = error;
-		frame->tf_rflags |= PSL_C;
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Traced syscall.

Modified: head/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- head/sys/amd64/amd64/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/amd64/amd64/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -317,6 +317,45 @@ cpu_thread_free(struct thread *td)
 	cpu_thread_clean(td);
 }
 
+void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+
+	switch (error) {
+	case 0:
+		td->td_frame->tf_rax = td->td_retval[0];
+		td->td_frame->tf_rdx = td->td_retval[1];
+		td->td_frame->tf_rflags &= ~PSL_C;
+		break;
+
+	case ERESTART:
+		/*
+		 * Reconstruct pc, we know that 'syscall' is 2 bytes.
+		 * We have to do a full context restore so that %r10
+		 * (which was holding the value of %rcx) is restored
+		 * for the next iteration.
+		 */
+		td->td_frame->tf_rip -= td->td_frame->tf_err;
+		td->td_frame->tf_r10 = td->td_frame->tf_rcx;
+		td->td_pcb->pcb_flags |= PCB_FULLCTX;
+		break;
+
+	case EJUSTRETURN:
+		break;
+
+	default:
+		if (td->td_proc->p_sysent->sv_errsize) {
+			if (error >= td->td_proc->p_sysent->sv_errsize)
+				error = -1;	/* XXX */
+			else
+				error = td->td_proc->p_sysent->sv_errtbl[error];
+		}
+		td->td_frame->tf_rax = error;
+		td->td_frame->tf_rflags |= PSL_C;
+		break;
+	}
+}
+
 /*
  * Initialize machine state (pcb and trap frame) for a new thread about to
  * upcall. Put enough state in the new thread's PCB to get it to go back 

Modified: head/sys/arm/arm/trap.c
==============================================================================
--- head/sys/arm/arm/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/arm/arm/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -932,43 +932,8 @@ syscall(struct thread *td, trapframe_t *
 		KASSERT(td->td_ar == NULL, 
 		    ("returning from syscall with td_ar set!"));
 	}
-	switch (error) {
-	case 0: 
-#ifdef __ARMEB__
-		if ((insn & 0x000fffff) == SYS___syscall &&
-		    code != SYS_freebsd6_lseek && code != SYS_lseek) {
-			/*
-			 * 64-bit return, 32-bit syscall. Fixup byte order
-			 */ 
-			frame->tf_r0 = 0;
-			frame->tf_r1 = td->td_retval[0];
-		} else {
-			frame->tf_r0 = td->td_retval[0];
-			frame->tf_r1 = td->td_retval[1];
-		}
-#else
-		frame->tf_r0 = td->td_retval[0];
-	  	frame->tf_r1 = td->td_retval[1];
-#endif
-					      
-		frame->tf_spsr &= ~PSR_C_bit;   /* carry bit */
-		break;
-		
-	case ERESTART:
-		/*
-		 * Reconstruct the pc to point at the swi.
-		 */
-		frame->tf_pc -= INSN_SIZE;
-		break;
-	case EJUSTRETURN:                                       
-		/* nothing to do */  
-		break;
-	default:
 bad:
-		frame->tf_r0 = error;
-		frame->tf_spsr |= PSR_C_bit;    /* carry bit */
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning",
 	    (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???");

Modified: head/sys/arm/arm/vm_machdep.c
==============================================================================
--- head/sys/arm/arm/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/arm/arm/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -261,6 +263,57 @@ done:
 #endif
 }
 
+void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+	trapframe_t *frame;
+	int fixup;
+#ifdef __ARMEB__
+	uint32_t insn;
+#endif
+
+	frame = td->td_frame;
+	fixup = 0;
+
+#ifdef __ARMEB__
+	insn = *(u_int32_t *)(frame->tf_pc - INSN_SIZE);
+	if ((insn & 0x000fffff) == SYS___syscall) {
+		register_t *ap = &frame->tf_r0;
+		register_t code = ap[_QUAD_LOWWORD];
+		if (td->td_proc->p_sysent->sv_mask)
+			code &= td->td_proc->p_sysent->sv_mask;
+		fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek)
+		    ? 1 : 0;
+	}
+#endif
+
+	switch (error) {
+	case 0:
+		if (fixup) {
+			frame->tf_r0 = 0;
+			frame->tf_r1 = td->td_retval[0];
+		} else {
+			frame->tf_r0 = td->td_retval[0];
+			frame->tf_r1 = td->td_retval[1];
+		}
+		frame->tf_spsr &= ~PSR_C_bit;   /* carry bit */
+		break;
+	case ERESTART:
+		/*
+		 * Reconstruct the pc to point at the swi.
+		 */
+		frame->tf_pc -= INSN_SIZE;
+		break;
+	case EJUSTRETURN:
+		/* nothing to do */
+		break;
+	default:
+		frame->tf_r0 = error;
+		frame->tf_spsr |= PSR_C_bit;    /* carry bit */
+		break;
+	}
+}
+
 /*
  * Initialize machine state (pcb and trap frame) for a new thread about to
  * upcall. Put enough state in the new thread's PCB to get it to go back 

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/i386/i386/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -1093,35 +1093,7 @@ syscall(struct trapframe *frame)
 #endif
 	}
 
-	switch (error) {
-	case 0:
-		frame->tf_eax = td->td_retval[0];
-		frame->tf_edx = td->td_retval[1];
-		frame->tf_eflags &= ~PSL_C;
-		break;
-
-	case ERESTART:
-		/*
-		 * Reconstruct pc, assuming lcall $X,y is 7 bytes,
-		 * int 0x80 is 2 bytes. We saved this in tf_err.
-		 */
-		frame->tf_eip -= frame->tf_err;
-		break;
-
-	case EJUSTRETURN:
-		break;
-
-	default:
- 		if (p->p_sysent->sv_errsize) {
- 			if (error >= p->p_sysent->sv_errsize)
-  				error = -1;	/* XXX */
-   			else
-  				error = p->p_sysent->sv_errtbl[error];
-		}
-		frame->tf_eax = error;
-		frame->tf_eflags |= PSL_C;
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Traced syscall.

Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/i386/i386/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -380,6 +381,41 @@ cpu_thread_free(struct thread *td)
 	cpu_thread_clean(td);
 }
 
+void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+
+	switch (error) {
+	case 0:
+		td->td_frame->tf_eax = td->td_retval[0];
+		td->td_frame->tf_edx = td->td_retval[1];
+		td->td_frame->tf_eflags &= ~PSL_C;
+		break;
+
+	case ERESTART:
+		/*
+		 * Reconstruct pc, assuming lcall $X,y is 7 bytes, int
+		 * 0x80 is 2 bytes. We saved this in tf_err.
+		 */
+		td->td_frame->tf_eip -= td->td_frame->tf_err;
+		break;
+
+	case EJUSTRETURN:
+		break;
+
+	default:
+		if (td->td_proc->p_sysent->sv_errsize) {
+			if (error >= td->td_proc->p_sysent->sv_errsize)
+				error = -1;	/* XXX */
+			else
+				error = td->td_proc->p_sysent->sv_errtbl[error];
+		}
+		td->td_frame->tf_eax = error;
+		td->td_frame->tf_eflags |= PSL_C;
+		break;
+	}
+}
+
 /*
  * Initialize machine state (pcb and trap frame) for a new thread about to
  * upcall. Put enough state in the new thread's PCB to get it to go back 

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/ia64/ia64/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -976,26 +976,7 @@ syscall(struct trapframe *tf)
 	error = (*callp->sy_call)(td, args);
 	AUDIT_SYSCALL_EXIT(error, td);
 
-	if (error != EJUSTRETURN) {
-		/*
-		 * Save the "raw" error code in r10. We use this to handle
-		 * syscall restarts (see do_ast()).
-		 */
-		tf->tf_scratch.gr10 = error;
-		if (error == 0) {
-			tf->tf_scratch.gr8 = td->td_retval[0];
-			tf->tf_scratch.gr9 = td->td_retval[1];
-		} else if (error != ERESTART) {
-			if (error < p->p_sysent->sv_errsize)
-				error = p->p_sysent->sv_errtbl[error];
-			/*
-			 * Translated error codes are returned in r8. User
-			 * processes use the translated error code.
-			 */
-			tf->tf_scratch.gr8 = error;
-		}
-	}
-
+	cpu_set_syscall_retval(td, error);
 	td->td_syscalls++;
 
 	/*

Modified: head/sys/ia64/ia64/vm_machdep.c
==============================================================================
--- head/sys/ia64/ia64/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/ia64/ia64/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -73,6 +73,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -140,6 +141,36 @@ cpu_thread_swapout(struct thread *td)
 }
 
 void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+	struct proc *p;
+	struct trapframe *tf;
+
+	if (error == EJUSTRETURN)
+		return;
+
+	tf = td->td_frame;
+
+	/*
+	 * Save the "raw" error code in r10. We use this to handle
+	 * syscall restarts (see do_ast()).
+	 */
+	tf->tf_scratch.gr10 = error;
+	if (error == 0) {
+		tf->tf_scratch.gr8 = td->td_retval[0];
+		tf->tf_scratch.gr9 = td->td_retval[1];
+	} else if (error != ERESTART) {
+		p = td->td_proc;
+		if (error < p->p_sysent->sv_errsize)
+			error = p->p_sysent->sv_errtbl[error];
+		/*
+		 * Translated error codes are returned in r8. User
+		 */
+		tf->tf_scratch.gr8 = error;
+	}
+}
+
+void
 cpu_set_upcall(struct thread *td, struct thread *td0)
 {
 	struct pcb *pcb;

Modified: head/sys/mips/include/pcb.h
==============================================================================
--- head/sys/mips/include/pcb.h	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/mips/include/pcb.h	Tue Nov 10 11:43:07 2009	(r199135)
@@ -52,6 +52,7 @@ struct pcb
 	struct trapframe pcb_regs;	/* saved CPU and registers */
 	label_t pcb_context;		/* kernel context for resume */
 	int	pcb_onfault;		/* for copyin/copyout faults */
+	register_t pcb_tpc;
 };
 
 /* these match the regnum's in regnum.h

Modified: head/sys/mips/mips/trap.c
==============================================================================
--- head/sys/mips/mips/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/mips/mips/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -644,7 +644,6 @@ dofault:
 			struct trapframe *locr0 = td->td_frame;
 			struct sysent *callp;
 			unsigned int code;
-			unsigned int tpc;
 			int nargs, nsaved;
 			register_t args[8];
 
@@ -660,7 +659,7 @@ dofault:
 				thread_user_enter(td);
 #endif
 			/* compute next PC after syscall instruction */
-			tpc = trapframe->pc;	/* Remember if restart */
+			td->td_pcb->pcb_tpc = trapframe->pc;	/* Remember if restart */
 			if (DELAYBRANCH(trapframe->cause)) {	/* Check BD bit */
 				locr0->pc = MipsEmulateBranch(locr0, trapframe->pc, 0,
 				    0);
@@ -761,44 +760,7 @@ dofault:
 			locr0 = td->td_frame;
 #endif
 			trapdebug_enter(locr0, -code);
-			switch (i) {
-			case 0:
-				if (quad_syscall && code != SYS_lseek) {
-					/*
-					 * System call invoked through the
-					 * SYS___syscall interface but the
-					 * return value is really just 32
-					 * bits.
-					 */
-					locr0->v0 = td->td_retval[0];
-					if (_QUAD_LOWWORD)
-						locr0->v1 = td->td_retval[0];
-					locr0->a3 = 0;
-				} else {
-					locr0->v0 = td->td_retval[0];
-					locr0->v1 = td->td_retval[1];
-					locr0->a3 = 0;
-				}
-				break;
-
-			case ERESTART:
-				locr0->pc = tpc;
-				break;
-
-			case EJUSTRETURN:
-				break;	/* nothing to do */
-
-			default:
-				if (quad_syscall && code != SYS_lseek) {
-					locr0->v0 = i;
-					if (_QUAD_LOWWORD)
-						locr0->v1 = i;
-					locr0->a3 = 1;
-				} else {
-					locr0->v0 = i;
-					locr0->a3 = 1;
-				}
-			}
+			cpu_set_syscall_retval(td, i);
 
 			/*
 			 * The sync'ing of I & D caches for SYS_ptrace() is

Modified: head/sys/mips/mips/vm_machdep.c
==============================================================================
--- head/sys/mips/mips/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/mips/mips/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -256,6 +257,62 @@ cpu_thread_alloc(struct thread *td)
 	}
 }
 
+void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+	struct trapframe *locr0 = td->td_frame;
+	unsigned int code;
+	int quad_syscall;
+
+	code = locr0->v0;
+	quad_syscall = 0;
+	if (code == SYS_syscall)
+		code = locr0->a0;
+	else if (code == SYS___syscall) {
+		code = _QUAD_LOWWORD ? locr0->a1 : locr0->a0;
+		quad_syscall = 1;
+	}
+
+	switch (error) {
+	case 0:
+		if (quad_syscall && code != SYS_lseek) {
+			/*
+			 * System call invoked through the
+			 * SYS___syscall interface but the
+			 * return value is really just 32
+			 * bits.
+			 */
+			locr0->v0 = td->td_retval[0];
+			if (_QUAD_LOWWORD)
+				locr0->v1 = td->td_retval[0];
+			locr0->a3 = 0;
+		} else {
+			locr0->v0 = td->td_retval[0];
+			locr0->v1 = td->td_retval[1];
+			locr0->a3 = 0;
+		}
+		break;
+
+	case ERESTART:
+		locr0->pc = td->td_pcb->pcb_tpc;
+		break;
+
+	case EJUSTRETURN:
+		break;	/* nothing to do */
+
+	default:
+		if (quad_syscall && code != SYS_lseek) {
+			locr0->v0 = error;
+			if (_QUAD_LOWWORD)
+				locr0->v1 = error;
+			locr0->a3 = 1;
+		} else {
+			locr0->v0 = error;
+			locr0->a3 = 1;
+		}
+	}
+}
+
 /*
  * Initialize machine state (pcb and trap frame) for a new thread about to
  * upcall. Put enough state in the new thread's PCB to get it to go back

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/powerpc/aim/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -415,43 +415,8 @@ syscall(struct trapframe *frame)
 		CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", td->td_name,
 		     syscallnames[code], td->td_retval[0]);
 	}
-	switch (error) {
-	case 0:
-		if (frame->fixreg[0] == SYS___syscall &&
-		    code != SYS_freebsd6_lseek && code != SYS_lseek) {
-			/*
-			 * 64-bit return, 32-bit syscall. Fixup byte order
-			 */
-			frame->fixreg[FIRSTARG] = 0;
-			frame->fixreg[FIRSTARG + 1] = td->td_retval[0];
-		} else {
-			frame->fixreg[FIRSTARG] = td->td_retval[0];
-			frame->fixreg[FIRSTARG + 1] = td->td_retval[1];
-		}
-		/* XXX: Magic number */
-		frame->cr &= ~0x10000000;
-		break;
-	case ERESTART:
-		/*
-		 * Set user's pc back to redo the system call.
-		 */
-		frame->srr0 -= 4;
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-		if (p->p_sysent->sv_errsize) {
-			if (error >= p->p_sysent->sv_errsize)
-				error = -1;	/* XXX */
-			else
-				error = p->p_sysent->sv_errtbl[error];
-		}
-		frame->fixreg[FIRSTARG] = error;
-		/* XXX: Magic number: Carry Flag Equivalent? */
-		frame->cr |= 0x10000000;
-		break;
-	}
+
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Check for misbehavior.

Modified: head/sys/powerpc/aim/vm_machdep.c
==============================================================================
--- head/sys/powerpc/aim/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/powerpc/aim/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -81,7 +81,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -422,6 +424,59 @@ cpu_thread_swapout(struct thread *td)
 }
 
 void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+	struct proc *p;
+	struct trapframe *tf;
+	int fixup;
+
+	if (error == EJUSTRETURN)
+		return;
+
+	p = td->td_proc;
+	tf = td->td_frame;
+
+	if (tf->fixreg[0] == SYS___syscall) {
+		int code = tf->fixreg[FIRSTARG + 1];
+		if (p->p_sysent->sv_mask)
+			code &= p->p_sysent->sv_mask;
+		fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ?
+		    1 : 0;
+	} else
+		fixup = 0;
+
+	switch (error) {
+	case 0:
+		if (fixup) {
+			/*
+			 * 64-bit return, 32-bit syscall. Fixup byte order
+			 */
+			tf->fixreg[FIRSTARG] = 0;
+			tf->fixreg[FIRSTARG + 1] = td->td_retval[0];
+		} else {
+			tf->fixreg[FIRSTARG] = td->td_retval[0];
+			tf->fixreg[FIRSTARG + 1] = td->td_retval[1];
+		}
+		tf->cr &= ~0x10000000;		/* XXX: Magic number */
+		break;
+	case ERESTART:
+		/*
+		 * Set user's pc back to redo the system call.
+		 */
+		tf->srr0 -= 4;
+		break;
+	default:
+		if (p->p_sysent->sv_errsize) {
+			error = (error < p->p_sysent->sv_errsize) ?
+			    p->p_sysent->sv_errtbl[error] : -1;
+		}
+		tf->fixreg[FIRSTARG] = error;
+		tf->cr |= 0x10000000;		/* XXX: Magic number */
+		break;
+	}
+}
+
+void
 cpu_set_upcall(struct thread *td, struct thread *td0)
 {
 	struct pcb *pcb2;

Modified: head/sys/powerpc/booke/trap.c
==============================================================================
--- head/sys/powerpc/booke/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/powerpc/booke/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -417,42 +417,7 @@ syscall(struct trapframe *frame)
 		     syscallnames[code], td->td_retval[0]);
 	}
 
-	switch (error) {
-	case 0:
-		if (frame->fixreg[0] == SYS___syscall && SYS_lseek) {
-			/*
-			 * 64-bit return, 32-bit syscall. Fixup byte order
-			 */
-			frame->fixreg[FIRSTARG] = 0;
-			frame->fixreg[FIRSTARG + 1] = td->td_retval[0];
-		} else {
-			frame->fixreg[FIRSTARG] = td->td_retval[0];
-			frame->fixreg[FIRSTARG + 1] = td->td_retval[1];
-		}
-		/* XXX: Magic number */
-		frame->cr &= ~0x10000000;
-		break;
-	case ERESTART:
-		/*
-		 * Set user's pc back to redo the system call.
-		 */
-		frame->srr0 -= 4;
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-		if (p->p_sysent->sv_errsize) {
-			if (error >= p->p_sysent->sv_errsize)
-				error = -1;	/* XXX */
-			else
-				error = p->p_sysent->sv_errtbl[error];
-		}
-		frame->fixreg[FIRSTARG] = error;
-		/* XXX: Magic number: Carry Flag Equivalent? */
-		frame->cr |= 0x10000000;
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Check for misbehavior.

Modified: head/sys/powerpc/booke/vm_machdep.c
==============================================================================
--- head/sys/powerpc/booke/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/powerpc/booke/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -113,7 +113,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -423,6 +425,59 @@ cpu_thread_swapout(struct thread *td)
 }
 
 void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+	struct proc *p;
+	struct trapframe *tf;
+	int fixup;
+
+	p = td->td_proc;
+	tf = td->td_frame;
+
+	if (tf->fixreg[0] == SYS___syscall) {
+		int code = tf->fixreg[FIRSTARG + 1];
+		if (p->p_sysent->sv_mask)
+			code &= p->p_sysent->sv_mask;
+		fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ?
+		    1 : 0;
+	} else
+		fixup = 0;
+
+	switch (error) {
+	case 0:
+		if (fixup) {
+			/*
+			 * 64-bit return, 32-bit syscall. Fixup byte order
+			 */
+			tf->fixreg[FIRSTARG] = 0;
+			tf->fixreg[FIRSTARG + 1] = td->td_retval[0];
+		} else {
+			tf->fixreg[FIRSTARG] = td->td_retval[0];
+			tf->fixreg[FIRSTARG + 1] = td->td_retval[1];
+		}
+		tf->cr &= ~0x10000000;		/* XXX: Magic number */
+		break;
+	case ERESTART:
+		/*
+		 * Set user's pc back to redo the system call.
+		 */
+		tf->srr0 -= 4;
+		break;
+	case EJUSTRETURN:
+		/* nothing to do */
+		break;
+	default:
+		if (p->p_sysent->sv_errsize) {
+			error = (error < p->p_sysent->sv_errsize) ?
+			    p->p_sysent->sv_errtbl[error] : -1;
+		}
+		tf->fixreg[FIRSTARG] = error;
+		tf->cr |= 0x10000000;		/* XXX: Magic number */
+		break;
+	}
+}
+
+void
 cpu_set_upcall(struct thread *td, struct thread *td0)
 {
 	struct pcb *pcb2;

Modified: head/sys/sparc64/include/pcb.h
==============================================================================
--- head/sys/sparc64/include/pcb.h	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/sparc64/include/pcb.h	Tue Nov 10 11:43:07 2009	(r199135)
@@ -49,7 +49,8 @@ struct pcb {
 	uint64_t pcb_nsaved;
 	uint64_t pcb_pc;
 	uint64_t pcb_sp;
-	uint64_t pcb_pad[4];
+	uint64_t pcb_tpc;
+	uint64_t pcb_pad[3];
 } __aligned(64);
 
 #ifdef _KERNEL

Modified: head/sys/sparc64/sparc64/trap.c
==============================================================================
--- head/sys/sparc64/sparc64/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/sparc64/sparc64/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -538,7 +538,6 @@ syscall(struct trapframe *tf)
 	register_t *argp;
 	struct proc *p;
 	u_long code;
-	u_long tpc;
 	int reg;
 	int regcnt;
 	int narg;
@@ -562,7 +561,7 @@ syscall(struct trapframe *tf)
 	 * For syscalls, we don't want to retry the faulting instruction
 	 * (usually), instead we need to advance one instruction.
 	 */
-	tpc = tf->tf_tpc;
+	td->td_pcb->pcb_tpc = tf->tf_tpc;
 	TF_DONE(tf);
 
 	reg = 0;
@@ -626,39 +625,7 @@ syscall(struct trapframe *tf)
 		    td->td_retval[1]);
 	}
 
-	/*
-	 * MP SAFE (we may or may not have the MP lock at this point)
-	 */
-	switch (error) {
-	case 0:
-		tf->tf_out[0] = td->td_retval[0];
-		tf->tf_out[1] = td->td_retval[1];
-		tf->tf_tstate &= ~TSTATE_XCC_C;
-		break;
-
-	case ERESTART:
-		/*
-		 * Undo the tpc advancement we have done above, we want to
-		 * reexecute the system call.
-		 */
-		tf->tf_tpc = tpc;
-		tf->tf_tnpc -= 4;
-		break;
-
-	case EJUSTRETURN:
-		break;
-
-	default:
-		if (p->p_sysent->sv_errsize) {
-			if (error >= p->p_sysent->sv_errsize)
-				error = -1;	/* XXX */
-			else
-				error = p->p_sysent->sv_errtbl[error];
-		}
-		tf->tf_out[0] = error;
-		tf->tf_tstate |= TSTATE_XCC_C;
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Check for misbehavior.

Modified: head/sys/sparc64/sparc64/vm_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/sparc64/sparc64/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -166,6 +167,42 @@ cpu_thread_swapout(struct thread *td)
 }
 
 void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+
+	switch (error) {
+	case 0:
+		td->td_frame->tf_out[0] = td->td_retval[0];
+		td->td_frame->tf_out[1] = td->td_retval[1];
+		td->td_frame->tf_tstate &= ~TSTATE_XCC_C;
+		break;
+
+	case ERESTART:
+		/*
+		 * Undo the tpc advancement we have done on syscall
+		 * enter, we want to reexecute the system call.
+		 */
+		td->td_frame->tf_tpc = td->td_pcb->pcb_tpc;
+		td->td_frame->tf_tnpc -= 4;
+		break;
+
+	case EJUSTRETURN:
+		break;
+
+	default:
+		if (td->td_proc->p_sysent->sv_errsize) {
+			if (error >= td->td_proc->p_sysent->sv_errsize)
+				error = -1;	/* XXX */
+			else
+				error = td->td_proc->p_sysent->sv_errtbl[error];
+		}
+		td->td_frame->tf_out[0] = error;
+		td->td_frame->tf_tstate |= TSTATE_XCC_C;
+		break;
+	}
+}
+
+void
 cpu_set_upcall(struct thread *td, struct thread *td0)
 {
 	struct trapframe *tf;

Modified: head/sys/sun4v/sun4v/trap.c
==============================================================================
--- head/sys/sun4v/sun4v/trap.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/sun4v/sun4v/trap.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -81,6 +81,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -582,7 +583,6 @@ syscall(struct trapframe *tf)
 	register_t *argp;
 	struct proc *p;
 	u_long code;
-	u_long tpc;
 	int reg;
 	int regcnt;
 	int narg;
@@ -606,7 +606,7 @@ syscall(struct trapframe *tf)
 	 * For syscalls, we don't want to retry the faulting instruction
 	 * (usually), instead we need to advance one instruction.
 	 */
-	tpc = tf->tf_tpc;
+	td->td_pcb->pcb_tpc = tf->tf_tpc;
 	TF_DONE(tf);
 
 	reg = 0;
@@ -673,40 +673,8 @@ syscall(struct trapframe *tf)
 		    error, syscallnames[code], td->td_retval[0],
 		    td->td_retval[1]);
 	}
-	
-	/*
-	 * MP SAFE (we may or may not have the MP lock at this point)
-	 */
-	switch (error) {
-	case 0:
-		tf->tf_out[0] = td->td_retval[0];
-		tf->tf_out[1] = td->td_retval[1];
-		tf->tf_tstate &= ~TSTATE_XCC_C;
-		break;
 
-	case ERESTART:
-		/*
-		 * Undo the tpc advancement we have done above, we want to
-		 * reexecute the system call.
-		 */
-		tf->tf_tpc = tpc;
-		tf->tf_tnpc -= 4;
-		break;
-
-	case EJUSTRETURN:
-		break;
-
-	default:
- 		if (p->p_sysent->sv_errsize) {
- 			if (error >= p->p_sysent->sv_errsize)
-  				error = -1;	/* XXX */
-   			else
-  				error = p->p_sysent->sv_errtbl[error];
-		}
-		tf->tf_out[0] = error;
-		tf->tf_tstate |= TSTATE_XCC_C;
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Handle reschedule and other end-of-syscall issues

Modified: head/sys/sun4v/sun4v/vm_machdep.c
==============================================================================
--- head/sys/sun4v/sun4v/vm_machdep.c	Tue Nov 10 10:42:48 2009	(r199134)
+++ head/sys/sun4v/sun4v/vm_machdep.c	Tue Nov 10 11:43:07 2009	(r199135)
@@ -57,6 +57,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -142,6 +143,42 @@ cpu_thread_swapout(struct thread *td)
 }
 
 void
+cpu_set_syscall_retval(struct thread *td, int error)
+{
+
+	switch (error) {
+	case 0:
+		td->td_frame->tf_out[0] = td->td_retval[0];
+		td->td_frame->tf_out[1] = td->td_retval[1];
+		td->td_frame->tf_tstate &= ~TSTATE_XCC_C;
+		break;
+
+	case ERESTART:
+		/*
+		 * Undo the tpc advancement we have done on syscall
+		 * enter, we want to reexecute the system call.
+		 */
+		td->td_frame->tf_tpc = td->td_pcb->pcb_tpc;
+		td->td_frame->tf_tnpc -= 4;
+		break;
+
+	case EJUSTRETURN:
+		break;
+
+	default:
+		if (td->td_proc->p_sysent->sv_errsize) {
+			if (error >= td->td_proc->p_sysent->sv_errsize)
+				error = -1;	/* XXX */
+			else
+				error = td->td_proc->p_sysent->sv_errtbl[error];
+		}
+		td->td_frame->tf_out[0] = error;
+		td->td_frame->tf_tstate |= TSTATE_XCC_C;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 11:46:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A8841065670;
	Tue, 10 Nov 2009 11:46:54 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D90198FC0C;
	Tue, 10 Nov 2009 11:46: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 nAABksWF058016;
	Tue, 10 Nov 2009 11:46:54 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAABksqs058013;
	Tue, 10 Nov 2009 11:46:54 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200911101146.nAABksqs058013@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 10 Nov 2009 11:46:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199136 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 11:46:55 -0000

Author: kib
Date: Tue Nov 10 11:46:53 2009
New Revision: 199136
URL: http://svn.freebsd.org/changeset/base/199136

Log:
  In r198506, kern_sigsuspend() started doing cursig/postsig loop to make
  sure that a signal was delivered to the thread before returning from
  syscall. Signal delivery puts new return frame on the user stack, and
  modifies trap frame to enter signal handler. As a consequence, syscall
  return code sets EINTR as error return for signal frame, instead of the
  syscall return.
  
  Also, for ia64, due to different registers layout for those two kind of
  frames, usermode sigsegfaulted when returned from signal handler.
  
  Use newly-introduced cpu_set_syscall_retval(9) to set syscall result,
  and return EJUSTRETURN from kern_sigsuspend() to prevent syscall return
  code from modifying this frame [1].
  
  Another issue is that pending SIGCONT might be cancelled by SIGSTOP,
  causing postsig() not to deliver any catched signal [2]. Modify
  postsig() to return 1 if signal was posted, and 0 otherwise, and use
  this in the kern_sigsuspend loop.
  
  Proposed by:	marcel [1]
  Noted by:	davidxu [2]
  Reviewed by:	marcel, davidxu
  MFC after:	1 month

Modified:
  head/sys/kern/kern_sig.c
  head/sys/sys/signalvar.h

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Tue Nov 10 11:43:07 2009	(r199135)
+++ head/sys/kern/kern_sig.c	Tue Nov 10 11:46:53 2009	(r199136)
@@ -1471,21 +1471,19 @@ kern_sigsuspend(struct thread *td, sigse
 	 * thread. But sigsuspend should return only on signal
 	 * delivery.
 	 */
+	cpu_set_syscall_retval(td, EINTR);
 	for (has_sig = 0; !has_sig;) {
 		while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause",
 			0) == 0)
 			/* void */;
 		thread_suspend_check(0);
 		mtx_lock(&p->p_sigacts->ps_mtx);
-		while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) {
-			postsig(sig);
-			has_sig = 1;
-		}
+		while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0)
+			has_sig += postsig(sig);
 		mtx_unlock(&p->p_sigacts->ps_mtx);
 	}
 	PROC_UNLOCK(p);
-	/* always return EINTR rather than ERESTART... */
-	return (EINTR);
+	return (EJUSTRETURN);
 }
 
 #ifdef COMPAT_43	/* XXX - COMPAT_FBSD3 */
@@ -2670,7 +2668,7 @@ thread_stopped(struct proc *p)
  * Take the action for the specified signal
  * from the current set of pending signals.
  */
-void
+int
 postsig(sig)
 	register int sig;
 {
@@ -2689,7 +2687,7 @@ postsig(sig)
 	ksiginfo_init(&ksi);
 	if (sigqueue_get(&td->td_sigqueue, sig, &ksi) == 0 &&
 	    sigqueue_get(&p->p_sigqueue, sig, &ksi) == 0)
-		return;
+		return (0);
 	ksi.ksi_signo = sig;
 	if (ksi.ksi_code == SI_TIMER)
 		itimer_accept(p, ksi.ksi_timerid, &ksi);
@@ -2757,6 +2755,7 @@ postsig(sig)
 		}
 		(*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask);
 	}
+	return (1);
 }
 
 /*

Modified: head/sys/sys/signalvar.h
==============================================================================
--- head/sys/sys/signalvar.h	Tue Nov 10 11:43:07 2009	(r199135)
+++ head/sys/sys/signalvar.h	Tue Nov 10 11:46:53 2009	(r199136)
@@ -330,7 +330,7 @@ void	gsignal(int pgid, int sig);
 void	killproc(struct proc *p, char *why);
 void	pgsigio(struct sigio **, int signum, int checkctty);
 void	pgsignal(struct pgrp *pgrp, int sig, int checkctty);
-void	postsig(int sig);
+int	postsig(int sig);
 void	psignal(struct proc *p, int sig);
 int	psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *);
 struct sigacts *sigacts_alloc(void);

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 11:50:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF6B3106566C;
	Tue, 10 Nov 2009 11:50:37 +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 BEDB18FC1D;
	Tue, 10 Nov 2009 11:50:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAABobe7058141;
	Tue, 10 Nov 2009 11:50:37 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAABobP6058139;
	Tue, 10 Nov 2009 11:50:37 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200911101150.nAABobP6058139@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 10 Nov 2009 11:50:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199137 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 11:50:37 -0000

Author: kib
Date: Tue Nov 10 11:50:37 2009
New Revision: 199137
URL: http://svn.freebsd.org/changeset/base/199137

Log:
  When rename("a", "b/.") is performed, target namei() call returns
  dvp == vp. Rename syscall does not check for the case, and at least
  ufs_rename() cannot deal with it. POSIX explicitely requires that both
  rename(2) and rmdir(2) return EINVAL when any of the pathes end in "/.".
  
  Detect the slashdot lookup for RENAME or REMOVE in lookup(), and return
  EINVAL.
  
  Reported by:	Jim Meyering 
  Tested by:	simon, pho
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Tue Nov 10 11:46:53 2009	(r199136)
+++ head/sys/kern/vfs_lookup.c	Tue Nov 10 11:50:37 2009	(r199137)
@@ -552,6 +552,12 @@ dirloop:
 	else
 		cnp->cn_flags &= ~ISLASTCN;
 
+	if ((cnp->cn_flags & ISLASTCN) != 0 &&
+	    cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.' &&
+	    (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
+		error = EINVAL;
+		goto bad;
+	}
 
 	/*
 	 * Check for degenerate name (e.g. / or "")

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 12:08:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 719601065692;
	Tue, 10 Nov 2009 12:08:51 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com
	[209.85.218.213])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D3E98FC1A;
	Tue, 10 Nov 2009 12:08:50 +0000 (UTC)
Received: by bwz5 with SMTP id 5so4619237bwz.3
	for ; Tue, 10 Nov 2009 04:08:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:subject:mime-version
	:content-type:from:in-reply-to:date:cc:content-transfer-encoding
	:message-id:references:to:x-mailer;
	bh=AMNEVZWxg5ME+vWyk7ijT8ft6GN8BR92Vso79me2IHw=;
	b=CCraDQ035y7b9ldWIuH/Kzx5V51hRnS43FsWAw/sE8QF4NR/jT2qNbYcGlTysQMtdr
	MlA7eOQAToyq2RTmiZu0HlEcroR4xoh1lM+rHrndLB1I/B6tWDHsRUKx6GoJT6o1t7pI
	CjR2oNyK1xJXAVhEAsjBv8LMzssjgck8tx4Aw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=dm8KEJCibe/XOBaC7gxRJTHj6LJP+/4W21A1C5tw2ID9abMjxby7IM7WtGHW2P9U1T
	FzV60dzGgANm6Y9ZcbopMZGsCeueyObpOzEDXlVzYFmAONL+3FM/w/Ef7JQkqOkr6yQE
	rJrn31zl1lCuOXeI2sJVCxH01tSRs2xYRia2c=
Received: by 10.204.155.82 with SMTP id r18mr1504054bkw.180.1257854929183;
	Tue, 10 Nov 2009 04:08:49 -0800 (PST)
Received: from mac-mini.lan (bl5-227-167.dsl.telepac.pt [82.154.227.167])
	by mx.google.com with ESMTPS id 16sm189866bwz.3.2009.11.10.04.08.45
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Tue, 10 Nov 2009 04:08:46 -0800 (PST)
Sender: Rui Paulo 
Mime-Version: 1.0 (Apple Message framework v1077)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <7mvdhigb96.wl%kuriyama@s2factory.co.jp>
Date: Tue, 10 Nov 2009 12:08:44 +0000
Content-Transfer-Encoding: 7bit
Message-Id: <38E7F3F6-0660-43BF-B3A9-8E62E337BE78@freebsd.org>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
	<7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
	<20091110055910.GC64905@hoeg.nl>
	<7mvdhigb96.wl%kuriyama@s2factory.co.jp>
To: Jun Kuriyama 
X-Mailer: Apple Mail (2.1077)
Cc: svn-src-head@freebsd.org, Ed Schouten ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 12:08:51 -0000

On 10 Nov 2009, at 06:11, Jun Kuriyama wrote:
> Hmm, I think Boot Camp is not hypervisor, and should be treated as
> real hardware.

Correct.

--
Rui Paulo


From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 14:32:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6612D106566B;
	Tue, 10 Nov 2009 14:32: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 3B7618FC17;
	Tue, 10 Nov 2009 14:32: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 nAAEWAXP062106;
	Tue, 10 Nov 2009 14:32:10 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAEWATF062105;
	Tue, 10 Nov 2009 14:32:10 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200911101432.nAAEWATF062105@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 10 Nov 2009 14:32: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: r199141 - in head: tools/regression/usr.bin/pkill
	tools/tools/termcap usr.sbin/dumpcis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 14:32:10 -0000

Author: jhb
Date: Tue Nov 10 14:32:09 2009
New Revision: 199141
URL: http://svn.freebsd.org/changeset/base/199141

Log:
  Purge some useless mergeinfo.

Modified:
Directory Properties:
  head/tools/regression/usr.bin/pkill/pgrep-_g.t   (props changed)
  head/tools/regression/usr.bin/pkill/pgrep-_s.t   (props changed)
  head/tools/regression/usr.bin/pkill/pkill-_g.t   (props changed)
  head/tools/tools/termcap/termcap.pl   (props changed)
  head/usr.sbin/dumpcis/cardinfo.h   (props changed)
  head/usr.sbin/dumpcis/cis.h   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 16:03:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9636D1065672;
	Tue, 10 Nov 2009 16:03:01 +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 31CCD8FC08;
	Tue, 10 Nov 2009 16:03:01 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 424A11CCF3; Tue, 10 Nov 2009 17:03:00 +0100 (CET)
Date: Tue, 10 Nov 2009 17:03:00 +0100
From: Ed Schouten 
To: Jun Kuriyama 
Message-ID: <20091110160300.GD64905@hoeg.nl>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
	<7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
	<20091110055910.GC64905@hoeg.nl>
	<7mvdhigb96.wl%kuriyama@s2factory.co.jp>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="6Nae48J/T25AfBN4"
Content-Disposition: inline
In-Reply-To: <7mvdhigb96.wl%kuriyama@s2factory.co.jp>
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: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 16:03:01 -0000


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

Hi Jun,

* Jun Kuriyama  wrote:
> You can try with hw.clflush_disable=3D"1" in loader.conf.  If you can
> boot with it, I must be mistaken something (anyway its my fault).

For some reason that switch doesn't seem to have any effect. Reverting the
patch makes my system boot again.

> Can you show me CPUID line at boot message (of course from the kernel
> you can boot) like this?

Sure. These two systems seem to lock up:

Apple MacBook3,1:

| CPU: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz (2194.52-MHz K8-clas=
s CPU)
|   Origin =3D "GenuineIntel"  Id =3D 0x6fb  Stepping =3D 11
|   Features=3D0xbfebfbff
|   Features2=3D0xe3bd
|   AMD Features=3D0x20100800
|   AMD Features2=3D0x1
|   TSC: P-state invariant

Dell SC440:

| CPU: Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz (1795.51-MHz K8-clas=
s CPU)
|   Origin =3D "GenuineIntel"  Id =3D 0x6fd  Stepping =3D 13
|   Features=3D0xbfebfbff
|   Features2=3D0xe39d
|   AMD Features=3D0x20100800
|   AMD Features2=3D0x1
|   TSC: P-state invariant

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--6Nae48J/T25AfBN4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr5jrQACgkQ52SDGA2eCwWySgCfcpEtdZNmDxcNypqZYP3v2pDF
cOMAmwTX4SWpDBFq4sB97cSeXoGhhFM1
=M0ji
-----END PGP SIGNATURE-----

--6Nae48J/T25AfBN4--

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 16:38:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC3E51065676;
	Tue, 10 Nov 2009 16:38:34 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout027.mac.com (asmtpout027.mac.com [17.148.16.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 95A8A8FC1E;
	Tue, 10 Nov 2009 16:38:34 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp027.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KSW00K3XJK8CJ30@asmtp027.mac.com>; Tue,
	10 Nov 2009 08:38:34 -0800 (PST)
From: Marcel Moolenaar 
In-reply-to: <200911101146.nAABksqs058013@svn.freebsd.org>
Date: Tue, 10 Nov 2009 08:38:32 -0800
Message-id: <87148C88-A068-4512-845C-F72FE190F4B5@mac.com>
References: <200911101146.nAABksqs058013@svn.freebsd.org>
To: Konstantin Belousov 
X-Mailer: Apple Mail (2.1077)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199136 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 16:38:34 -0000


On Nov 10, 2009, at 3:46 AM, Konstantin Belousov wrote:

>  Also, for ia64, due to different registers layout for those two kind of
>  frames, usermode sigsegfaulted when returned from signal handler.

Actually, the problem was caused by sigsuspend() returning EINTR,
which causes the trapframe to be updated with the error code and
thereby clobbering the same registers in the trapframe that are
used for hand-off to the signal handler. The kernel was jumping
to the signal handler at address 4 (=EINTR).

In any case: thanks for your exemplary co-operation in resolving
the issue!

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 16:45:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C3F3106566C;
	Tue, 10 Nov 2009 16:45:24 +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 BDF338FC16;
	Tue, 10 Nov 2009 16:45:23 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nAAGdksd023894;
	Tue, 10 Nov 2009 09:39:46 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Tue, 10 Nov 2009 09:39:56 -0700 (MST)
Message-Id: <20091110.093956.2069119515.imp@bsdimp.com>
To: nwhitehorn@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <4AF85D75.1010605@freebsd.org>
References: <200911091139.nA9BdpAU019880@svn.freebsd.org>
	<4AF85D75.1010605@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, mav@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r199079 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 16:45:24 -0000

In message: <4AF85D75.1010605@freebsd.org>
            Nathan Whitehorn  writes:
: Alexander Motin wrote:
: > Author: mav
: > Date: Mon Nov  9 11:39:51 2009
: > New Revision: 199079
: > URL: http://svn.freebsd.org/changeset/base/199079
: >
: > Log:
: >   Add support for ATA Power Management.
: >
: > Modified:
: >   head/sbin/camcontrol/camcontrol.8
: >   head/sbin/camcontrol/camcontrol.c
: >   
: [...]
: > +static int
: > +atapm(struct cam_device *device, int argc, char **argv,
: > +		 char *combinedopt, int retry_count, int timeout)
: > +{
: > +	union ccb *ccb;
: > +	int retval = 0;
: > +	int t = -1;
: > +	char c;
: >
: >   
: [...]
: > +
: > +	while ((c = getopt(argc, argv, combinedopt)) != -1) {
: > +		switch (c) {
: > +		case 't':
: > +			t = atoi(optarg);
: > +			break;
: > +		default:
: > +			break;
: > +		}
: > +	}
: This broke world on PowerPC, where char is unsigned. Could you change 
: the type of c to int, or explicitly mark it signed?

Since it is the result of getopt, it must be int.  It can't be signed
char.

Warner

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 19:14:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7913106566B;
	Tue, 10 Nov 2009 19:14:06 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 956DA8FC12;
	Tue, 10 Nov 2009 19:14:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAAJE669069111;
	Tue, 10 Nov 2009 19:14:06 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAJE6RW069109;
	Tue, 10 Nov 2009 19:14:06 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200911101914.nAAJE6RW069109@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Tue, 10 Nov 2009 19:14:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199151 - head/sys/dev/usb/input
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 19:14:06 -0000

Author: nwhitehorn
Date: Tue Nov 10 19:14:06 2009
New Revision: 199151
URL: http://svn.freebsd.org/changeset/base/199151

Log:
  Add support for the touchpads found in later models of iBook and
  Powerbook.
  
  Reviewed by:	Rohit Grover 

Modified:
  head/sys/dev/usb/input/atp.c

Modified: head/sys/dev/usb/input/atp.c
==============================================================================
--- head/sys/dev/usb/input/atp.c	Tue Nov 10 17:45:54 2009	(r199150)
+++ head/sys/dev/usb/input/atp.c	Tue Nov 10 19:14:06 2009	(r199151)
@@ -193,21 +193,50 @@ SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan
     &atp_pspan_max_width, 4,
     "maximum allowed width (in sensors) for pressure-spans");
 
+/* We support three payload protocols */
+typedef enum {
+	ATP_PROT_GEYSER1,
+	ATP_PROT_GEYSER2,
+	ATP_PROT_GEYSER3,
+} atp_protocol;
 
 /* Define the various flavours of devices supported by this driver. */
 enum {
 	ATP_DEV_PARAMS_0,
+	ATP_DEV_PARAMS_PBOOK,
+	ATP_DEV_PARAMS_PBOOK_15A,
+	ATP_DEV_PARAMS_PBOOK_17,
 	ATP_N_DEV_PARAMS
 };
 struct atp_dev_params {
 	u_int            data_len;   /* for sensor data */
 	u_int            n_xsensors;
 	u_int            n_ysensors;
+	atp_protocol     prot;
 } atp_dev_params[ATP_N_DEV_PARAMS] = {
 	[ATP_DEV_PARAMS_0] = {
 		.data_len   = 64,
 		.n_xsensors = 20,
-		.n_ysensors = 10
+		.n_ysensors = 10,
+		.prot       = ATP_PROT_GEYSER3
+	},
+	[ATP_DEV_PARAMS_PBOOK] = {
+		.data_len   = 81,
+		.n_xsensors = 16,
+		.n_ysensors = 16,
+		.prot       = ATP_PROT_GEYSER1
+	},
+	[ATP_DEV_PARAMS_PBOOK_15A] = {
+		.data_len   = 64,
+		.n_xsensors = 15,
+		.n_ysensors = 9,
+		.prot       = ATP_PROT_GEYSER2
+	},
+	[ATP_DEV_PARAMS_PBOOK_17] = {
+		.data_len   = 81,
+		.n_xsensors = 26,
+		.n_ysensors = 16,
+		.prot       = ATP_PROT_GEYSER1
 	},
 };
 
@@ -226,6 +255,19 @@ static const struct usb_device_id atp_de
 	{ USB_VPI(USB_VENDOR_APPLE, 0x0229, ATP_DEV_PARAMS_0) },
 	{ USB_VPI(USB_VENDOR_APPLE, 0x022a, ATP_DEV_PARAMS_0) },
 	{ USB_VPI(USB_VENDOR_APPLE, 0x022b, ATP_DEV_PARAMS_0) },
+
+	/* 12 inch PowerBook and iBook */
+	{ USB_VPI(USB_VENDOR_APPLE, 0x030a, ATP_DEV_PARAMS_PBOOK) },
+	{ USB_VPI(USB_VENDOR_APPLE, 0x030b, ATP_DEV_PARAMS_PBOOK) },
+
+	/* 15 inch PowerBook */
+	{ USB_VPI(USB_VENDOR_APPLE, 0x020e, ATP_DEV_PARAMS_PBOOK) },
+	{ USB_VPI(USB_VENDOR_APPLE, 0x020f, ATP_DEV_PARAMS_PBOOK) },
+	{ USB_VPI(USB_VENDOR_APPLE, 0x0215, ATP_DEV_PARAMS_PBOOK_15A) },
+
+	/* 17 inch PowerBook */
+	{ USB_VPI(USB_VENDOR_APPLE, 0x020d, ATP_DEV_PARAMS_PBOOK_17) },
+
 };
 
 /*
@@ -321,6 +363,7 @@ struct atp_softc {
 #define ATP_ENABLED            0x01
 #define ATP_ZOMBIES_EXIST      0x02
 #define ATP_DOUBLE_TAP_DRAG    0x04
+#define ATP_VALID              0x08
 
 	u_int                  sc_left_margin;
 	u_int                  sc_right_margin;
@@ -384,8 +427,8 @@ static int           atp_softc_populate(
 static void          atp_softc_unpopulate(struct atp_softc *);
 
 /* sensor interpretation */
-static __inline void atp_interpret_sensor_data(const int8_t *, u_int, u_int,
-			 int *);
+static __inline void atp_interpret_sensor_data(const int8_t *, u_int, atp_axis,
+			 int *, atp_protocol);
 static __inline void atp_get_pressures(int *, const int *, const int *, int);
 static void          atp_detect_pspans(int *, u_int, u_int, atp_pspan *,
 			 u_int *);
@@ -483,7 +526,7 @@ atp_disable(struct atp_softc *sc)
 {
 	atp_softc_unpopulate(sc);
 
-	sc->sc_state &= ~ATP_ENABLED;
+	sc->sc_state &= ~(ATP_ENABLED | ATP_VALID);
 	DPRINTFN(ATP_LLEVEL_INFO, "disabled atp\n");
 }
 
@@ -623,25 +666,42 @@ atp_softc_unpopulate(struct atp_softc *s
  *       raw sensor data from the USB packet.
  *   num
  *       The number of elements in the array 'arr'.
- *   di_start
- *       The index of the first data element to be interpreted for
- *       this sensor array--i.e. when called to interpret the Y
- *       sensors, di_start passed in as 2, which is the index of Y1 in
- *       the raw data.
+ *   axis
+ *       Axis of data to fetch
  *   arr
  *       The array to be initialized with the readings.
+ *   prot
+ *       The protocol to use to interpret the data
  */
 static __inline void
-atp_interpret_sensor_data(const int8_t *sensor_data, u_int num, u_int di_start,
-    int	*arr)
+atp_interpret_sensor_data(const int8_t *sensor_data, u_int num, atp_axis axis,
+    int	*arr, atp_protocol prot)
 {
 	u_int i;
 	u_int di;   /* index into sensor data */
 
-	for (i = 0, di = di_start; i < num; /* empty */ ) {
-		arr[i++] = sensor_data[di++];
-		arr[i++] = sensor_data[di++];
-		di++;
+	switch (prot) {
+	case ATP_PROT_GEYSER1:
+		/*
+		 * For Geyser 1, the sensors are laid out in pairs
+		 * every 5 bytes.
+		 */
+		for (i = 0, di = (axis == Y) ? 1 : 2; i < 8; di += 5, i++) {
+			arr[i] = sensor_data[di];
+			arr[i+8] = sensor_data[di+2];
+			if (axis == X && num > 16) 
+				arr[i+16] = sensor_data[di+40];
+		}
+
+		break;
+	case ATP_PROT_GEYSER2:
+	case ATP_PROT_GEYSER3:
+		for (i = 0, di = (axis == Y) ? 2 : 20; i < num; /* empty */ ) {
+			arr[i++] = sensor_data[di++];
+			arr[i++] = sensor_data[di++];
+			di++;
+		}
+		break;
 	}
 }
 
@@ -1613,7 +1673,7 @@ atp_intr(struct usb_xfer *xfer, usb_erro
 			    len, sc->sc_params->data_len);
 			len = sc->sc_params->data_len;
 		}
-		if (len == 0)
+		if (len < sc->sc_params->data_len)
 			goto tr_setup;
 
 		pc = usbd_xfer_get_frame(xfer, 0);
@@ -1621,9 +1681,11 @@ atp_intr(struct usb_xfer *xfer, usb_erro
 
 		/* Interpret sensor data */
 		atp_interpret_sensor_data(sc->sensor_data,
-		    sc->sc_params->n_xsensors, 20, sc->cur_x);
+		    sc->sc_params->n_xsensors, X, sc->cur_x,
+		    sc->sc_params->prot);
 		atp_interpret_sensor_data(sc->sensor_data,
-		    sc->sc_params->n_ysensors, 2,  sc->cur_y);
+		    sc->sc_params->n_ysensors, Y,  sc->cur_y,
+		    sc->sc_params->prot);
 
 		/*
 		 * If this is the initial update (from an untouched
@@ -1632,11 +1694,14 @@ atp_intr(struct usb_xfer *xfer, usb_erro
 		 * be used as pressure readings subsequently.
 		 */
 		status_bits = sc->sensor_data[sc->sc_params->data_len - 1];
-		if (status_bits & ATP_STATUS_BASE_UPDATE) {
+		if ((sc->sc_params->prot == ATP_PROT_GEYSER3 &&
+		    (status_bits & ATP_STATUS_BASE_UPDATE)) || 
+		    !(sc->sc_state & ATP_VALID)) {
 			memcpy(sc->base_x, sc->cur_x,
 			    sc->sc_params->n_xsensors * sizeof(*(sc->base_x)));
 			memcpy(sc->base_y, sc->cur_y,
 			    sc->sc_params->n_ysensors * sizeof(*(sc->base_y)));
+			sc->sc_state |= ATP_VALID;
 			goto tr_setup;
 		}
 
@@ -1757,8 +1822,11 @@ atp_intr(struct usb_xfer *xfer, usb_erro
 			sc->sc_idlecount++;
 			if (sc->sc_idlecount >= ATP_IDLENESS_THRESHOLD) {
 				DPRINTFN(ATP_LLEVEL_INFO, "idle\n");
-				atp_set_device_mode(sc->sc_dev,RAW_SENSOR_MODE);
 				sc->sc_idlecount = 0;
+
+				mtx_unlock(&sc->sc_mutex);
+				atp_set_device_mode(sc->sc_dev,RAW_SENSOR_MODE);
+				mtx_lock(&sc->sc_mutex);
 			}
 		} else {
 			sc->sc_idlecount = 0;
@@ -1770,7 +1838,7 @@ atp_intr(struct usb_xfer *xfer, usb_erro
 		if (usb_fifo_put_bytes_max(
 			    sc->sc_fifo.fp[USB_FIFO_RX]) != 0) {
 			usbd_xfer_set_frame_len(xfer, 0,
-			    usbd_xfer_max_len(xfer));
+			    sc->sc_params->data_len);
 			usbd_transfer_submit(xfer);
 		}
 		break;

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 19:50:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 514E0106566C;
	Tue, 10 Nov 2009 19:50:29 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 409C88FC0C;
	Tue, 10 Nov 2009 19:50: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 nAAJoSRj069982;
	Tue, 10 Nov 2009 19:50:28 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAJoSVL069980;
	Tue, 10 Nov 2009 19:50:28 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200911101950.nAAJoSVL069980@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 10 Nov 2009 19:50: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: r199152 - head/share/man/man5
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 19:50:29 -0000

Author: dougb
Date: Tue Nov 10 19:50:28 2009
New Revision: 199152
URL: http://svn.freebsd.org/changeset/base/199152

Log:
  s/a default/the default/
  
  Submitted by:	remko

Modified:
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Tue Nov 10 19:14:06 2009	(r199151)
+++ head/share/man/man5/rc.conf.5	Tue Nov 10 19:50:28 2009	(r199152)
@@ -352,7 +352,7 @@ If
 is used to set the hostname via DHCP,
 this variable should be set to an empty string.
 If this value remains unset when the system is done booting
-your console login will display a default hostname of
+your console login will display the default hostname of
 .Dq Amnesiac.
 .It Va nisdomainname
 .Pq Vt str

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 20:29:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 320E41065679;
	Tue, 10 Nov 2009 20:29:21 +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 214458FC0A;
	Tue, 10 Nov 2009 20:29: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 nAAKTKpR070785;
	Tue, 10 Nov 2009 20:29:20 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAKTKI3070783;
	Tue, 10 Nov 2009 20:29:20 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200911102029.nAAKTKI3070783@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Tue, 10 Nov 2009 20:29: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: r199153 - head/sys/dev/bge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 20:29:21 -0000

Author: yongari
Date: Tue Nov 10 20:29:20 2009
New Revision: 199153
URL: http://svn.freebsd.org/changeset/base/199153

Log:
  Controller does not update Tx descriptors(send BDs) after sending
  frames so remove unnecessary BUS_DMASYNC_PREREAD and
  BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Tue Nov 10 19:50:28 2009	(r199152)
+++ head/sys/dev/bge/if_bge.c	Tue Nov 10 20:29:20 2009	(r199153)
@@ -1165,8 +1165,7 @@ bge_init_tx_ring(struct bge_softc *sc)
 
 	bzero(sc->bge_ldata.bge_tx_ring, BGE_TX_RING_SZ);
 	bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
-	    sc->bge_cdata.bge_tx_ring_map,
-	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	    sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE);
 
 	/* Initialize transmit producer index for host-memory send ring. */
 	sc->bge_tx_prodidx = 0;
@@ -3323,8 +3322,7 @@ bge_txeof(struct bge_softc *sc)
 	ifp = sc->bge_ifp;
 
 	bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
-	    sc->bge_cdata.bge_tx_ring_map,
-	    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+	    sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_POSTWRITE);
 	/*
 	 * Go through our tx ring and free mbufs for those
 	 * frames that have been sent.
@@ -3834,8 +3832,7 @@ bge_start_locked(struct ifnet *ifp)
 		return;
 
 	bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
-	    sc->bge_cdata.bge_tx_ring_map,
-	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	    sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE);
 	/* Transmit. */
 	bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx);
 	/* 5700 b2 errata */

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 22:04:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3C77A1065697;
	Tue, 10 Nov 2009 22:04:20 +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 2160F8FC17;
	Tue, 10 Nov 2009 22:04: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 nAAM4KpT072961;
	Tue, 10 Nov 2009 22:04:20 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAM4KgB072959;
	Tue, 10 Nov 2009 22:04:20 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200911102204.nAAM4KgB072959@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 10 Nov 2009 22:04: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: r199154 - head/sys/dev/an
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 22:04:20 -0000

Author: jhb
Date: Tue Nov 10 22:04:19 2009
New Revision: 199154
URL: http://svn.freebsd.org/changeset/base/199154

Log:
  - Locking fixes to not do silly things like drop the lock only to call a
    function that immediately reacquires the lock.  Also removes recursive
    locking.
  - Use the statistics timer to drive the transmit watchdog instead of using
    if_watchdog and if_timer.
  
  Tested by:	gavin

Modified:
  head/sys/dev/an/if_an.c
  head/sys/dev/an/if_anreg.h

Modified: head/sys/dev/an/if_an.c
==============================================================================
--- head/sys/dev/an/if_an.c	Tue Nov 10 20:29:20 2009	(r199153)
+++ head/sys/dev/an/if_an.c	Tue Nov 10 22:04:19 2009	(r199154)
@@ -140,9 +140,11 @@ static void an_reset(struct an_softc *);
 static int an_init_mpi350_desc(struct an_softc *);
 static int an_ioctl(struct ifnet *, u_long, caddr_t);
 static void an_init(void *);
+static void an_init_locked(struct an_softc *);
 static int an_init_tx_ring(struct an_softc *);
 static void an_start(struct ifnet *);
-static void an_watchdog(struct ifnet *);
+static void an_start_locked(struct ifnet *);
+static void an_watchdog(struct an_softc *);
 static void an_rxeof(struct an_softc *);
 static void an_txeof(struct an_softc *, int);
 
@@ -314,7 +316,7 @@ an_pci_probe(device_t dev)
 	struct an_softc *sc = device_get_softc(dev);
 
 	mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
-	    MTX_DEF | MTX_RECURSE);
+	    MTX_DEF);
 
 	return(0);
 }
@@ -359,7 +361,7 @@ an_probe(device_t dev)
 	CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), 0xFFFF);
 
 	mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
-	    MTX_DEF | MTX_RECURSE);
+	    MTX_DEF);
 	AN_LOCK(sc);
 	an_reset(sc);
 
@@ -766,7 +768,6 @@ an_attach(struct an_softc *sc, int flags
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = an_ioctl;
 	ifp->if_start = an_start;
-	ifp->if_watchdog = an_watchdog;
 	ifp->if_init = an_init;
 	ifp->if_baudrate = 10000000;
 	IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
@@ -1130,7 +1131,7 @@ an_txeof(struct an_softc *sc, int status
 	AN_LOCK_ASSERT(sc);
 	ifp = sc->an_ifp;
 
-	ifp->if_timer = 0;
+	sc->an_timer = 0;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
 	if (!sc->mpi350) {
@@ -1183,6 +1184,8 @@ an_stats_update(void *xsc)
 	sc = xsc;
 	AN_LOCK_ASSERT(sc);
 	ifp = sc->an_ifp;
+	if (sc->an_timer > 0 && --sc->an_timer == 0)
+		an_watchdog(sc);
 
 	sc->an_status.an_type = AN_RID_STATUS;
 	sc->an_status.an_len = sizeof(struct an_ltv_status);
@@ -1274,7 +1277,7 @@ an_intr(void *xsc)
 	CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
 
 	if ((ifp->if_flags & IFF_UP) && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		an_start(ifp);
+		an_start_locked(ifp);
 
 	AN_UNLOCK(sc);
 
@@ -1825,9 +1828,7 @@ an_setdef(struct an_softc *sc, struct an
 	case AN_RID_WEP_PERM:
 	case AN_RID_LEAPUSERNAME:
 	case AN_RID_LEAPPASSWORD:
-		AN_UNLOCK(sc);
-		an_init(sc);
-		AN_LOCK(sc);
+		an_init_locked(sc);
 
 		/* Disable the MAC. */
 		an_cmd(sc, AN_CMD_DISABLE, 0);
@@ -1868,11 +1869,8 @@ an_setdef(struct an_softc *sc, struct an
 
 
 	/* Reinitialize the card. */
-	if (ifp->if_flags) {
-		AN_UNLOCK(sc);
-		an_init(sc);
-		AN_LOCK(sc);
-	}
+	if (ifp->if_flags)
+		an_init_locked(sc);
 
 	return;
 }
@@ -1890,11 +1888,8 @@ an_promisc(struct an_softc *sc, int prom
 		if (sc->mpi350)
 			an_init_mpi350_desc(sc);
 	}
-	if (sc->an_monitor || sc->an_was_monitor) {
-		AN_UNLOCK(sc);
-		an_init(sc);
-		AN_LOCK(sc);
-	}
+	if (sc->an_monitor || sc->an_was_monitor)
+		an_init_locked(sc);
 
 	sc->an_was_monitor = sc->an_monitor;
 	an_cmd(sc, AN_CMD_SET_MODE, promisc ? 0xffff : 0);
@@ -1948,20 +1943,14 @@ an_ioctl(struct ifnet *ifp, u_long comma
 			    !(ifp->if_flags & IFF_PROMISC) &&
 			    sc->an_if_flags & IFF_PROMISC) {
 				an_promisc(sc, 0);
-			} else {
-				AN_UNLOCK(sc);
-				an_init(sc);
-				AN_LOCK(sc);
-			}
+			} else
+				an_init_locked(sc);
 		} else {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				AN_UNLOCK(sc);
+			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
 				an_stop(sc);
-				AN_LOCK(sc);
-			}
 		}
-		AN_UNLOCK(sc);
 		sc->an_if_flags = ifp->if_flags;
+		AN_UNLOCK(sc);
 		error = 0;
 		break;
 	case SIOCSIFMEDIA:
@@ -2485,7 +2474,6 @@ an_ioctl(struct ifnet *ifp, u_long comma
 				AN_UNLOCK(sc);
 				break;
 			}
-			AN_UNLOCK(sc);
 			if (ireq->i_val ==  4) {
 				config->an_home_product |= AN_HOME_NETWORK;
 				ireq->i_val = 0;
@@ -2497,10 +2485,9 @@ an_ioctl(struct ifnet *ifp, u_long comma
 				= config->an_home_product;
 
 			/* update configuration */
-			an_init(sc);
+			an_init_locked(sc);
 
 			bzero(&sc->areq, sizeof(struct an_ltv_key));
-			AN_LOCK(sc);
 			sc->areq.an_len = sizeof(struct an_ltv_key);
 			sc->areq.an_type = AN_RID_WEP_PERM;
 			key->kindex = 0xffff;
@@ -2583,6 +2570,9 @@ an_ioctl(struct ifnet *ifp, u_long comma
 			an_setdef(sc, &sc->areq);
 			AN_UNLOCK(sc);
 			break;
+		default:
+			AN_UNLOCK(sc);
+			break;
 		}
 
 		/*
@@ -2632,14 +2622,21 @@ static void
 an_init(void *xsc)
 {
 	struct an_softc		*sc = xsc;
-	struct ifnet		*ifp = sc->an_ifp;
 
 	AN_LOCK(sc);
+	an_init_locked(sc);
+	AN_UNLOCK(sc);
+}
 
-	if (sc->an_gone) {
-		AN_UNLOCK(sc);
+static void
+an_init_locked(struct an_softc *sc)
+{
+	struct ifnet *ifp;
+
+	AN_LOCK_ASSERT(sc);
+	ifp = sc->an_ifp;
+	if (sc->an_gone)
 		return;
-	}
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
 		an_stop(sc);
@@ -2653,7 +2650,6 @@ an_init(void *xsc)
 			an_init_mpi350_desc(sc);
 		if (an_init_tx_ring(sc)) {
 			if_printf(ifp, "tx buffer allocation failed\n");
-			AN_UNLOCK(sc);
 			return;
 		}
 	}
@@ -2694,7 +2690,6 @@ an_init(void *xsc)
 	sc->an_ssidlist.an_len = sizeof(struct an_ltv_ssidlist_new);
 	if (an_write_record(sc, (struct an_ltv_gen *)&sc->an_ssidlist)) {
 		if_printf(ifp, "failed to set ssid list\n");
-		AN_UNLOCK(sc);
 		return;
 	}
 
@@ -2703,7 +2698,6 @@ an_init(void *xsc)
 	sc->an_aplist.an_len = sizeof(struct an_ltv_aplist);
 	if (an_write_record(sc, (struct an_ltv_gen *)&sc->an_aplist)) {
 		if_printf(ifp, "failed to set AP list\n");
-		AN_UNLOCK(sc);
 		return;
 	}
 
@@ -2712,14 +2706,12 @@ an_init(void *xsc)
 	sc->an_config.an_type = AN_RID_GENCONFIG;
 	if (an_write_record(sc, (struct an_ltv_gen *)&sc->an_config)) {
 		if_printf(ifp, "failed to set configuration\n");
-		AN_UNLOCK(sc);
 		return;
 	}
 
 	/* Enable the MAC */
 	if (an_cmd(sc, AN_CMD_ENABLE, 0)) {
 		if_printf(ifp, "failed to enable MAC\n");
-		AN_UNLOCK(sc);
 		return;
 	}
 
@@ -2733,7 +2725,6 @@ an_init(void *xsc)
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
 	callout_reset(&sc->an_stat_ch, hz, an_stats_update, sc);
-	AN_UNLOCK(sc);
 
 	return;
 }
@@ -2742,6 +2733,17 @@ static void
 an_start(struct ifnet *ifp)
 {
 	struct an_softc		*sc;
+
+	sc = ifp->if_softc;
+	AN_LOCK(sc);
+	an_start_locked(ifp);
+	AN_UNLOCK(sc);
+}
+
+static void
+an_start_locked(struct ifnet *ifp)
+{
+	struct an_softc		*sc;
 	struct mbuf		*m0 = NULL;
 	struct an_txframe_802_3	tx_frame_802_3;
 	struct ether_header	*eh;
@@ -2752,6 +2754,7 @@ an_start(struct ifnet *ifp)
 
 	sc = ifp->if_softc;
 
+	AN_LOCK_ASSERT(sc);
 	if (sc->an_gone)
 		return;
 
@@ -2774,7 +2777,6 @@ an_start(struct ifnet *ifp)
 
 	idx = sc->an_rdata.an_tx_prod;
 
-	AN_LOCK(sc);
 	if (!sc->mpi350) {
 		bzero((char *)&tx_frame_802_3, sizeof(tx_frame_802_3));
 
@@ -2832,7 +2834,7 @@ an_start(struct ifnet *ifp)
 			/*
 			 * Set a timeout in case the chip goes out to lunch.
 			 */
-			ifp->if_timer = 5;
+			sc->an_timer = 5;
 		}
 	} else { /* MPI-350 */
 		/* Disable interrupts. */
@@ -2909,13 +2911,12 @@ an_start(struct ifnet *ifp)
 			/*
 			 * Set a timeout in case the chip goes out to lunch.
 			 */
-			ifp->if_timer = 5;
+			sc->an_timer = 5;
 		}
 
 		/* Re-enable interrupts. */
 		CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
 	}
-	AN_UNLOCK(sc);
 
 	if (m0 != NULL)
 		ifp->if_drv_flags |= IFF_DRV_OACTIVE;
@@ -2931,12 +2932,10 @@ an_stop(struct an_softc *sc)
 	struct ifnet		*ifp;
 	int			i;
 
-	AN_LOCK(sc);
+	AN_LOCK_ASSERT(sc);
 
-	if (sc->an_gone) {
-		AN_UNLOCK(sc);
+	if (sc->an_gone)
 		return;
-	}
 
 	ifp = sc->an_ifp;
 
@@ -2955,36 +2954,27 @@ an_stop(struct an_softc *sc)
 		free(sc->an_flash_buffer, M_DEVBUF);
 		sc->an_flash_buffer = NULL;
 	}
-
-	AN_UNLOCK(sc);
-
-	return;
 }
 
 static void
-an_watchdog(struct ifnet *ifp)
+an_watchdog(struct an_softc *sc)
 {
-	struct an_softc		*sc;
+	struct ifnet *ifp;
 
-	sc = ifp->if_softc;
-	AN_LOCK(sc);
+	AN_LOCK_ASSERT(sc);
 
-	if (sc->an_gone) {
-		AN_UNLOCK(sc);
+	if (sc->an_gone)
 		return;
-	}
 
+	ifp = sc->an_ifp;
 	if_printf(ifp, "device timeout\n");
 
 	an_reset(sc);
 	if (sc->mpi350)
 		an_init_mpi350_desc(sc);
-	AN_UNLOCK(sc);
-	an_init(sc);
+	an_init_locked(sc);
 
 	ifp->if_oerrors++;
-
-	return;
 }
 
 int
@@ -2993,10 +2983,12 @@ an_shutdown(device_t dev)
 	struct an_softc		*sc;
 
 	sc = device_get_softc(dev);
+	AN_LOCK(sc);
 	an_stop(sc);
 	sc->an_gone = 1;
+	AN_UNLOCK(sc);
 
-	return 0;
+	return (0);
 }
 
 void
@@ -3014,7 +3006,7 @@ an_resume(device_t dev)
 	an_reset(sc);
 	if (sc->mpi350)
 		an_init_mpi350_desc(sc);
-	an_init(sc);
+	an_init_locked(sc);
 
 	/* Recovery temporary keys */
 	for (i = 0; i < 4; i++) {
@@ -3026,7 +3018,7 @@ an_resume(device_t dev)
 	}
 
 	if (ifp->if_flags & IFF_UP)
-		an_start(ifp);
+		an_start_locked(ifp);
 	AN_UNLOCK(sc);
 
 	return;
@@ -3251,12 +3243,12 @@ an_media_change(struct ifnet *ifp)
 	int otype = sc->an_config.an_opmode;
 	int orate = sc->an_tx_rate;
 
+	AN_LOCK(sc);
 	sc->an_tx_rate = ieee80211_media2rate(
 		IFM_SUBTYPE(sc->an_ifmedia.ifm_cur->ifm_media));
 	if (sc->an_tx_rate < 0)
 		sc->an_tx_rate = 0;
 
-	AN_LOCK(sc);
 	if (orate != sc->an_tx_rate) {
 		/* Read the current configuration */
 		sc->an_config.an_type = AN_RID_GENCONFIG;
@@ -3277,11 +3269,11 @@ an_media_change(struct ifnet *ifp)
 		sc->an_config.an_opmode &= ~AN_OPMODE_INFRASTRUCTURE_STATION;
 	else
 		sc->an_config.an_opmode |= AN_OPMODE_INFRASTRUCTURE_STATION;
-	AN_UNLOCK(sc);
 
 	if (otype != sc->an_config.an_opmode ||
 	    orate != sc->an_tx_rate)
-		an_init(sc);
+		an_init_locked(sc);
+	AN_UNLOCK(sc);
 
 	return(0);
 }
@@ -3302,7 +3294,6 @@ an_media_status(struct ifnet *ifp, struc
 		imr->ifm_active = sc->an_ifmedia.ifm_cur->ifm_media;
 		imr->ifm_status = IFM_AVALID|IFM_ACTIVE;
 	}
-	AN_UNLOCK(sc);
 
 	if (sc->an_tx_rate == 0) {
 		imr->ifm_active = IFM_IEEE80211|IFM_AUTO;
@@ -3315,6 +3306,7 @@ an_media_status(struct ifnet *ifp, struc
 	imr->ifm_status = IFM_AVALID;
 	if (status.an_opmode & AN_STATUS_OPMODE_ASSOCIATED)
 		imr->ifm_status |= IFM_ACTIVE;
+	AN_UNLOCK(sc);
 }
 
 /********************** Cisco utility support routines *************/
@@ -3559,9 +3551,9 @@ cmdreset(struct ifnet *ifp)
 	int		status;
 	struct an_softc	*sc = ifp->if_softc;
 
+	AN_LOCK(sc);
 	an_stop(sc);
 
-	AN_LOCK(sc);
 	an_cmd(sc, AN_CMD_DISABLE, 0);
 
 	if (!(status = WaitBusy(ifp, AN_TIMEOUT))) {
@@ -3749,9 +3741,7 @@ flashrestart(struct ifnet *ifp)
 
 	FLASH_DELAY(sc, 1024);		/* Added 12/7/00 */
 
-	AN_UNLOCK(sc);
-	an_init(sc);
-	AN_LOCK(sc);
+	an_init_locked(sc);
 
 	FLASH_DELAY(sc, 1024);		/* Added 12/7/00 */
 	return status;

Modified: head/sys/dev/an/if_anreg.h
==============================================================================
--- head/sys/dev/an/if_anreg.h	Tue Nov 10 20:29:20 2009	(r199153)
+++ head/sys/dev/an/if_anreg.h	Tue Nov 10 22:04:19 2009	(r199154)
@@ -489,6 +489,7 @@ struct an_softc	{
 	struct ifmedia		an_ifmedia;
 	int		        an_monitor;
 	int		        an_was_monitor;
+	int			an_timer;
 	u_char			buf_802_11[MCLBYTES];
 	struct an_req		areq;
 	unsigned short*		an_flash_buffer;

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 22:07:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7676106568B;
	Tue, 10 Nov 2009 22:07:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D7B8D8FC08;
	Tue, 10 Nov 2009 22:07:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAAM7bWb073063;
	Tue, 10 Nov 2009 22:07:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAM7bS5073061;
	Tue, 10 Nov 2009 22:07:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200911102207.nAAM7bS5073061@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 10 Nov 2009 22:07:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199155 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 22:07:38 -0000

Author: jhb
Date: Tue Nov 10 22:07:37 2009
New Revision: 199155
URL: http://svn.freebsd.org/changeset/base/199155

Log:
  Add ixgb(4) to NOTES.
  
  Approved by:	jfv

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Tue Nov 10 22:04:19 2009	(r199154)
+++ head/sys/conf/NOTES	Tue Nov 10 22:07:37 2009	(r199155)
@@ -2003,6 +2003,7 @@ device		bwi		# Broadcom BCM430* BCM431*
 device		de		# DEC/Intel DC21x4x (``Tulip'')
 device		em		# Intel Pro/1000 Gigabit Ethernet
 device		igb		# Intel Pro/1000 PCIE Gigabit Ethernet
+device		ixgb		# Intel Pro/10Gbe PCI-X Ethernet
 device		ixgbe		# Intel Pro/10Gbe PCIE Ethernet
 device		le		# AMD Am7900 LANCE and Am79C9xx PCnet
 device		mxge		# Myricom Myri-10G 10GbE NIC

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 22:25:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7BFB9106568D;
	Tue, 10 Nov 2009 22:25:46 +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 6B2858FC2D;
	Tue, 10 Nov 2009 22:25:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAAMPkTe073524;
	Tue, 10 Nov 2009 22:25:46 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAMPkpP073522;
	Tue, 10 Nov 2009 22:25:46 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <200911102225.nAAMPkpP073522@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 10 Nov 2009 22:25:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199156 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 22:25:46 -0000

Author: pjd
Date: Tue Nov 10 22:25:46 2009
New Revision: 199156
URL: http://svn.freebsd.org/changeset/base/199156

Log:
  Avoid passing invalid mountpoint to getnewvnode().
  
  Reported by:	rwatson
  Tested by:	rwatson
  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	Tue Nov 10 22:07:37 2009	(r199155)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Tue Nov 10 22:25:46 2009	(r199156)
@@ -143,16 +143,19 @@ zfs_znode_cache_constructor(void *buf, v
 
 	POINTER_INVALIDATE(&zp->z_zfsvfs);
 	ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs));
-	ASSERT(vfsp != NULL);
 
-	error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp);
-	if (error != 0 && (kmflags & KM_NOSLEEP))
-		return (-1);
-	ASSERT(error == 0);
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-	zp->z_vnode = vp;
-	vp->v_data = (caddr_t)zp;
-	VN_LOCK_AREC(vp);
+	if (vfsp != NULL) {
+		error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp);
+		if (error != 0 && (kmflags & KM_NOSLEEP))
+			return (-1);
+		ASSERT(error == 0);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+		zp->z_vnode = vp;
+		vp->v_data = (caddr_t)zp;
+		VN_LOCK_AREC(vp);
+	} else {
+		zp->z_vnode = NULL;
+	}
 
 	list_link_init(&zp->z_link_node);
 
@@ -1435,7 +1438,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, 
 	nvpair_t	*elem;
 	int		error;
 	znode_t		*rootzp = NULL;
-	vnode_t		*vp;
+	vnode_t		vnode;
 	vattr_t		vattr;
 	znode_t		*zp;
 
@@ -1504,13 +1507,13 @@ zfs_create_fs(objset_t *os, cred_t *cr, 
 	vattr.va_gid = crgetgid(cr);
 
 	rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP);
-	zfs_znode_cache_constructor(rootzp, &zfsvfs, 0);
+	zfs_znode_cache_constructor(rootzp, NULL, 0);
 	rootzp->z_unlinked = 0;
 	rootzp->z_atime_dirty = 0;
 
-	vp = ZTOV(rootzp);
-	vp->v_type = VDIR;
-	VN_LOCK_ASHARE(vp);
+	vnode.v_type = VDIR;
+	vnode.v_data = rootzp;
+	rootzp->z_vnode = &vnode;
 
 	bzero(&zfsvfs, sizeof (zfsvfs_t));
 
@@ -1539,16 +1542,10 @@ zfs_create_fs(objset_t *os, cred_t *cr, 
 	ASSERT(error == 0);
 	POINTER_INVALIDATE(&rootzp->z_zfsvfs);
 
-	VI_LOCK(vp);
-	ZTOV(rootzp)->v_data = NULL;
-	ZTOV(rootzp)->v_count = 0;
-	ZTOV(rootzp)->v_holdcnt = 0;
-	rootzp->z_vnode = NULL;
-	VOP_UNLOCK(vp, 0);
-	vdestroy(vp);
 	dmu_buf_rele(rootzp->z_dbuf, NULL);
 	rootzp->z_dbuf = NULL;
 	mutex_destroy(&zfsvfs.z_znodes_lock);
+	rootzp->z_vnode = NULL;
 	kmem_cache_free(znode_cache, rootzp);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Nov 10 22:27:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 808C51065672;
	Tue, 10 Nov 2009 22:27:33 +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 701258FC2E;
	Tue, 10 Nov 2009 22:27: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 nAAMRXJh073605;
	Tue, 10 Nov 2009 22:27:33 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAAMRXTf073603;
	Tue, 10 Nov 2009 22:27:33 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <200911102227.nAAMRXTf073603@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 10 Nov 2009 22:27: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: r199157 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 10 Nov 2009 22:27:33 -0000

Author: pjd
Date: Tue Nov 10 22:27:33 2009
New Revision: 199157
URL: http://svn.freebsd.org/changeset/base/199157

Log:
  Be careful which vattr fields are set during setattr replay.
  Without this fix strange things can appear after unclean shutdown like
  files with mode set to 07777.
  
  Reported by:	des
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c	Tue Nov 10 22:25:46 2009	(r199156)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c	Tue Nov 10 22:27:33 2009	(r199157)
@@ -60,10 +60,14 @@ zfs_init_vattr(vattr_t *vap, uint64_t ma
 {
 	VATTR_NULL(vap);
 	vap->va_mask = (uint_t)mask;
-	vap->va_type = IFTOVT(mode);
-	vap->va_mode = mode & MODEMASK;
-	vap->va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid;
-	vap->va_gid = (gid_t)(IS_EPHEMERAL(gid)) ? -1 : gid;
+	if (mask & AT_TYPE)
+		vap->va_type = IFTOVT(mode);
+	if (mask & AT_MODE)
+		vap->va_mode = mode & MODEMASK;
+	if (mask & AT_UID)
+		vap->va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid;
+	if (mask & AT_GID)
+		vap->va_gid = (gid_t)(IS_EPHEMERAL(gid)) ? -1 : gid;
 	vap->va_rdev = zfs_cmpldev(rdev);
 	vap->va_nodeid = nodeid;
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 02:39:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 068F0106566C;
	Wed, 11 Nov 2009 02:39:21 +0000 (UTC)
	(envelope-from kuriyama@FreeBSD.org)
Received: from scarlet.imgsrc.co.jp (scarlet.imgsrc.co.jp [202.235.195.9])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C9D48FC1C;
	Wed, 11 Nov 2009 02:39:20 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by scarlet.imgsrc.co.jp (Postfix) with ESMTP id 3F8FB678CD;
	Wed, 11 Nov 2009 11:39:19 +0900 (JST)
X-Virus-Scanned: IMG SRC scanner at mail.imgsrc.co.jp (scarlet)
Received: from scarlet.imgsrc.co.jp ([127.0.0.1])
	by localhost (scarlet.imgsrc.co.jp [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id vogpp4tPEet7; Wed, 11 Nov 2009 11:39:19 +0900 (JST)
Received: from cebu.s2factory.co.jp (corsica.s2factory.co.jp [122.220.15.114])
	by scarlet.imgsrc.co.jp (Postfix) with ESMTP id EE0C9678C6;
	Wed, 11 Nov 2009 11:39:18 +0900 (JST)
Date: Wed, 11 Nov 2009 11:39:18 +0900
Message-ID: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
From: Jun Kuriyama 
To: Ed Schouten 
In-Reply-To: <20091110160300.GD64905@hoeg.nl>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
	<20091109225244.GB64905@hoeg.nl>
	<7mbpjbgt0n.wl%kuriyama@s2factory.co.jp>
	<20091110055910.GC64905@hoeg.nl>
	<7mvdhigb96.wl%kuriyama@s2factory.co.jp>
	<20091110160300.GD64905@hoeg.nl>
User-Agent: Wanderlust/2.14.0 (Africa) Emacs/23.1 Mule/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: multipart/mixed; boundary="Multipart_Wed_Nov_11_11:39:18_2009-1"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 02:39:21 -0000

--Multipart_Wed_Nov_11_11:39:18_2009-1
Content-Type: text/plain; charset=US-ASCII

At Tue, 10 Nov 2009 17:03:00 +0100,
ed@80386.nl wrote:
> > You can try with hw.clflush_disable="1" in loader.conf.  If you can
> > boot with it, I must be mistaken something (anyway its my fault).
> 
> For some reason that switch doesn't seem to have any effect.

Okay, something wrong...

> Apple MacBook3,1:
> |   Features=0xbfebfbff
> 
> Dell SC440:
> |   Features=0xbfebfbff

Both system has CLFUSH and SS, so CLFLUSH tweak should not executed.

Can you test with these patches?  Testing on only one of both system
is enough.  "patch-1" forces disabling CLFLUSH feature even if SS bit
exists.  "patch-2" forces no CLFLUSH tweak.  I'd like to know with
which patch your system can live.


-- 
Jun Kuriyama  // FreeBSD Project
          // S2 Factory, Inc.

--Multipart_Wed_Nov_11_11:39:18_2009-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="patch-1"
Content-Transfer-Encoding: 7bit

Index: initcpu.c
===================================================================
--- initcpu.c	(revision 199067)
+++ initcpu.c	(working copy)
@@ -176,16 +176,20 @@
 	 * XXXKIB: (temporary) hack to work around traps generated when
 	 * CLFLUSHing APIC registers window.
 	 */
+#if 0
 	TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable);
 	if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) &&
 	    hw_clflush_disable == -1)
+#endif
 		cpu_feature &= ~CPUID_CLFSH;
 	/*
 	 * Allow to disable CLFLUSH feature manually by
 	 * hw.clflush_disable tunable.  This may help Xen guest on some AMD
 	 * CPUs.
 	 */
+#if 0
 	if (hw_clflush_disable == 1) {
 		cpu_feature &= ~CPUID_CLFSH;
 	}
+#endif
 }

--Multipart_Wed_Nov_11_11:39:18_2009-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="patch-2"
Content-Transfer-Encoding: 7bit

Index: initcpu.c
===================================================================
--- initcpu.c	(revision 199067)
+++ initcpu.c	(working copy)
@@ -176,16 +176,20 @@
 	 * XXXKIB: (temporary) hack to work around traps generated when
 	 * CLFLUSHing APIC registers window.
 	 */
+#if 0
 	TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable);
 	if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) &&
 	    hw_clflush_disable == -1)
 		cpu_feature &= ~CPUID_CLFSH;
+#endif
 	/*
 	 * Allow to disable CLFLUSH feature manually by
 	 * hw.clflush_disable tunable.  This may help Xen guest on some AMD
 	 * CPUs.
 	 */
+#if 0
 	if (hw_clflush_disable == 1) {
 		cpu_feature &= ~CPUID_CLFSH;
 	}
+#endif
 }

--Multipart_Wed_Nov_11_11:39:18_2009-1--

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 03:17:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 240E01065672;
	Wed, 11 Nov 2009 03:17:52 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ECB368FC08;
	Wed, 11 Nov 2009 03:17: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 nAB3HpEA080938;
	Wed, 11 Nov 2009 03:17:51 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB3HpZ3080934;
	Wed, 11 Nov 2009 03:17:51 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200911110317.nAB3HpZ3080934@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 11 Nov 2009 03:17: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: r199169 - head/sys/dev/usb/input
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 03:17:52 -0000

Author: nwhitehorn
Date: Wed Nov 11 03:17:51 2009
New Revision: 199169
URL: http://svn.freebsd.org/changeset/base/199169

Log:
  Reduce probe priority of USB input devices to BUS_PROBE_GENERIC from
  BUS_PROBE_SPECIFIC. This allows device-specific drivers like atp to
  attach reliably.
  
  Reviewed by:	hps

Modified:
  head/sys/dev/usb/input/uhid.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c

Modified: head/sys/dev/usb/input/uhid.c
==============================================================================
--- head/sys/dev/usb/input/uhid.c	Wed Nov 11 02:25:27 2009	(r199168)
+++ head/sys/dev/usb/input/uhid.c	Wed Nov 11 03:17:51 2009	(r199169)
@@ -633,7 +633,7 @@ uhid_probe(device_t dev)
 	if (usb_test_quirk(uaa, UQ_HID_IGNORE)) {
 		return (ENXIO);
 	}
-	return (0);
+	return (BUS_PROBE_GENERIC);
 }
 
 static int

Modified: head/sys/dev/usb/input/ukbd.c
==============================================================================
--- head/sys/dev/usb/input/ukbd.c	Wed Nov 11 02:25:27 2009	(r199168)
+++ head/sys/dev/usb/input/ukbd.c	Wed Nov 11 03:17:51 2009	(r199169)
@@ -749,7 +749,7 @@ ukbd_probe(device_t dev)
 		if (usb_test_quirk(uaa, UQ_KBD_IGNORE))
 			return (ENXIO);
 		else
-			return (0);
+			return (BUS_PROBE_GENERIC);
 	}
 
 	error = usbd_req_get_hid_desc(uaa->device, NULL,
@@ -771,7 +771,7 @@ ukbd_probe(device_t dev)
 		if (usb_test_quirk(uaa, UQ_KBD_IGNORE))
 			error = ENXIO;
 		else
-			error = 0;
+			error = BUS_PROBE_GENERIC;
 	} else
 		error = ENXIO;
 

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Wed Nov 11 02:25:27 2009	(r199168)
+++ head/sys/dev/usb/input/ums.c	Wed Nov 11 03:17:51 2009	(r199169)
@@ -375,7 +375,7 @@ ums_probe(device_t dev)
 
 	if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
 	    (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))
-		return (0);
+		return (BUS_PROBE_GENERIC);
 
 	error = usbd_req_get_hid_desc(uaa->device, NULL,
 	    &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
@@ -385,7 +385,7 @@ ums_probe(device_t dev)
 
 	if (hid_is_collection(d_ptr, d_len,
 	    HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
-		error = 0;
+		error = BUS_PROBE_GENERIC;
 	else
 		error = ENXIO;
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 08:11:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5AA70106566B;
	Wed, 11 Nov 2009 08:11:22 +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 49F638FC08;
	Wed, 11 Nov 2009 08:11: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 nAB8BMb7086883;
	Wed, 11 Nov 2009 08:11:22 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB8BMxv086882;
	Wed, 11 Nov 2009 08:11:22 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911110811.nAB8BMxv086882@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 11 Nov 2009 08:11: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: r199170 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 08:11:22 -0000

Author: ed
Date: Wed Nov 11 08:11:21 2009
New Revision: 199170
URL: http://svn.freebsd.org/changeset/base/199170

Log:
  Always home the cursor when changing the scrolling region.
  
  I thought this only had to be done when in origin mode, to ensure that
  the cursor is not placed outside the origin, but it seems this is also
  done when not in origin mode.
  
  This fixes some artifacts when pressing ^L while running irssi in tmux.
  (Almost) nobody noticed this, because cons25 doesn't have scrolling
  regions.

Modified:
  head/sys/teken/teken_subr.h

Modified: head/sys/teken/teken_subr.h
==============================================================================
--- head/sys/teken/teken_subr.h	Wed Nov 11 03:17:51 2009	(r199169)
+++ head/sys/teken/teken_subr.h	Wed Nov 11 08:11:21 2009	(r199170)
@@ -1237,16 +1237,17 @@ teken_subr_set_top_and_bottom_margins(te
 		bottom = t->t_winsize.tp_row;
 	}
 
+	/* Apply scrolling region. */
 	t->t_scrollreg.ts_begin = top;
 	t->t_scrollreg.ts_end = bottom;
-	if (t->t_stateflags & TS_ORIGIN) {
-		/* XXX: home cursor? */
+	if (t->t_stateflags & TS_ORIGIN)
 		t->t_originreg = t->t_scrollreg;
-		t->t_cursor.tp_row = t->t_originreg.ts_begin;
-		t->t_cursor.tp_col = 0;
-		t->t_stateflags &= ~TS_WRAPPED;
-		teken_funcs_cursor(t);
-	}
+
+	/* Home cursor to the top left of the scrolling region. */
+	t->t_cursor.tp_row = t->t_originreg.ts_begin;
+	t->t_cursor.tp_col = 0;
+	t->t_stateflags &= ~TS_WRAPPED;
+	teken_funcs_cursor(t);
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 08:20:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E420106566B;
	Wed, 11 Nov 2009 08:20:20 +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 F07088FC17;
	Wed, 11 Nov 2009 08:20: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 nAB8KJO0087100;
	Wed, 11 Nov 2009 08:20:19 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB8KJeu087092;
	Wed, 11 Nov 2009 08:20:19 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911110820.nAB8KJeu087092@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 11 Nov 2009 08:20: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: r199171 - in head/sys: dev/syscons pc98/cbus teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 08:20:20 -0000

Author: ed
Date: Wed Nov 11 08:20:19 2009
New Revision: 199171
URL: http://svn.freebsd.org/changeset/base/199171

Log:
  Allow Syscons terminal emulators to provide function key strings.
  
  xterm and cons25 have some incompatibilities when it comes to escape
  sequences for special keys, such as F1 to F12, home, end, etc. Add a new
  te_fkeystr() that can be used to override the strings.
  
  scterm-sck won't do anything with this, but scterm-teken will use
  teken_get_sequences() to obtain the proper sequence.

Modified:
  head/sys/dev/syscons/scterm-teken.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/syscons.h
  head/sys/pc98/cbus/scterm-sck.c
  head/sys/teken/teken.c
  head/sys/teken/teken.h
  head/sys/teken/teken_subr.h

Modified: head/sys/dev/syscons/scterm-teken.c
==============================================================================
--- head/sys/dev/syscons/scterm-teken.c	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/dev/syscons/scterm-teken.c	Wed Nov 11 08:20:19 2009	(r199171)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #if defined(__sparc64__) || defined(__powerpc__)
 #include 
@@ -52,14 +53,15 @@ __FBSDID("$FreeBSD$");
 static void scteken_revattr(unsigned char, teken_attr_t *);
 static unsigned int scteken_attr(const teken_attr_t *);
 
-static sc_term_init_t	scteken_init;
-static sc_term_term_t	scteken_term;
-static sc_term_puts_t	scteken_puts;
-static sc_term_ioctl_t	scteken_ioctl;
-static sc_term_default_attr_t scteken_default_attr;
-static sc_term_clear_t	scteken_clear;
-static sc_term_input_t	scteken_input;
-static void		scteken_nop(void);
+static sc_term_init_t		scteken_init;
+static sc_term_term_t		scteken_term;
+static sc_term_puts_t		scteken_puts;
+static sc_term_ioctl_t		scteken_ioctl;
+static sc_term_default_attr_t	scteken_default_attr;
+static sc_term_clear_t		scteken_clear;
+static sc_term_input_t		scteken_input;
+static sc_term_fkeystr_t	scteken_fkeystr;
+static void			scteken_nop(void);
 
 typedef struct {
 	teken_t		ts_teken;
@@ -84,6 +86,7 @@ static sc_term_sw_t sc_term_scteken = {
 	scteken_clear,
 	(sc_term_notify_t *)scteken_nop,
 	scteken_input,
+	scteken_fkeystr,
 };
 
 SCTERM_MODULE(scteken, sc_term_scteken);
@@ -241,6 +244,56 @@ scteken_input(scr_stat *scp, int c, stru
 	return FALSE;
 }
 
+static const char *
+scteken_fkeystr(scr_stat *scp, int c)
+{
+	teken_stat *ts = scp->ts;
+	unsigned int k;
+
+	switch (c) {
+	case FKEY | F(1):  case FKEY | F(2):  case FKEY | F(3):
+	case FKEY | F(4):  case FKEY | F(5):  case FKEY | F(6):
+	case FKEY | F(7):  case FKEY | F(8):  case FKEY | F(9):
+	case FKEY | F(10): case FKEY | F(11): case FKEY | F(12):
+		k = TKEY_F1 + c - (FKEY | F(1));
+		break;
+	case FKEY | F(49):
+		k = TKEY_HOME;
+		break;
+	case FKEY | F(50):
+		k = TKEY_UP;
+		break;
+	case FKEY | F(51):
+		k = TKEY_PAGE_UP;
+		break;
+	case FKEY | F(53):
+		k = TKEY_LEFT;
+		break;
+	case FKEY | F(55):
+		k = TKEY_RIGHT;
+		break;
+	case FKEY | F(57):
+		k = TKEY_END;
+		break;
+	case FKEY | F(58):
+		k = TKEY_DOWN;
+		break;
+	case FKEY | F(59):
+		k = TKEY_PAGE_DOWN;
+		break;
+	case FKEY | F(60):
+		k = TKEY_INSERT;
+		break;
+	case FKEY | F(61):
+		k = TKEY_DELETE;
+		break;
+	default:
+		return (NULL);
+	}
+
+	return (teken_get_sequence(&ts->ts_teken, k));
+}
+
 static void
 scteken_nop(void)
 {

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/dev/syscons/syscons.c	Wed Nov 11 08:20:19 2009	(r199171)
@@ -625,7 +625,7 @@ sckbdevent(keyboard_t *thiskbd, int even
     struct tty *cur_tty;
     int c, error = 0; 
     size_t len;
-    u_char *cp;
+    const u_char *cp;
 
     sc = (sc_softc_t *)arg;
     /* assert(thiskbd == sc->kbd) */
@@ -664,6 +664,11 @@ sckbdevent(keyboard_t *thiskbd, int even
 	    ttydisc_rint(cur_tty, KEYCHAR(c), 0);
 	    break;
 	case FKEY:  /* function key, return string */
+	    cp = (*sc->cur_scp->tsw->te_fkeystr)(sc->cur_scp, c);
+	    if (cp != NULL) {
+	    	ttydisc_rint_simple(cur_tty, cp, strlen(cp));
+		break;
+	    }
 	    cp = kbdd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
 	    if (cp != NULL)
 	    	ttydisc_rint_simple(cur_tty, cp, len);
@@ -673,9 +678,7 @@ sckbdevent(keyboard_t *thiskbd, int even
 	    ttydisc_rint(cur_tty, KEYCHAR(c), 0);
 	    break;
 	case BKEY:  /* backtab fixed sequence (esc [ Z) */
-	    ttydisc_rint(cur_tty, 0x1b, 0);
-	    ttydisc_rint(cur_tty, '[', 0);
-	    ttydisc_rint(cur_tty, 'Z', 0);
+	    ttydisc_rint_simple(cur_tty, "\x1B[Z", 3);
 	    break;
 	}
 
@@ -1572,7 +1575,7 @@ sc_cngetc(struct consdev *cd)
     static struct fkeytab fkey;
     static int fkeycp;
     scr_stat *scp;
-    u_char *p;
+    const u_char *p;
     int cur_mode;
     int s = spltty();	/* block sckbdevent and scrn_timer while we poll */
     int c;
@@ -1621,6 +1624,13 @@ sc_cngetc(struct consdev *cd)
     case 0:	/* normal char */
 	return KEYCHAR(c);
     case FKEY:	/* function key */
+	p = (*scp->tsw->te_fkeystr)(scp, c);
+	if (p != NULL) {
+	    fkey.len = strlen(p);
+	    bcopy(p, fkey.str, fkey.len);
+	    fkeycp = 1;
+	    return fkey.str[0];
+	}
 	p = kbdd_get_fkeystr(scp->sc->kbd, KEYCHAR(c), (size_t *)&fkeycp);
 	fkey.len = fkeycp;
 	if ((p != NULL) && (fkey.len > 0)) {

Modified: head/sys/dev/syscons/syscons.h
==============================================================================
--- head/sys/dev/syscons/syscons.h	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/dev/syscons/syscons.h	Wed Nov 11 08:20:19 2009	(r199171)
@@ -381,6 +381,7 @@ typedef void	sc_term_notify_t(scr_stat *
 #define SC_TE_NOTIFY_VTSWITCH_IN	0
 #define SC_TE_NOTIFY_VTSWITCH_OUT	1
 typedef int	sc_term_input_t(scr_stat *scp, int c, struct tty *tp);
+typedef const char *sc_term_fkeystr_t(scr_stat *scp, int c);
 
 typedef struct sc_term_sw {
 	LIST_ENTRY(sc_term_sw)	link;
@@ -398,6 +399,7 @@ typedef struct sc_term_sw {
 	sc_term_clear_t		*te_clear;
 	sc_term_notify_t	*te_notify;
 	sc_term_input_t		*te_input;
+	sc_term_fkeystr_t	*te_fkeystr;
 } sc_term_sw_t;
 
 #define SCTERM_MODULE(name, sw)					\

Modified: head/sys/pc98/cbus/scterm-sck.c
==============================================================================
--- head/sys/pc98/cbus/scterm-sck.c	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/pc98/cbus/scterm-sck.c	Wed Nov 11 08:20:19 2009	(r199171)
@@ -94,15 +94,16 @@ typedef struct {
 	color_t		dflt_rev_color;		/* default reverse color */
 } term_stat;
 
-static sc_term_init_t	scterm_init;
-static sc_term_term_t	scterm_term;
-static sc_term_puts_t	scterm_puts;
-static sc_term_ioctl_t	scterm_ioctl;
-static sc_term_reset_t	scterm_reset;
+static sc_term_init_t		scterm_init;
+static sc_term_term_t		scterm_term;
+static sc_term_puts_t		scterm_puts;
+static sc_term_ioctl_t		scterm_ioctl;
+static sc_term_reset_t		scterm_reset;
 static sc_term_default_attr_t	scterm_default_attr;
-static sc_term_clear_t	scterm_clear;
-static sc_term_notify_t	scterm_notify;
-static sc_term_input_t	scterm_input;
+static sc_term_clear_t		scterm_clear;
+static sc_term_notify_t		scterm_notify;
+static sc_term_input_t		scterm_input;
+static sc_term_fkeystr_t	scterm_fkeystr;
 
 static sc_term_sw_t sc_term_sc = {
 	{ NULL, NULL },
@@ -120,6 +121,7 @@ static sc_term_sw_t sc_term_sc = {
 	scterm_clear,
 	scterm_notify,
 	scterm_input,
+	scterm_fkeystr,
 };
 
 SCTERM_MODULE(sc, sc_term_sc);
@@ -1191,6 +1193,13 @@ scterm_input(scr_stat *scp, int c, struc
 	return FALSE;
 }
 
+static const char *
+scterm_fkeystr(scr_stat *scp, int c)
+{
+
+	return (NULL);
+}
+
 /*
  * Calculate hardware attributes word using logical attributes mask and
  * hardware colors

Modified: head/sys/teken/teken.c
==============================================================================
--- head/sys/teken/teken.c	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/teken/teken.c	Wed Nov 11 08:20:19 2009	(r199171)
@@ -49,14 +49,15 @@ static FILE *df;
 #endif /* __FreeBSD__ && _KERNEL */
 
 /* Private flags for t_stateflags. */
-#define	TS_FIRSTDIGIT	0x01	/* First numeric digit in escape sequence. */
-#define	TS_INSERT	0x02	/* Insert mode. */
-#define	TS_AUTOWRAP	0x04	/* Autowrap. */
-#define	TS_ORIGIN	0x08	/* Origin mode. */
-#define	TS_WRAPPED	0x10	/* Next character should be printed on col 0. */
-#define	TS_8BIT		0x20	/* UTF-8 disabled. */
-#define	TS_CONS25	0x40	/* cons25 emulation. */
-#define	TS_INSTRING	0x80	/* Inside string. */
+#define	TS_FIRSTDIGIT	0x0001	/* First numeric digit in escape sequence. */
+#define	TS_INSERT	0x0002	/* Insert mode. */
+#define	TS_AUTOWRAP	0x0004	/* Autowrap. */
+#define	TS_ORIGIN	0x0008	/* Origin mode. */
+#define	TS_WRAPPED	0x0010	/* Next character should be printed on col 0. */
+#define	TS_8BIT		0x0020	/* UTF-8 disabled. */
+#define	TS_CONS25	0x0040	/* cons25 emulation. */
+#define	TS_INSTRING	0x0080	/* Inside string. */
+#define	TS_CURSORKEYS	0x0100	/* Cursor keys mode. */
 
 /* Character that blanks a cell. */
 #define	BLANK	' '
@@ -479,4 +480,64 @@ teken_256to8(teken_color_t c)
 	}
 }
 
+static const char * const special_strings_cons25[] = {
+	[TKEY_UP] = "\x1B[A",		[TKEY_DOWN] = "\x1B[B",
+	[TKEY_LEFT] = "\x1B[D",		[TKEY_RIGHT] = "\x1B[C",
+
+	[TKEY_INSERT] = "\x1B[L",	[TKEY_DELETE] = "\x7F",
+	[TKEY_HOME] = "\x1B[H",		[TKEY_END] = "\x1B[F",
+	[TKEY_PAGE_UP] = "\x1B[I",	[TKEY_PAGE_DOWN] = "\x1B[G",
+
+	[TKEY_F1] = "\x1B[M",		[TKEY_F2] = "\x1B[N",
+	[TKEY_F3] = "\x1B[O",		[TKEY_F4] = "\x1B[P",
+	[TKEY_F5] = "\x1B[Q",		[TKEY_F6] = "\x1B[R",
+	[TKEY_F7] = "\x1B[S",		[TKEY_F8] = "\x1B[T",
+	[TKEY_F9] = "\x1B[U",		[TKEY_F10] = "\x1B[V",
+	[TKEY_F11] = "\x1B[W",		[TKEY_F12] = "\x1B[X",
+};
+
+static const char * const special_strings_ckeys[] = {
+	[TKEY_UP] = "\x1BOA",		[TKEY_DOWN] = "\x1BOB",
+	[TKEY_LEFT] = "\x1BOD",		[TKEY_RIGHT] = "\x1BOC",
+
+	[TKEY_HOME] = "\x1BOH",		[TKEY_END] = "\x1BOF",
+};
+
+static const char * const special_strings_normal[] = {
+	[TKEY_UP] = "\x1B[A",		[TKEY_DOWN] = "\x1B[B",
+	[TKEY_LEFT] = "\x1B[D",		[TKEY_RIGHT] = "\x1B[C",
+
+	[TKEY_INSERT] = "\x1B[2~",	[TKEY_DELETE] = "\x1B[3~",
+	[TKEY_HOME] = "\x1B[H",		[TKEY_END] = "\x1B[F",
+	[TKEY_PAGE_UP] = "\x1B[5~",	[TKEY_PAGE_DOWN] = "\x1B[6~",
+
+	[TKEY_F1] = "\x1BOP",		[TKEY_F2] = "\x1BOQ",
+	[TKEY_F3] = "\x1BOR",		[TKEY_F4] = "\x1BOS",
+	[TKEY_F5] = "\x1B[15~",		[TKEY_F6] = "\x1B[17~",
+	[TKEY_F7] = "\x1B[18~",		[TKEY_F8] = "\x1B[19~",
+	[TKEY_F9] = "\x1B[20~",		[TKEY_F10] = "\x1B[21~",
+	[TKEY_F11] = "\x1B[23~",	[TKEY_F12] = "\x1B[24~",
+};
+
+const char *
+teken_get_sequence(teken_t *t, unsigned int k)
+{
+
+	/* Cons25 mode. */
+	if (t->t_stateflags & TS_CONS25 &&
+	    k < sizeof special_strings_cons25 / sizeof(char *))
+		return (special_strings_cons25[k]);
+
+	/* Cursor keys mode. */
+	if (t->t_stateflags & TS_CURSORKEYS &&
+	    k < sizeof special_strings_ckeys / sizeof(char *))
+		return (special_strings_ckeys[k]);
+
+	/* Default xterm sequences. */
+	if (k < sizeof special_strings_normal / sizeof(char *))
+		return (special_strings_normal[k]);
+	
+	return (NULL);
+}
+
 #include "teken_state.h"

Modified: head/sys/teken/teken.h
==============================================================================
--- head/sys/teken/teken.h	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/teken/teken.h	Wed Nov 11 08:20:19 2009	(r199171)
@@ -89,15 +89,14 @@ typedef void tf_fill_t(void *, const tek
 typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *);
 typedef void tf_param_t(void *, int, unsigned int);
 #define	TP_SHOWCURSOR	0
-#define	TP_CURSORKEYS	1
-#define	TP_KEYPADAPP	2
-#define	TP_AUTOREPEAT	3
-#define	TP_SWITCHVT	4
-#define	TP_132COLS	5
-#define	TP_SETBELLPD	6
+#define	TP_KEYPADAPP	1
+#define	TP_AUTOREPEAT	2
+#define	TP_SWITCHVT	3
+#define	TP_132COLS	4
+#define	TP_SETBELLPD	5
 #define	TP_SETBELLPD_PITCH(pd)		((pd) >> 16)
 #define	TP_SETBELLPD_DURATION(pd)	((pd) & 0xffff)
-#define	TP_MOUSE	7
+#define	TP_MOUSE	6
 typedef void tf_respond_t(void *, const void *, size_t);
 
 typedef struct {
@@ -168,6 +167,33 @@ void	teken_set_curattr(teken_t *, const 
 void	teken_set_defattr(teken_t *, const teken_attr_t *);
 void	teken_set_winsize(teken_t *, const teken_pos_t *);
 
+/* Key input escape sequences. */
+#define	TKEY_UP		0x00
+#define	TKEY_DOWN	0x01
+#define	TKEY_LEFT	0x02
+#define	TKEY_RIGHT	0x03
+
+#define	TKEY_INSERT	0x04
+#define	TKEY_DELETE	0x05
+#define	TKEY_HOME	0x06
+#define	TKEY_END	0x07
+#define	TKEY_PAGE_UP	0x08
+#define	TKEY_PAGE_DOWN	0x09
+
+#define	TKEY_F1		0x0a
+#define	TKEY_F2		0x0b
+#define	TKEY_F3		0x0c
+#define	TKEY_F4		0x0d
+#define	TKEY_F5		0x0e
+#define	TKEY_F6		0x0f
+#define	TKEY_F7		0x10
+#define	TKEY_F8		0x11
+#define	TKEY_F9		0x12
+#define	TKEY_F10	0x13
+#define	TKEY_F11	0x14
+#define	TKEY_F12	0x15
+const char *teken_get_sequence(teken_t *, unsigned int);
+
 /* Legacy features. */
 void	teken_set_8bit(teken_t *);
 void	teken_set_cons25(teken_t *);

Modified: head/sys/teken/teken_subr.h
==============================================================================
--- head/sys/teken/teken_subr.h	Wed Nov 11 08:11:21 2009	(r199170)
+++ head/sys/teken/teken_subr.h	Wed Nov 11 08:20:19 2009	(r199171)
@@ -903,7 +903,7 @@ teken_subr_reset_dec_mode(teken_t *t, un
 
 	switch (cmd) {
 	case 1: /* Cursor keys mode. */
-		teken_funcs_param(t, TP_CURSORKEYS, 0);
+		t->t_stateflags &= ~TS_CURSORKEYS;
 		break;
 	case 2: /* DECANM: ANSI/VT52 mode. */
 		teken_printf("DECRST VT52\n");
@@ -1052,7 +1052,7 @@ teken_subr_set_dec_mode(teken_t *t, unsi
 
 	switch (cmd) {
 	case 1: /* Cursor keys mode. */
-		teken_funcs_param(t, TP_CURSORKEYS, 1);
+		t->t_stateflags |= TS_CURSORKEYS;
 		break;
 	case 2: /* DECANM: ANSI/VT52 mode. */
 		teken_printf("DECSET VT52\n");

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 08:28:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B869E106568F;
	Wed, 11 Nov 2009 08:28:18 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E3078FC0C;
	Wed, 11 Nov 2009 08:28: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 nAB8SILA087346;
	Wed, 11 Nov 2009 08:28:18 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB8SI7Z087344;
	Wed, 11 Nov 2009 08:28:18 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911110828.nAB8SI7Z087344@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 11 Nov 2009 08:28: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: r199173 - head/sys/netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 08:28:18 -0000

Author: ume
Date: Wed Nov 11 08:28:18 2009
New Revision: 199173
URL: http://svn.freebsd.org/changeset/base/199173

Log:
  CURVNET_RESTORE() was not called in certain cases.
  
  MFC after:	3 days

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Wed Nov 11 08:27:09 2009	(r199172)
+++ head/sys/netinet6/nd6.c	Wed Nov 11 08:28:18 2009	(r199173)
@@ -582,10 +582,10 @@ nd6_llinfo_timer(void *arg)
 		}
 		break;
 	}
-	CURVNET_RESTORE();
 done:
 	if (ln != NULL)
 		LLE_FREE(ln);
+	CURVNET_RESTORE();
 }
 
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 08:39:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17F22106566C;
	Wed, 11 Nov 2009 08:39:58 +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 E16628FC15;
	Wed, 11 Nov 2009 08:39: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 nAB8dv1O087675;
	Wed, 11 Nov 2009 08:39:57 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB8dvAE087672;
	Wed, 11 Nov 2009 08:39:57 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911110839.nAB8dvAE087672@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 11 Nov 2009 08:39: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: r199174 - head/usr.sbin/vidcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 08:39:58 -0000

Author: ed
Date: Wed Nov 11 08:39:57 2009
New Revision: 199174
URL: http://svn.freebsd.org/changeset/base/199174

Log:
  Add a new flag to vidcontrol, -T, that allows terminal mode switching.
  
  This will make it more easy for people to experiment with TERM=xterm.
  Instead of echoing these strange escape sequences, I can just instruct
  them to run `vidcontrol -T xterm'.

Modified:
  head/usr.sbin/vidcontrol/vidcontrol.1
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/vidcontrol/vidcontrol.1
==============================================================================
--- head/usr.sbin/vidcontrol/vidcontrol.1	Wed Nov 11 08:28:18 2009	(r199173)
+++ head/usr.sbin/vidcontrol/vidcontrol.1	Wed Nov 11 08:39:57 2009	(r199174)
@@ -38,6 +38,7 @@
 .Op Fl r Ar foreground Ar background
 .Op Fl S Cm on | off
 .Op Fl s Ar number
+.Op Fl T Cm xterm | cons25
 .Op Fl t Ar N | Cm off
 .Op Ar mode
 .Op Ar foreground Op Ar background
@@ -243,6 +244,8 @@ is supposed to be physically secure.
 .It Fl s Ar number
 Set the current vty to
 .Ar number .
+.It Fl T Cm xterm | cons25
+Switch between xterm and cons25 style terminal emulation.
 .It Fl t Ar N | Cm off
 Set the screensaver timeout to
 .Ar N

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==============================================================================
--- head/usr.sbin/vidcontrol/vidcontrol.c	Wed Nov 11 08:28:18 2009	(r199173)
+++ head/usr.sbin/vidcontrol/vidcontrol.c	Wed Nov 11 08:39:57 2009	(r199174)
@@ -185,8 +185,8 @@ usage(void)
 "usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]",
 "                  [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]",
 "                  [-M char] [-m on | off] [-r foreground background]",
-"                  [-S on | off] [-s number] [-t N | off] [mode]",
-"                  [foreground [background]] [show]");
+"                  [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]",
+"                  [mode] [foreground [background]] [show]");
 	exit(1);
 }
 
@@ -1159,6 +1159,18 @@ clear_history(void)
 	}
 }
 
+static void
+set_terminal_mode(char *arg)
+{
+
+	if (strcmp(arg, "xterm") == 0)
+		fprintf(stderr, "\033[=T");
+	else if (strcmp(arg, "cons25") == 0)
+		fprintf(stderr, "\033[=1T");
+	else
+		usage();
+}
+
 
 int
 main(int argc, char **argv)
@@ -1175,7 +1187,8 @@ main(int argc, char **argv)
 		err(1, "must be on a virtual console");
 	dumpmod = 0;
 	dumpopt = DUMP_FBF;
-	while((opt = getopt(argc, argv, "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:t:x")) != -1)
+	while ((opt = getopt(argc, argv,
+	    "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
 		switch(opt) {
 		case 'b':
 			set_border_color(optarg);
@@ -1244,6 +1257,9 @@ main(int argc, char **argv)
 		case 's':
 			set_console(optarg);
 			break;
+		case 'T':
+			set_terminal_mode(optarg);
+			break;
 		case 't':
 			set_screensaver_timeout(optarg);
 			break;

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 09:43:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 725421065676;
	Wed, 11 Nov 2009 09:43:26 +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 48C688FC21;
	Wed, 11 Nov 2009 09:43: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 nAB9hQDY088983;
	Wed, 11 Nov 2009 09:43:26 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB9hQde088980;
	Wed, 11 Nov 2009 09:43:26 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911110943.nAB9hQde088980@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 11 Nov 2009 09:43: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: r199175 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 09:43:26 -0000

Author: ed
Date: Wed Nov 11 09:43:26 2009
New Revision: 199175
URL: http://svn.freebsd.org/changeset/base/199175

Log:
  Place home and end before insert and delete.
  
  These keys have different sequences when using cursorkeys, while insert
  and delete stay the same. If they are placed like this, libteken will
  return NULL instead of a proper sequence for these characters.

Modified:
  head/sys/teken/teken.c
  head/sys/teken/teken.h

Modified: head/sys/teken/teken.c
==============================================================================
--- head/sys/teken/teken.c	Wed Nov 11 08:39:57 2009	(r199174)
+++ head/sys/teken/teken.c	Wed Nov 11 09:43:26 2009	(r199175)
@@ -484,8 +484,8 @@ static const char * const special_string
 	[TKEY_UP] = "\x1B[A",		[TKEY_DOWN] = "\x1B[B",
 	[TKEY_LEFT] = "\x1B[D",		[TKEY_RIGHT] = "\x1B[C",
 
-	[TKEY_INSERT] = "\x1B[L",	[TKEY_DELETE] = "\x7F",
 	[TKEY_HOME] = "\x1B[H",		[TKEY_END] = "\x1B[F",
+	[TKEY_INSERT] = "\x1B[L",	[TKEY_DELETE] = "\x7F",
 	[TKEY_PAGE_UP] = "\x1B[I",	[TKEY_PAGE_DOWN] = "\x1B[G",
 
 	[TKEY_F1] = "\x1B[M",		[TKEY_F2] = "\x1B[N",
@@ -507,8 +507,8 @@ static const char * const special_string
 	[TKEY_UP] = "\x1B[A",		[TKEY_DOWN] = "\x1B[B",
 	[TKEY_LEFT] = "\x1B[D",		[TKEY_RIGHT] = "\x1B[C",
 
-	[TKEY_INSERT] = "\x1B[2~",	[TKEY_DELETE] = "\x1B[3~",
 	[TKEY_HOME] = "\x1B[H",		[TKEY_END] = "\x1B[F",
+	[TKEY_INSERT] = "\x1B[2~",	[TKEY_DELETE] = "\x1B[3~",
 	[TKEY_PAGE_UP] = "\x1B[5~",	[TKEY_PAGE_DOWN] = "\x1B[6~",
 
 	[TKEY_F1] = "\x1BOP",		[TKEY_F2] = "\x1BOQ",

Modified: head/sys/teken/teken.h
==============================================================================
--- head/sys/teken/teken.h	Wed Nov 11 08:39:57 2009	(r199174)
+++ head/sys/teken/teken.h	Wed Nov 11 09:43:26 2009	(r199175)
@@ -173,10 +173,10 @@ void	teken_set_winsize(teken_t *, const 
 #define	TKEY_LEFT	0x02
 #define	TKEY_RIGHT	0x03
 
-#define	TKEY_INSERT	0x04
-#define	TKEY_DELETE	0x05
-#define	TKEY_HOME	0x06
-#define	TKEY_END	0x07
+#define	TKEY_HOME	0x04
+#define	TKEY_END	0x05
+#define	TKEY_INSERT	0x06
+#define	TKEY_DELETE	0x07
 #define	TKEY_PAGE_UP	0x08
 #define	TKEY_PAGE_DOWN	0x09
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 10:44:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47EB81065693;
	Wed, 11 Nov 2009 10:44:10 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 369A28FC19;
	Wed, 11 Nov 2009 10:44: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 nABAiAe2092183;
	Wed, 11 Nov 2009 10:44:10 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABAiAvV092181;
	Wed, 11 Nov 2009 10:44:10 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911111044.nABAiAvV092181@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 11 Nov 2009 10:44: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: r199176 - head/sys/dev/ahci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 10:44:10 -0000

Author: mav
Date: Wed Nov 11 10:44:09 2009
New Revision: 199176
URL: http://svn.freebsd.org/changeset/base/199176

Log:
  MFp4:
  Add set of chip IDs, known to support AHCI.

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Wed Nov 11 09:43:26 2009	(r199175)
+++ head/sys/dev/ahci/ahci.c	Wed Nov 11 10:44:09 2009	(r199176)
@@ -96,23 +96,154 @@ static void ahcipoll(struct cam_sim *sim
 
 MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers");
 
-/*
- * AHCI v1.x compliant SATA chipset support functions
- */
+static struct {
+	uint32_t	id;
+	const char	*name;
+	int		flags;
+} ahci_ids[] = {
+	{0x43801002, "ATI IXP600",	0},
+	{0x43901002, "ATI IXP700",	0},
+	{0x43911002, "ATI IXP700",	0},
+	{0x43921002, "ATI IXP700",	0},
+	{0x43931002, "ATI IXP700",	0},
+	{0x43941002, "ATI IXP800",	0},
+	{0x43951002, "ATI IXP800",	0},
+	{0x26528086, "Intel ICH6",	0},
+	{0x26538086, "Intel ICH6M",	0},
+	{0x26818086, "Intel ESB2",	0},
+	{0x26828086, "Intel ESB2",	0},
+	{0x26838086, "Intel ESB2",	0},
+	{0x27c18086, "Intel ICH7",	0},
+	{0x27c38086, "Intel ICH7",	0},
+	{0x27c58086, "Intel ICH7M",	0},
+	{0x27c68086, "Intel ICH7M",	0},
+	{0x28218086, "Intel ICH8",	0},
+	{0x28228086, "Intel ICH8",	0},
+	{0x28248086, "Intel ICH8",	0},
+	{0x28298086, "Intel ICH8M",	0},
+	{0x282a8086, "Intel ICH8M",	0},
+	{0x29228086, "Intel ICH9",	0},
+	{0x29238086, "Intel ICH9",	0},
+	{0x29248086, "Intel ICH9",	0},
+	{0x29258086, "Intel ICH9",	0},
+	{0x29278086, "Intel ICH9",	0},
+	{0x29298086, "Intel ICH9M",	0},
+	{0x292a8086, "Intel ICH9M",	0},
+	{0x292b8086, "Intel ICH9M",	0},
+	{0x292c8086, "Intel ICH9M",	0},
+	{0x292f8086, "Intel ICH9M",	0},
+	{0x294d8086, "Intel ICH9",	0},
+	{0x294e8086, "Intel ICH9M",	0},
+	{0x3a058086, "Intel ICH10",	0},
+	{0x3a228086, "Intel ICH10",	0},
+	{0x3a258086, "Intel ICH10",	0},
+	{0x3b228086, "Intel PCH",	0},
+	{0x3b238086, "Intel PCH",	0},
+	{0x3b248086, "Intel PCH",	0},
+	{0x3b258086, "Intel PCH",	0},
+	{0x3b298086, "Intel PCH",	0},
+	{0x3b2b8086, "Intel PCH",	0},
+	{0x3b2c8086, "Intel PCH",	0},
+	{0x3b2f8086, "Intel PCH",	0},
+	{0x044c10de, "NVIDIA MCP65",	0},
+	{0x044d10de, "NVIDIA MCP65",	0},
+	{0x044e10de, "NVIDIA MCP65",	0},
+	{0x044f10de, "NVIDIA MCP65",	0},
+	{0x045c10de, "NVIDIA MCP65",	0},
+	{0x045d10de, "NVIDIA MCP65",	0},
+	{0x045e10de, "NVIDIA MCP65",	0},
+	{0x045f10de, "NVIDIA MCP65",	0},
+	{0x055010de, "NVIDIA MCP67",	0},
+	{0x055110de, "NVIDIA MCP67",	0},
+	{0x055210de, "NVIDIA MCP67",	0},
+	{0x055310de, "NVIDIA MCP67",	0},
+	{0x055410de, "NVIDIA MCP67",	0},
+	{0x055510de, "NVIDIA MCP67",	0},
+	{0x055610de, "NVIDIA MCP67",	0},
+	{0x055710de, "NVIDIA MCP67",	0},
+	{0x055810de, "NVIDIA MCP67",	0},
+	{0x055910de, "NVIDIA MCP67",	0},
+	{0x055A10de, "NVIDIA MCP67",	0},
+	{0x055B10de, "NVIDIA MCP67",	0},
+	{0x058410de, "NVIDIA MCP67",	0},
+	{0x07f010de, "NVIDIA MCP73",	0},
+	{0x07f110de, "NVIDIA MCP73",	0},
+	{0x07f210de, "NVIDIA MCP73",	0},
+	{0x07f310de, "NVIDIA MCP73",	0},
+	{0x07f410de, "NVIDIA MCP73",	0},
+	{0x07f510de, "NVIDIA MCP73",	0},
+	{0x07f610de, "NVIDIA MCP73",	0},
+	{0x07f710de, "NVIDIA MCP73",	0},
+	{0x07f810de, "NVIDIA MCP73",	0},
+	{0x07f910de, "NVIDIA MCP73",	0},
+	{0x07fa10de, "NVIDIA MCP73",	0},
+	{0x07fb10de, "NVIDIA MCP73",	0},
+	{0x0ad010de, "NVIDIA MCP77",	0},
+	{0x0ad110de, "NVIDIA MCP77",	0},
+	{0x0ad210de, "NVIDIA MCP77",	0},
+	{0x0ad310de, "NVIDIA MCP77",	0},
+	{0x0ad410de, "NVIDIA MCP77",	0},
+	{0x0ad510de, "NVIDIA MCP77",	0},
+	{0x0ad610de, "NVIDIA MCP77",	0},
+	{0x0ad710de, "NVIDIA MCP77",	0},
+	{0x0ad810de, "NVIDIA MCP77",	0},
+	{0x0ad910de, "NVIDIA MCP77",	0},
+	{0x0ada10de, "NVIDIA MCP77",	0},
+	{0x0adb10de, "NVIDIA MCP77",	0},
+	{0x0ab410de, "NVIDIA MCP79",	0},
+	{0x0ab510de, "NVIDIA MCP79",	0},
+	{0x0ab610de, "NVIDIA MCP79",	0},
+	{0x0ab710de, "NVIDIA MCP79",	0},
+	{0x0ab810de, "NVIDIA MCP79",	0},
+	{0x0ab910de, "NVIDIA MCP79",	0},
+	{0x0aba10de, "NVIDIA MCP79",	0},
+	{0x0abb10de, "NVIDIA MCP79",	0},
+	{0x0abc10de, "NVIDIA MCP79",	0},
+	{0x0abd10de, "NVIDIA MCP79",	0},
+	{0x0abe10de, "NVIDIA MCP79",	0},
+	{0x0abf10de, "NVIDIA MCP79",	0},
+	{0x0d8410de, "NVIDIA MCP89",	0},
+	{0x0d8510de, "NVIDIA MCP89",	0},
+	{0x0d8610de, "NVIDIA MCP89",	0},
+	{0x0d8710de, "NVIDIA MCP89",	0},
+	{0x0d8810de, "NVIDIA MCP89",	0},
+	{0x0d8910de, "NVIDIA MCP89",	0},
+	{0x0d8a10de, "NVIDIA MCP89",	0},
+	{0x0d8b10de, "NVIDIA MCP89",	0},
+	{0x0d8c10de, "NVIDIA MCP89",	0},
+	{0x0d8d10de, "NVIDIA MCP89",	0},
+	{0x0d8e10de, "NVIDIA MCP89",	0},
+	{0x0d8f10de, "NVIDIA MCP89",	0},
+	{0x33491106, "VIA VT8251",	0},
+	{0x62871106, "VIA VT8251",	0},
+	{0x11841039, "SiS 966",		0},
+	{0x11851039, "SiS 968",		0},
+	{0x01861039, "SiS 968",		0},
+	{0,	     NULL,		0}
+};
+
 static int
 ahci_probe(device_t dev)
 {
+	char buf[64];
+	int i;
+	uint32_t devid = pci_get_devid(dev);
 
-	/* is this a possible AHCI candidate ? */
+	/* Is this a known AHCI chip? */
+	for (i = 0; ahci_ids[i].id != 0; i++) {
+		if (ahci_ids[i].id == devid) {
+			snprintf(buf, sizeof(buf), "%s AHCI SATA controller",
+			    ahci_ids[i].name);
+			device_set_desc_copy(dev, buf);
+			return (BUS_PROBE_VENDOR);
+		}
+	}
+	/* Is this a possible AHCI candidate? */
 	if (pci_get_class(dev) != PCIC_STORAGE ||
-	    pci_get_subclass(dev) != PCIS_STORAGE_SATA)
+	    pci_get_subclass(dev) != PCIS_STORAGE_SATA ||
+	    pci_get_progif(dev) != PCIP_STORAGE_SATA_AHCI_1_0)
 		return (ENXIO);
-
-	/* is this PCI device flagged as an AHCI compliant chip ? */
-	if (pci_get_progif(dev) != PCIP_STORAGE_SATA_AHCI_1_0)
-		return (ENXIO);
-
-	device_set_desc_copy(dev, "AHCI controller");
+	device_set_desc_copy(dev, "AHCI SATA controller");
 	return (BUS_PROBE_VENDOR);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 11:07:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E70C1065670;
	Wed, 11 Nov 2009 11:07:31 +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 4E6728FC1A;
	Wed, 11 Nov 2009 11:07: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 nABB7VZO092698;
	Wed, 11 Nov 2009 11:07:31 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABB7Vnl092694;
	Wed, 11 Nov 2009 11:07:31 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200911111107.nABB7Vnl092694@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Wed, 11 Nov 2009 11:07: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: r199177 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 11:07:31 -0000

Author: ru
Date: Wed Nov 11 11:07:30 2009
New Revision: 199177
URL: http://svn.freebsd.org/changeset/base/199177

Log:
  Added option NETGRAPH_VLAN.
  
  Submitted by:	pluknet

Modified:
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed Nov 11 10:44:09 2009	(r199176)
+++ head/sys/conf/NOTES	Wed Nov 11 11:07:30 2009	(r199177)
@@ -706,6 +706,7 @@ options 	NETGRAPH_TCPMSS
 options 	NETGRAPH_TEE
 options 	NETGRAPH_UI
 options 	NETGRAPH_VJC
+options 	NETGRAPH_VLAN
 
 # NgATM - Netgraph ATM
 options 	NGATM_ATM

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Nov 11 10:44:09 2009	(r199176)
+++ head/sys/conf/files	Wed Nov 11 11:07:30 2009	(r199177)
@@ -2399,6 +2399,7 @@ netgraph/ng_tcpmss.c		optional netgraph_
 netgraph/ng_tee.c		optional netgraph_tee
 netgraph/ng_tty.c		optional netgraph_tty
 netgraph/ng_vjc.c		optional netgraph_vjc
+netgraph/ng_vlan.c		optional netgraph_vlan
 netinet/accf_data.c		optional accept_filter_data inet
 netinet/accf_dns.c		optional accept_filter_dns inet
 netinet/accf_http.c		optional accept_filter_http inet

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Wed Nov 11 10:44:09 2009	(r199176)
+++ head/sys/conf/options	Wed Nov 11 11:07:30 2009	(r199177)
@@ -497,6 +497,7 @@ NETGRAPH_TEE		opt_netgraph.h
 NETGRAPH_TTY		opt_netgraph.h
 NETGRAPH_UI		opt_netgraph.h
 NETGRAPH_VJC		opt_netgraph.h
+NETGRAPH_VLAN		opt_netgraph.h
 
 # NgATM options
 NGATM_ATM		opt_netgraph.h

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 11:10:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4AE741065670;
	Wed, 11 Nov 2009 11:10:37 +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 394F88FC19;
	Wed, 11 Nov 2009 11:10:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nABBAbMg092814;
	Wed, 11 Nov 2009 11:10:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABBAbHc092802;
	Wed, 11 Nov 2009 11:10:37 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911111110.nABBAbHc092802@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 11 Nov 2009 11:10:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199178 - in head/sys: cam cam/ata cam/scsi dev/ahci
	dev/siis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 11:10:37 -0000

Author: mav
Date: Wed Nov 11 11:10:36 2009
New Revision: 199178
URL: http://svn.freebsd.org/changeset/base/199178

Log:
  MFp4:
  - Move tagged queueing control from ADA to ATA XPT. It allows to control
    device command queue length correctly. First step to support < 32 tags.
  - Limit queue for non-tagged devices by 2 slots for ahci(4) and siis(4).
  - Implement quirk matching for ATA devices.
  - Move xpt_schedule_dev_sendq() from header to source file.
  - Move delayed queue shrinking to the more expected place - element freeing.
  - Remove some SCSIsms in ATA.

Modified:
  head/sys/cam/ata/ata_all.c
  head/sys/cam/ata/ata_all.h
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam.c
  head/sys/cam/cam_ccb.h
  head/sys/cam/cam_xpt.c
  head/sys/cam/cam_xpt_internal.h
  head/sys/cam/scsi/scsi_xpt.c
  head/sys/dev/ahci/ahci.c
  head/sys/dev/siis/siis.c

Modified: head/sys/cam/ata/ata_all.c
==============================================================================
--- head/sys/cam/ata/ata_all.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/ata/ata_all.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -509,3 +509,38 @@ ata_max_mode(struct ata_params *ap, int 
     return (mode);
 }
 
+int
+ata_identify_match(caddr_t identbuffer, caddr_t table_entry)
+{
+	struct scsi_inquiry_pattern *entry;
+	struct ata_params *ident;
+ 
+	entry = (struct scsi_inquiry_pattern *)table_entry;
+	ident = (struct ata_params *)identbuffer;
+
+	if ((cam_strmatch(ident->model, entry->product,
+			  sizeof(ident->model)) == 0)
+	 && (cam_strmatch(ident->revision, entry->revision,
+			  sizeof(ident->revision)) == 0)) {
+		return (0);
+	}
+        return (-1);
+}
+
+int
+ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry)
+{
+	struct scsi_static_inquiry_pattern *entry;
+	struct ata_params *ident;
+ 
+	entry = (struct scsi_static_inquiry_pattern *)table_entry;
+	ident = (struct ata_params *)identbuffer;
+
+	if ((cam_strmatch(ident->model, entry->product,
+			  sizeof(ident->model)) == 0)
+	 && (cam_strmatch(ident->revision, entry->revision,
+			  sizeof(ident->revision)) == 0)) {
+		return (0);
+	}
+        return (-1);
+}

Modified: head/sys/cam/ata/ata_all.h
==============================================================================
--- head/sys/cam/ata/ata_all.h	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/ata/ata_all.h	Wed Nov 11 11:10:36 2009	(r199178)
@@ -114,4 +114,7 @@ int	ata_max_wmode(struct ata_params *ap)
 int	ata_max_umode(struct ata_params *ap);
 int	ata_max_mode(struct ata_params *ap, int mode, int maxmode);
 
+int	ata_identify_match(caddr_t identbuffer, caddr_t table_entry);
+int	ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry);
+
 #endif

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/ata/ata_da.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -122,9 +122,17 @@ struct ada_quirk_entry {
 	ada_quirks quirks;
 };
 
-//static struct ada_quirk_entry ada_quirk_table[] =
-//{
-//};
+static struct ada_quirk_entry ada_quirk_table[] =
+{
+	{
+		/* Default */
+		{
+		  T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
+		  /*vendor*/"*", /*product*/"*", /*revision*/"*"
+		},
+		/*quirks*/0
+	},
+};
 
 static	disk_strategy_t	adastrategy;
 static	dumper_t	adadump;
@@ -618,7 +626,7 @@ adaregister(struct cam_periph *periph, v
 	if (cgd->ident_data.support.command2 & ATA_SUPPORT_FLUSHCACHE)
 		softc->flags |= ADA_FLAG_CAN_FLUSHCACHE;
 	if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ &&
-	    cgd->ident_data.queue >= 31)
+	    cgd->inq_flags & SID_CmdQue)
 		softc->flags |= ADA_FLAG_CAN_NCQ;
 	softc->state = ADA_STATE_NORMAL;
 
@@ -627,12 +635,10 @@ adaregister(struct cam_periph *periph, v
 	/*
 	 * See if this device has any quirks.
 	 */
-//	match = cam_quirkmatch((caddr_t)&cgd->inq_data,
-//			       (caddr_t)ada_quirk_table,
-//			       sizeof(ada_quirk_table)/sizeof(*ada_quirk_table),
-//			       sizeof(*ada_quirk_table), scsi_inquiry_match);
-	match = NULL;
-
+	match = cam_quirkmatch((caddr_t)&cgd->ident_data,
+			       (caddr_t)ada_quirk_table,
+			       sizeof(ada_quirk_table)/sizeof(*ada_quirk_table),
+			       sizeof(*ada_quirk_table), ata_identify_match);
 	if (match != NULL)
 		softc->quirks = ((struct ada_quirk_entry *)match)->quirks;
 	else
@@ -700,11 +706,6 @@ adaregister(struct cam_periph *periph, v
 		dp->secsize, dp->heads,
 		dp->secs_per_track, dp->cylinders);
 	xpt_announce_periph(periph, announce_buf);
-	if (softc->flags & ADA_FLAG_CAN_NCQ) {
-		printf("%s%d: Native Command Queueing enabled\n",
-		       periph->periph_name, periph->unit_number);
-	}
-
 	/*
 	 * Add async callbacks for bus reset and
 	 * bus device reset calls.  I don't bother

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/ata/ata_xpt.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -66,17 +66,12 @@ __FBSDID("$FreeBSD$");
 #include 	/* for xpt_print below */
 #include "opt_cam.h"
 
-struct scsi_quirk_entry {
+struct ata_quirk_entry {
 	struct scsi_inquiry_pattern inq_pat;
 	u_int8_t quirks;
-#define	CAM_QUIRK_NOLUNS	0x01
-#define	CAM_QUIRK_NOSERIAL	0x02
-#define	CAM_QUIRK_HILUNS	0x04
-#define	CAM_QUIRK_NOHILUNS	0x08
-	u_int mintags;
+#define	CAM_QUIRK_MAXTAGS	0x01
 	u_int maxtags;
 };
-#define SCSI_QUIRK(dev)	((struct scsi_quirk_entry *)((dev)->quirk))
 
 static periph_init_t probe_periph_init;
 
@@ -138,7 +133,7 @@ typedef struct {
 	struct cam_periph *periph;
 } probe_softc;
 
-static struct scsi_quirk_entry scsi_quirk_table[] =
+static struct ata_quirk_entry ata_quirk_table[] =
 {
 	{
 		/* Default tagged queuing parameters for all devices */
@@ -146,12 +141,12 @@ static struct scsi_quirk_entry scsi_quir
 		  T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
 		  /*vendor*/"*", /*product*/"*", /*revision*/"*"
 		},
-		/*quirks*/0, /*mintags*/2, /*maxtags*/32
+		/*quirks*/0, /*maxtags*/0
 	},
 };
 
-static const int scsi_quirk_table_size =
-	sizeof(scsi_quirk_table) / sizeof(*scsi_quirk_table);
+static const int ata_quirk_table_size =
+	sizeof(ata_quirk_table) / sizeof(*ata_quirk_table);
 
 static cam_status	proberegister(struct cam_periph *periph,
 				      void *arg);
@@ -162,7 +157,7 @@ static void	 probestart(struct cam_perip
 //				     struct cam_ed *device);
 static void	 probedone(struct cam_periph *periph, union ccb *done_ccb);
 static void	 probecleanup(struct cam_periph *periph);
-static void	 scsi_find_quirk(struct cam_ed *device);
+static void	 ata_find_quirk(struct cam_ed *device);
 static void	 ata_scan_bus(struct cam_periph *periph, union ccb *ccb);
 static void	 ata_scan_lun(struct cam_periph *periph,
 			       struct cam_path *path, cam_flags flags,
@@ -172,10 +167,9 @@ static struct cam_ed *
 		 ata_alloc_device(struct cam_eb *bus, struct cam_et *target,
 				   lun_id_t lun_id);
 static void	 ata_device_transport(struct cam_path *path);
-static void	 scsi_set_transfer_settings(struct ccb_trans_settings *cts,
+static void	 ata_set_transfer_settings(struct ccb_trans_settings *cts,
 					    struct cam_ed *device,
 					    int async_update);
-static void	 scsi_toggle_tags(struct cam_path *path);
 static void	 ata_dev_async(u_int32_t async_code,
 				struct cam_eb *bus,
 				struct cam_et *target,
@@ -717,6 +711,17 @@ noerror:
 
 			path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
 		}
+		if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) {
+			path->device->mintags = path->device->maxtags =
+			    ATA_QUEUE_LEN(ident_buf->queue) + 1;
+		}
+		ata_find_quirk(path->device);
+		/* XXX: If not all tags allowed, we must to tell SIM which are. */
+		if (path->device->mintags < path->bus->sim->max_tagged_dev_openings)
+			path->device->mintags = path->device->maxtags = 0;
+		if (path->device->mintags != 0) {
+			xpt_start_tags(path);
+		}
 		ata_device_transport(path);
 		PROBE_SET_ACTION(softc, PROBE_SETMODE);
 		xpt_release_ccb(done_ccb);
@@ -776,7 +781,6 @@ noerror:
 			return;
 		}
 
-		scsi_find_quirk(path->device);
 		ata_device_transport(path);
 		if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) {
 			path->device->flags &= ~CAM_DEV_UNCONFIGURED;
@@ -853,24 +857,23 @@ probecleanup(struct cam_periph *periph)
 }
 
 static void
-scsi_find_quirk(struct cam_ed *device)
+ata_find_quirk(struct cam_ed *device)
 {
-	struct scsi_quirk_entry *quirk;
+	struct ata_quirk_entry *quirk;
 	caddr_t	match;
 
-	match = cam_quirkmatch((caddr_t)&device->inq_data,
-			       (caddr_t)scsi_quirk_table,
-			       sizeof(scsi_quirk_table) /
-			       sizeof(*scsi_quirk_table),
-			       sizeof(*scsi_quirk_table), scsi_inquiry_match);
+	match = cam_quirkmatch((caddr_t)&device->ident_data,
+			       (caddr_t)ata_quirk_table,
+			       ata_quirk_table_size,
+			       sizeof(*ata_quirk_table), ata_identify_match);
 
 	if (match == NULL)
 		panic("xpt_find_quirk: device didn't match wildcard entry!!");
 
-	quirk = (struct scsi_quirk_entry *)match;
+	quirk = (struct ata_quirk_entry *)match;
 	device->quirk = quirk;
-	device->mintags = quirk->mintags;
-	device->maxtags = quirk->maxtags;
+	if (quirk->quirks & CAM_QUIRK_MAXTAGS)
+		device->mintags = device->maxtags = quirk->maxtags;
 }
 
 typedef struct {
@@ -1101,7 +1104,7 @@ static struct cam_ed *
 ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
 {
 	struct cam_path path;
-	struct scsi_quirk_entry *quirk;
+	struct ata_quirk_entry *quirk;
 	struct cam_ed *device;
 	struct cam_ed *cur_device;
 
@@ -1113,10 +1116,10 @@ ata_alloc_device(struct cam_eb *bus, str
 	 * Take the default quirk entry until we have inquiry
 	 * data and can determine a better quirk to use.
 	 */
-	quirk = &scsi_quirk_table[scsi_quirk_table_size - 1];
+	quirk = &ata_quirk_table[ata_quirk_table_size - 1];
 	device->quirk = (void *)quirk;
-	device->mintags = quirk->mintags;
-	device->maxtags = quirk->maxtags;
+	device->mintags = 0;
+	device->maxtags = 0;
 	bzero(&device->inq_data, sizeof(device->inq_data));
 	device->inq_flags = 0;
 	device->queue_flags = 0;
@@ -1199,7 +1202,7 @@ ata_action(union ccb *start_ccb)
 	switch (start_ccb->ccb_h.func_code) {
 	case XPT_SET_TRAN_SETTINGS:
 	{
-		scsi_set_transfer_settings(&start_ccb->cts,
+		ata_set_transfer_settings(&start_ccb->cts,
 					   start_ccb->ccb_h.path->device,
 					   /*async_update*/FALSE);
 		break;
@@ -1227,7 +1230,7 @@ ata_action(union ccb *start_ccb)
 }
 
 static void
-scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
+ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
 			   int async_update)
 {
 	struct	ccb_pathinq cpi;
@@ -1379,24 +1382,7 @@ scsi_set_transfer_settings(struct ccb_tr
 				device->tag_delay_count = CAM_TAG_DELAY_COUNT;
 				device->flags |= CAM_DEV_TAG_AFTER_COUNT;
 			} else {
-				struct ccb_relsim crs;
-
-				xpt_freeze_devq(cts->ccb_h.path, /*count*/1);
-		  		device->inq_flags &= ~SID_CmdQue;
-				xpt_dev_ccbq_resize(cts->ccb_h.path,
-						    sim->max_dev_openings);
-				device->flags &= ~CAM_DEV_TAG_AFTER_COUNT;
-				device->tag_delay_count = 0;
-
-				xpt_setup_ccb(&crs.ccb_h, cts->ccb_h.path,
-				    CAM_PRIORITY_NORMAL);
-				crs.ccb_h.func_code = XPT_REL_SIMQ;
-				crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY;
-				crs.openings
-				    = crs.release_timeout
-				    = crs.qfrozen_cnt
-				    = 0;
-				xpt_action((union ccb *)&crs);
+				xpt_stop_tags(cts->ccb_h.path);
 			}
 		}
 	}
@@ -1404,39 +1390,6 @@ scsi_set_transfer_settings(struct ccb_tr
 		(*(sim->sim_action))(sim, (union ccb *)cts);
 }
 
-static void
-scsi_toggle_tags(struct cam_path *path)
-{
-	struct cam_ed *dev;
-
-	/*
-	 * Give controllers a chance to renegotiate
-	 * before starting tag operations.  We
-	 * "toggle" tagged queuing off then on
-	 * which causes the tag enable command delay
-	 * counter to come into effect.
-	 */
-	dev = path->device;
-	if ((dev->flags & CAM_DEV_TAG_AFTER_COUNT) != 0
-	 || ((dev->inq_flags & SID_CmdQue) != 0
- 	  && (dev->inq_flags & (SID_Sync|SID_WBus16|SID_WBus32)) != 0)) {
-		struct ccb_trans_settings cts;
-
-		xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
-		cts.protocol = PROTO_SCSI;
-		cts.protocol_version = PROTO_VERSION_UNSPECIFIED;
-		cts.transport = XPORT_UNSPECIFIED;
-		cts.transport_version = XPORT_VERSION_UNSPECIFIED;
-		cts.proto_specific.scsi.flags = 0;
-		cts.proto_specific.scsi.valid = CTS_SCSI_VALID_TQ;
-		scsi_set_transfer_settings(&cts, path->device,
-					  /*async_update*/TRUE);
-		cts.proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB;
-		scsi_set_transfer_settings(&cts, path->device,
-					  /*async_update*/TRUE);
-	}
-}
-
 /*
  * Handle any per-device event notifications that require action by the XPT.
  */
@@ -1469,15 +1422,6 @@ ata_dev_async(u_int32_t async_code, stru
 		status = CAM_REQ_CMP_ERR;
 
 	if (status == CAM_REQ_CMP) {
-
-		/*
-		 * Allow transfer negotiation to occur in a
-		 * tag free environment.
-		 */
-		if (async_code == AC_SENT_BDR
-		 || async_code == AC_BUS_RESET)
-			scsi_toggle_tags(&newpath);
-
 		if (async_code == AC_INQ_CHANGED) {
 			/*
 			 * We've sent a start unit command, or
@@ -1498,7 +1442,7 @@ ata_dev_async(u_int32_t async_code, stru
 		struct ccb_trans_settings *settings;
 
 		settings = (struct ccb_trans_settings *)async_arg;
-		scsi_set_transfer_settings(settings, device,
+		ata_set_transfer_settings(settings, device,
 					  /*async_update*/TRUE);
 	}
 }

Modified: head/sys/cam/cam.c
==============================================================================
--- head/sys/cam/cam.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/cam.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -165,8 +165,12 @@ cam_strmatch(const u_int8_t *str, const 
 		str++;
 		str_len--;
 	}
-	while (str_len > 0 && *str++ == ' ')
+	while (str_len > 0 && *str == ' ') {
+		str++;
 		str_len--;
+	}
+	if (str_len > 0 && *str == 0)
+		str_len = 0;
 
 	return (str_len);
 }

Modified: head/sys/cam/cam_ccb.h
==============================================================================
--- head/sys/cam/cam_ccb.h	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/cam_ccb.h	Wed Nov 11 11:10:36 2009	(r199178)
@@ -307,7 +307,7 @@ struct ccb_getdev {
 	struct scsi_inquiry_data inq_data;
 	struct ata_params ident_data;
 	u_int8_t  serial_num[252];
-	u_int8_t  reserved;
+	u_int8_t  inq_flags;
 	u_int8_t  serial_num_len;
 };
 

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/cam_xpt.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -285,7 +285,6 @@ static xpt_devicefunc_t	xptsetasyncfunc;
 static xpt_busfunc_t	xptsetasyncbusfunc;
 static cam_status	xptregister(struct cam_periph *periph,
 				    void *arg);
-static void	 xpt_start_tags(struct cam_path *path);
 static __inline int xpt_schedule_dev_allocq(struct cam_eb *bus,
 					    struct cam_ed *dev);
 static __inline int periph_is_queued(struct cam_periph *periph);
@@ -299,12 +298,6 @@ xpt_schedule_dev_allocq(struct cam_eb *b
 	int retval;
 
 	if (dev->ccbq.devq_openings > 0) {
-		if ((dev->flags & CAM_DEV_RESIZE_QUEUE_NEEDED) != 0) {
-			cam_ccbq_resize(&dev->ccbq,
-					dev->ccbq.dev_openings
-					+ dev->ccbq.dev_active);
-			dev->flags &= ~CAM_DEV_RESIZE_QUEUE_NEEDED;
-		}
 		/*
 		 * The priority of a device waiting for CCB resources
 		 * is that of the the highest priority peripheral driver
@@ -321,6 +314,27 @@ xpt_schedule_dev_allocq(struct cam_eb *b
 }
 
 static __inline int
+xpt_schedule_dev_sendq(struct cam_eb *bus, struct cam_ed *dev)
+{
+	int	retval;
+
+	if (dev->ccbq.dev_openings > 0) {
+		/*
+		 * The priority of a device waiting for controller
+		 * resources is that of the the highest priority CCB
+		 * enqueued.
+		 */
+		retval =
+		    xpt_schedule_dev(&bus->sim->devq->send_queue,
+				     &dev->send_ccb_entry.pinfo,
+				     CAMQ_GET_HEAD(&dev->ccbq.queue)->priority);
+	} else {
+		retval = 0;
+	}
+	return (retval);
+}
+
+static __inline int
 periph_is_queued(struct cam_periph *periph)
 {
 	return (periph->pinfo.index != CAM_UNQUEUED_INDEX);
@@ -2657,6 +2671,7 @@ xpt_action_default(union ccb *start_ccb)
 			cgd->protocol = dev->protocol;
 			cgd->inq_data = dev->inq_data;
 			cgd->ident_data = dev->ident_data;
+			cgd->inq_flags = dev->inq_flags;
 			cgd->ccb_h.status = CAM_REQ_CMP;
 			cgd->serial_num_len = dev->serial_num_len;
 			if ((dev->serial_num_len > 0)
@@ -3747,6 +3762,11 @@ xpt_release_ccb(union ccb *free_ccb)
 	mtx_assert(sim->mtx, MA_OWNED);
 
 	cam_ccbq_release_opening(&device->ccbq);
+	if (device->flags & CAM_DEV_RESIZE_QUEUE_NEEDED) {
+		device->flags &= ~CAM_DEV_RESIZE_QUEUE_NEEDED;
+		cam_ccbq_resize(&device->ccbq,
+		    device->ccbq.dev_openings + device->ccbq.dev_active);
+	}
 	if (sim->ccb_count > sim->max_ccbs) {
 		xpt_free_ccb(free_ccb);
 		sim->ccb_count--;
@@ -4573,7 +4593,7 @@ xpt_find_device(struct cam_et *target, l
 	return (device);
 }
 
-static void
+void
 xpt_start_tags(struct cam_path *path)
 {
 	struct ccb_relsim crs;
@@ -4602,6 +4622,30 @@ xpt_start_tags(struct cam_path *path)
 	xpt_action((union ccb *)&crs);
 }
 
+void
+xpt_stop_tags(struct cam_path *path)
+{
+	struct ccb_relsim crs;
+	struct cam_ed *device;
+	struct cam_sim *sim;
+
+	device = path->device;
+	sim = path->bus->sim;
+	device->flags &= ~CAM_DEV_TAG_AFTER_COUNT;
+	device->tag_delay_count = 0;
+	xpt_freeze_devq(path, /*count*/1);
+	device->inq_flags &= ~SID_CmdQue;
+	xpt_dev_ccbq_resize(path, sim->max_dev_openings);
+	xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL);
+	crs.ccb_h.func_code = XPT_REL_SIMQ;
+	crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY;
+	crs.openings
+	    = crs.release_timeout
+	    = crs.qfrozen_cnt
+	    = 0;
+	xpt_action((union ccb *)&crs);
+}
+
 static int busses_to_config;
 static int busses_to_reset;
 

Modified: head/sys/cam/cam_xpt_internal.h
==============================================================================
--- head/sys/cam/cam_xpt_internal.h	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/cam_xpt_internal.h	Wed Nov 11 11:10:36 2009	(r199178)
@@ -176,29 +176,8 @@ void			xpt_run_dev_sendq(struct cam_eb *
 int			xpt_schedule_dev(struct camq *queue, cam_pinfo *dev_pinfo,
 					 u_int32_t new_priority);
 u_int32_t		xpt_dev_ccbq_resize(struct cam_path *path, int newopenings);
-
-
-
-static __inline int
-xpt_schedule_dev_sendq(struct cam_eb *bus, struct cam_ed *dev)
-{
-	int	retval;
-
-	if (dev->ccbq.dev_openings > 0) {
-		/*
-		 * The priority of a device waiting for controller
-		 * resources is that of the the highest priority CCB
-		 * enqueued.
-		 */
-		retval =
-		    xpt_schedule_dev(&bus->sim->devq->send_queue,
-				     &dev->send_ccb_entry.pinfo,
-				     CAMQ_GET_HEAD(&dev->ccbq.queue)->priority);
-	} else {
-		retval = 0;
-	}
-	return (retval);
-}
+void			xpt_start_tags(struct cam_path *path);
+void			xpt_stop_tags(struct cam_path *path);
 
 MALLOC_DECLARE(M_CAMXPT);
 

Modified: head/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- head/sys/cam/scsi/scsi_xpt.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/cam/scsi/scsi_xpt.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -2274,24 +2274,7 @@ scsi_set_transfer_settings(struct ccb_tr
 				device->tag_delay_count = CAM_TAG_DELAY_COUNT;
 				device->flags |= CAM_DEV_TAG_AFTER_COUNT;
 			} else {
-				struct ccb_relsim crs;
-
-				xpt_freeze_devq(cts->ccb_h.path, /*count*/1);
-		  		device->inq_flags &= ~SID_CmdQue;
-				xpt_dev_ccbq_resize(cts->ccb_h.path,
-						    sim->max_dev_openings);
-				device->flags &= ~CAM_DEV_TAG_AFTER_COUNT;
-				device->tag_delay_count = 0;
-
-				xpt_setup_ccb(&crs.ccb_h, cts->ccb_h.path,
-				    CAM_PRIORITY_NORMAL);
-				crs.ccb_h.func_code = XPT_REL_SIMQ;
-				crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY;
-				crs.openings
-				    = crs.release_timeout
-				    = crs.qfrozen_cnt
-				    = 0;
-				xpt_action((union ccb *)&crs);
+				xpt_stop_tags(cts->ccb_h.path);
 			}
 		}
 	}

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/dev/ahci/ahci.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -733,7 +733,8 @@ ahci_ch_attach(device_t dev)
 	}
 	/* Construct SIM entry */
 	ch->sim = cam_sim_alloc(ahciaction, ahcipoll, "ahcich", ch,
-	    device_get_unit(dev), &ch->mtx, ch->numslots, 0, devq);
+	    device_get_unit(dev), &ch->mtx,
+	    min(2, ch->numslots), ch->numslots, devq);
 	if (ch->sim == NULL) {
 		device_printf(dev, "unable to allocate sim\n");
 		error = ENOMEM;

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Wed Nov 11 11:07:30 2009	(r199177)
+++ head/sys/dev/siis/siis.c	Wed Nov 11 11:10:36 2009	(r199178)
@@ -454,7 +454,7 @@ siis_ch_attach(device_t dev)
 	}
 	/* Construct SIM entry */
 	ch->sim = cam_sim_alloc(siisaction, siispoll, "siisch", ch,
-	    device_get_unit(dev), &ch->mtx, SIIS_MAX_SLOTS, 0, devq);
+	    device_get_unit(dev), &ch->mtx, 2, SIIS_MAX_SLOTS, devq);
 	if (ch->sim == NULL) {
 		device_printf(dev, "unable to allocate sim\n");
 		error = ENOMEM;

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 11:24:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48A7D106566C;
	Wed, 11 Nov 2009 11:24:03 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 389A98FC0C;
	Wed, 11 Nov 2009 11:24: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 nABBO3kB093203;
	Wed, 11 Nov 2009 11:24:03 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABBO3xY093199;
	Wed, 11 Nov 2009 11:24:03 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911111124.nABBO3xY093199@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 11 Nov 2009 11:24: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: r199179 - head/share/timedef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 11:24:03 -0000

Author: ume
Date: Wed Nov 11 11:24:02 2009
New Revision: 199179
URL: http://svn.freebsd.org/changeset/base/199179

Log:
  Add unit to the short month names for Japanese locales.
  Without unit, the output of the application like ls(1)
  is complicated.
  
  Reviewed by:	nork
  MFC after:	1 week

Modified:
  head/share/timedef/ja_JP.SJIS.src
  head/share/timedef/ja_JP.UTF-8.src
  head/share/timedef/ja_JP.eucJP.src

Modified: head/share/timedef/ja_JP.SJIS.src
==============================================================================
--- head/share/timedef/ja_JP.SJIS.src	Wed Nov 11 11:10:36 2009	(r199178)
+++ head/share/timedef/ja_JP.SJIS.src	Wed Nov 11 11:24:02 2009	(r199179)
@@ -5,18 +5,18 @@
 #
 # Short month names
 #
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
 #
 # Long month names (as in a date)
 #

Modified: head/share/timedef/ja_JP.UTF-8.src
==============================================================================
--- head/share/timedef/ja_JP.UTF-8.src	Wed Nov 11 11:10:36 2009	(r199178)
+++ head/share/timedef/ja_JP.UTF-8.src	Wed Nov 11 11:24:02 2009	(r199179)
@@ -4,18 +4,18 @@
 # WARNING: empty lines are essential too
 #
 # Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1月
+ 2月
+ 3月
+ 4月
+ 5月
+ 6月
+ 7月
+ 8月
+ 9月
+10月
+11月
+12月
 #
 # Long month names (as in a date)
 #

Modified: head/share/timedef/ja_JP.eucJP.src
==============================================================================
--- head/share/timedef/ja_JP.eucJP.src	Wed Nov 11 11:10:36 2009	(r199178)
+++ head/share/timedef/ja_JP.eucJP.src	Wed Nov 11 11:24:02 2009	(r199179)
@@ -4,18 +4,18 @@
 # WARNING: empty lines are essential too
 #
 # Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
 #
 # Long month names (as in a date)
 #

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 11:31:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C42931065670;
	Wed, 11 Nov 2009 11:31:03 +0000 (UTC)
	(envelope-from roam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3F968FC19;
	Wed, 11 Nov 2009 11:31: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 nABBV2n2093394;
	Wed, 11 Nov 2009 11:31:02 GMT (envelope-from roam@svn.freebsd.org)
Received: (from roam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABBV2G7093392;
	Wed, 11 Nov 2009 11:31:02 GMT (envelope-from roam@svn.freebsd.org)
Message-Id: <200911111131.nABBV2G7093392@svn.freebsd.org>
From: Peter Pentchev 
Date: Wed, 11 Nov 2009 11:31: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: r199180 - head/lib/libc/locale
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 11:31:03 -0000

Author: roam (doc,ports committer)
Date: Wed Nov 11 11:31:02 2009
New Revision: 199180
URL: http://svn.freebsd.org/changeset/base/199180

Log:
  Fix the grammar as in the PR, and then some.
  
  PR:		140454
  Submitted by:	Jeremy Huddleston 
  MFC after:	2 weeks

Modified:
  head/lib/libc/locale/isblank.3

Modified: head/lib/libc/locale/isblank.3
==============================================================================
--- head/lib/libc/locale/isblank.3	Wed Nov 11 11:24:02 2009	(r199179)
+++ head/lib/libc/locale/isblank.3	Wed Nov 11 11:31:02 2009	(r199180)
@@ -50,9 +50,9 @@ For any locale, this includes the follow
 .It "\&``\et''\t`` ''"
 .El
 .Pp
-In the "C" locale
+In the "C" locale, a successful
 .Fn isblank
-successful test is limited to this characters only.
+test is limited to these characters only.
 The value of the argument must be representable as an
 .Vt "unsigned char"
 or the value of

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 11:37:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 087F0106566B;
	Wed, 11 Nov 2009 11:37:44 +0000 (UTC)
	(envelope-from roam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC9D98FC12;
	Wed, 11 Nov 2009 11:37:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nABBbh02093569;
	Wed, 11 Nov 2009 11:37:43 GMT (envelope-from roam@svn.freebsd.org)
Received: (from roam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABBbhWu093567;
	Wed, 11 Nov 2009 11:37:43 GMT (envelope-from roam@svn.freebsd.org)
Message-Id: <200911111137.nABBbhWu093567@svn.freebsd.org>
From: Peter Pentchev 
Date: Wed, 11 Nov 2009 11:37:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199181 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 11:37:44 -0000

Author: roam (doc,ports committer)
Date: Wed Nov 11 11:37:43 2009
New Revision: 199181
URL: http://svn.freebsd.org/changeset/base/199181

Log:
  Correct the information about the doceng@ team members - Murray Stokely
  stepped down some time ago, about the same time as Giorgos Keramidas
  joined the team.
  
  PR:		140465
  Submitted by:	Denny Lin 
  MFC after:	2 weeks

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==============================================================================
--- head/share/misc/organization.dot	Wed Nov 11 11:31:02 2009	(r199180)
+++ head/share/misc/organization.dot	Wed Nov 11 11:37:43 2009	(r199181)
@@ -28,7 +28,7 @@ _misc [label="Miscellaneous Hats"]
 core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"]
 coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"]
 doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"]
-doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nmurray"]
+doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nkeramida"]
 portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"]
 portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nmarcus, kris, erwin,\nlinimon, pav, krion"]
 portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nerwin"]

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 12:23:20 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF9B5106566B;
	Wed, 11 Nov 2009 12:23:20 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au
	[211.29.132.188])
	by mx1.freebsd.org (Postfix) with ESMTP id 686F18FC0A;
	Wed, 11 Nov 2009 12:23:20 +0000 (UTC)
Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au
	[220.239.235.116])
	by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	nABCMawp013036
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 11 Nov 2009 23:22:37 +1100
Date: Wed, 11 Nov 2009 23:22:36 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: d@delphij.net
In-Reply-To: <4AF4B6B2.3090706@delphij.net>
Message-ID: <20091111230915.B3510@besplex.bde.org>
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org> <4AF4B6B2.3090706@delphij.net>
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, Xin LI ,
	Bruce Evans 
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 12:23:20 -0000

On Fri, 6 Nov 2009, Xin LI wrote:

> Bruce Evans wrote:
>> On Tue, 3 Nov 2009, Xin LI wrote:
>>
>>> Log:
>>>  Increase width for %CPU, RSS and VSZ columns for now.  Modern systems
>>>  tend to have larger memory, larger process, and more CPU.
>>
>> This uses space that is not available.  Command names(+args) are now
>> truncated to 9 columns in "ps l" output :-(.  They used to be truncated to
>> 11 columns recently (down from 12 columns in FreeBSD-5.2).
>
> I think we may have to live with this, even if we can cut down CPU
> percentage part, the memory column's width is still too narrow for
> modern systems.

Still only for modern systems running bloatware, and ps looking at the
bloatware.

> I have actually thought about having the numbers
> humanized but I'm afraid it would break some existing scripts :(

Maybe there should be a special mode for scripts.  Scripts shouldn't
care about the whitespace formatting (they should detect fields using
field separators and not specific columns).

> [...]
>> There seems to be no better fix than to further granulate and dehumanize
>> the numbers so that they fit in the available space.  E.g., a %CPU of
>>> = 100 and < 9999 should be displayed in %4.0f format; this only
>> involvues granulation, but above 9999 it needs to be dehumanized as
>> well and displayed in k or M or larger granularity (it can be > 9999
>> with 100 CPUs and > 999k with 10000 CPUs).  A VSZ of >= 10000 (k
>> implicit) needs to be displayed in M or larger granularity (M explicit).
>
> Will it sound reasonable to divide pcpu by ncpu and cap the number at 100?

I don't like that.  It would break scripts even more than units changes.
It is hard for users to interpret too.  Suddenly, processes taking
100% of 1 CPU would take 12.5% of 8 CPUs on a system with 8 CPUs, and
different %CPU on systems with a different number of CPUs.  Users would
need to know the number of CPUs and convert back.  This is too surprising,
especially for unthreaded processes.  OTOH, users must already be used
to seeing %CPU > 100 and dividing by the number of CPUs to get a more
easy to understand number for threaded processes.

Just print %CPU in %4.0f format when it is >= 99.5 (or whatever rounds
to 100.0).  This works up to 999.5 %CPU.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 12:55:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43966106566C;
	Wed, 11 Nov 2009 12:55:59 +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 336308FC14;
	Wed, 11 Nov 2009 12:55: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 nABCtxbe095276;
	Wed, 11 Nov 2009 12:55:59 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABCtxUV095274;
	Wed, 11 Nov 2009 12:55:59 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200911111255.nABCtxUV095274@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 11 Nov 2009 12:55: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: r199182 - head/sbin/mount
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 12:55:59 -0000

Author: trasz
Date: Wed Nov 11 12:55:58 2009
New Revision: 199182
URL: http://svn.freebsd.org/changeset/base/199182

Log:
  Add links to zfs(8) and zpool(8) to mount(8) manual page.

Modified:
  head/sbin/mount/mount.8

Modified: head/sbin/mount/mount.8
==============================================================================
--- head/sbin/mount/mount.8	Wed Nov 11 11:37:43 2009	(r199181)
+++ head/sbin/mount/mount.8	Wed Nov 11 12:55:58 2009	(r199182)
@@ -527,7 +527,9 @@ support for a particular file system mig
 .Xr mount_smbfs 8 ,
 .Xr mount_udf 8 ,
 .Xr mount_unionfs 8 ,
-.Xr umount 8
+.Xr umount 8 ,
+.Xr zfs 8 ,
+.Xr zpool 8
 .Sh CAVEATS
 After a successful
 .Nm ,

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 13:49:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B8FA1065670;
	Wed, 11 Nov 2009 13:49:23 +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 4B0F38FC08;
	Wed, 11 Nov 2009 13:49: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 nABDnMLd096359;
	Wed, 11 Nov 2009 13:49:22 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABDnMQh096358;
	Wed, 11 Nov 2009 13:49:22 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200911111349.nABDnMQh096358@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 11 Nov 2009 13:49: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: r199183 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 13:49:23 -0000

Author: trasz
Date: Wed Nov 11 13:49:22 2009
New Revision: 199183
URL: http://svn.freebsd.org/changeset/base/199183

Log:
  Revert r198873.  Having different VAPPEND semantics for VOP_ACCESS(9)
  and VOP_ACCESSX(9) is not a good idea.

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Wed Nov 11 12:55:58 2009	(r199182)
+++ head/sys/kern/vfs_default.c	Wed Nov 11 13:49:22 2009	(r199183)
@@ -353,14 +353,6 @@ vop_stdaccessx(struct vop_accessx_args *
 	if (accmode == 0)
 		return (0);
 
-	/*
-	 * Many VOP_APPEND implementations don't expect VAPPEND without VWRITE
-	 * being set, e.g. they check whether the filesystem is read-only only
-	 * when VWRITE is set.  Make sure we don't confuse them.
-	 */
-	if (accmode & VAPPEND)
-		accmode |= VWRITE;
-
 	return (VOP_ACCESS(ap->a_vp, accmode, ap->a_cred, ap->a_td));
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 14:21:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 593BE1065694;
	Wed, 11 Nov 2009 14:21:32 +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 2E5FB8FC22;
	Wed, 11 Nov 2009 14:21: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 nABELWTg097093;
	Wed, 11 Nov 2009 14:21:32 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABELWKu097089;
	Wed, 11 Nov 2009 14:21:32 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200911111421.nABELWKu097089@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 11 Nov 2009 14:21: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: r199184 - in head/sys: amd64/amd64 i386/i386 i386/xen
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 14:21:32 -0000

Author: avg
Date: Wed Nov 11 14:21:31 2009
New Revision: 199184
URL: http://svn.freebsd.org/changeset/base/199184

Log:
  reflect that pg_ps_enabled is a tunable, not just a read-only sysctl
  
  Nod from:	jhb

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

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Nov 11 13:49:22 2009	(r199183)
+++ head/sys/amd64/amd64/pmap.c	Wed Nov 11 14:21:31 2009	(r199184)
@@ -183,7 +183,7 @@ static int pat_works = 0;		/* Is page at
 SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
 
 static int pg_ps_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0,
+SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0,
     "Are large page mappings enabled?");
 
 static u_int64_t	KPTphys;	/* phys addr of kernel level 1 */

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed Nov 11 13:49:22 2009	(r199183)
+++ head/sys/i386/i386/pmap.c	Wed Nov 11 14:21:31 2009	(r199184)
@@ -217,7 +217,7 @@ static int pat_works = 0;		/* Is page at
 SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
 
 static int pg_ps_enabled;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0,
+SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0,
     "Are large page mappings enabled?");
 
 /*

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Wed Nov 11 13:49:22 2009	(r199183)
+++ head/sys/i386/xen/pmap.c	Wed Nov 11 14:21:31 2009	(r199184)
@@ -279,7 +279,7 @@ static struct mtx PMAP2mutex;
 
 SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
 static int pg_ps_enabled;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0,
+SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0,
     "Are large page mappings enabled?");
 
 SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_max, CTLFLAG_RD, &pv_entry_max, 0,

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 14:58:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3492A106566B;
	Wed, 11 Nov 2009 14:58:49 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 23E538FC0A;
	Wed, 11 Nov 2009 14:58: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 nABEwn3q098187;
	Wed, 11 Nov 2009 14:58:49 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABEwnVr098185;
	Wed, 11 Nov 2009 14:58:49 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <200911111458.nABEwnVr098185@svn.freebsd.org>
From: Antoine Brodin 
Date: Wed, 11 Nov 2009 14:58:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199186 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 14:58:49 -0000

Author: antoine
Date: Wed Nov 11 14:58:48 2009
New Revision: 199186
URL: http://svn.freebsd.org/changeset/base/199186

Log:
  Fix off by one in ieee80211_send_action_register
  
  Found by:	phk's FlexeLint in September
  Reviewed by:	rpaulo@
  MFC after:	1 month

Modified:
  head/sys/net80211/ieee80211_action.c

Modified: head/sys/net80211/ieee80211_action.c
==============================================================================
--- head/sys/net80211/ieee80211_action.c	Wed Nov 11 14:38:45 2009	(r199185)
+++ head/sys/net80211/ieee80211_action.c	Wed Nov 11 14:58:48 2009	(r199186)
@@ -105,7 +105,7 @@ ieee80211_send_action_register(int cat, 
 		meshlm_send_action[act] = f;
 		return 0;
 	case IEEE80211_ACTION_CAT_MESHPATH:
-		if (act > N(hwmp_send_action))
+		if (act >= N(hwmp_send_action))
 			break;
 		hwmp_send_action[act] = f;
 		return 0;

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 15:00:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8524A1065697;
	Wed, 11 Nov 2009 15:00:56 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 74A168FC16;
	Wed, 11 Nov 2009 15:00: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 nABF0u2r098317;
	Wed, 11 Nov 2009 15:00:56 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABF0u6T098315;
	Wed, 11 Nov 2009 15:00:56 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <200911111500.nABF0u6T098315@svn.freebsd.org>
From: Antoine Brodin 
Date: Wed, 11 Nov 2009 15:00: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: r199187 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 15:00:56 -0000

Author: antoine
Date: Wed Nov 11 15:00:56 2009
New Revision: 199187
URL: http://svn.freebsd.org/changeset/base/199187

Log:
  Remove trailing ";" in struct ieee80211_beacon_offsets declaration
  
  Found by:	phk's FlexeLint in September
  Reviewed by:	rpaulo@
  MFC after:	1 month

Modified:
  head/sys/net80211/ieee80211_proto.h

Modified: head/sys/net80211/ieee80211_proto.h
==============================================================================
--- head/sys/net80211/ieee80211_proto.h	Wed Nov 11 14:58:48 2009	(r199186)
+++ head/sys/net80211/ieee80211_proto.h	Wed Nov 11 15:00:56 2009	(r199187)
@@ -315,7 +315,7 @@ struct ieee80211_beacon_offsets {
 	uint8_t		*bo_ath;	/* start of ATH parameters */
 	uint8_t		*bo_appie;	/* start of AppIE element */
 	uint16_t	bo_appie_len;	/* AppIE length in bytes */
-	uint16_t	bo_csa_trailer_len;;
+	uint16_t	bo_csa_trailer_len;
 	uint8_t		*bo_csa;	/* start of CSA element */
 	uint8_t		*bo_meshconf;	/* start of MESHCONF element */
 	uint8_t		*bo_spare[3];

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 15:21:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FAF91065672;
	Wed, 11 Nov 2009 15:21:07 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1ED1D8FC15;
	Wed, 11 Nov 2009 15:21: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 nABFL7r4098773;
	Wed, 11 Nov 2009 15:21:07 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABFL7tD098771;
	Wed, 11 Nov 2009 15:21:07 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911111521.nABFL7tD098771@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 11 Nov 2009 15:21:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199188 - head/lib/libc/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 15:21:07 -0000

Author: ume
Date: Wed Nov 11 15:21:06 2009
New Revision: 199188
URL: http://svn.freebsd.org/changeset/base/199188

Log:
  ANSIfy.
  
  MFC after:	1 week

Modified:
  head/lib/libc/net/ip6opt.c

Modified: head/lib/libc/net/ip6opt.c
==============================================================================
--- head/lib/libc/net/ip6opt.c	Wed Nov 11 15:00:56 2009	(r199187)
+++ head/lib/libc/net/ip6opt.c	Wed Nov 11 15:21:06 2009	(r199188)
@@ -55,8 +55,7 @@ static void inet6_insert_padopt(u_char *
  * byte, the length byte, and the option data.
  */
 int
-inet6_option_space(nbytes)
-	int nbytes;
+inet6_option_space(int nbytes)
 {
 	nbytes += 2;	/* we need space for nxt-hdr and length fields */
 	return(CMSG_SPACE((nbytes + 7) & ~7));
@@ -68,10 +67,7 @@ inet6_option_space(nbytes)
  * success or -1 on an error.
  */
 int
-inet6_option_init(bp, cmsgp, type)
-	void *bp;
-	struct cmsghdr **cmsgp;
-	int type;
+inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type)
 {
 	struct cmsghdr *ch = (struct cmsghdr *)bp;
 
@@ -98,11 +94,8 @@ inet6_option_init(bp, cmsgp, type)
  * earlier.  It must have a value between 0 and 7, inclusive.
  */
 int
-inet6_option_append(cmsg, typep, multx, plusy)
-	struct cmsghdr *cmsg;
-	const u_int8_t *typep;
-	int multx;
-	int plusy;
+inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx,
+    int plusy)
 {
 	int padlen, optlen, off;
 	u_char *bp = (u_char *)cmsg + cmsg->cmsg_len;
@@ -171,11 +164,7 @@ inet6_option_append(cmsg, typep, multx, 
  * 
  */
 u_int8_t *
-inet6_option_alloc(cmsg, datalen, multx, plusy)
-	struct cmsghdr *cmsg;
-	int datalen;
-	int multx;
-	int plusy;
+inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy)
 {
 	int padlen, off;
 	u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len;
@@ -238,9 +227,7 @@ inet6_option_alloc(cmsg, datalen, multx,
  * (RFC 2292, 6.3.5)
  */
 int
-inet6_option_next(cmsg, tptrp)
-	const struct cmsghdr *cmsg;
-	u_int8_t **tptrp;
+inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp)
 {
 	struct ip6_ext *ip6e;
 	int hdrlen, optlen;
@@ -296,10 +283,7 @@ inet6_option_next(cmsg, tptrp)
  *       it's a typo. The variable should be type of u_int8_t **.
  */
 int
-inet6_option_find(cmsg, tptrp, type)
-	const struct cmsghdr *cmsg;
-	u_int8_t **tptrp;
-	int type;
+inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type)
 {
 	struct ip6_ext *ip6e;
 	int hdrlen, optlen;
@@ -352,8 +336,7 @@ inet6_option_find(cmsg, tptrp, type)
  * calculated length and the limitation of the buffer.
  */
 static int
-ip6optlen(opt, lim)
-	u_int8_t *opt, *lim;
+ip6optlen(u_int8_t *opt, u_int8_t *lim)
 {
 	int optlen;
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 15:43:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41C55106566B;
	Wed, 11 Nov 2009 15:43:08 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1745E8FC13;
	Wed, 11 Nov 2009 15: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 nABFh7kt099308;
	Wed, 11 Nov 2009 15:43:07 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABFh7NU099306;
	Wed, 11 Nov 2009 15:43:07 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <200911111543.nABFh7NU099306@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 11 Nov 2009 15:43: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: r199189 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 15:43:08 -0000

Author: jh
Date: Wed Nov 11 15:43:07 2009
New Revision: 199189
URL: http://svn.freebsd.org/changeset/base/199189

Log:
  Create verifier used by FreeBSD NFS client is suboptimal because the
  first part of a verifier is set to the first IP address from
  V_in_ifaddrhead list. This address is typically the loopback address
  making the first part of the verifier practically non-unique. The second
  part of the verifier is initialized to zero making its initial value
  non-unique too.
  
  This commit changes the strategy for create verifier initialization:
  just initialize it to a random value. Also move verifier handling into
  its own function and use a mutex to protect the variable.
  
  This change is a candidate for porting to sys/nfsclient.
  
  Reviewed by:	jhb, rmacklem
  Approved by:	trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Wed Nov 11 15:21:06 2009	(r199188)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Wed Nov 11 15:43:07 2009	(r199189)
@@ -1365,7 +1365,30 @@ nfs_mknod(struct vop_mknod_args *ap)
 	return (nfs_mknodrpc(ap->a_dvp, ap->a_vpp, ap->a_cnp, ap->a_vap));
 }
 
-static u_long create_verf;
+static struct mtx nfs_cverf_mtx;
+MTX_SYSINIT(nfs_cverf_mtx, &nfs_cverf_mtx, "NFS create verifier mutex",
+    MTX_DEF);
+
+static nfsquad_t
+nfs_get_cverf(void)
+{
+	static nfsquad_t cverf;
+	nfsquad_t ret;
+	static int cverf_initialized = 0;
+
+	mtx_lock(&nfs_cverf_mtx);
+	if (cverf_initialized == 0) {
+		cverf.lval[0] = arc4random();
+		cverf.lval[1] = arc4random();
+		cverf_initialized = 1;
+	} else
+		cverf.qval++;
+	ret = cverf;
+	mtx_unlock(&nfs_cverf_mtx);
+
+	return (ret);
+}
+
 /*
  * nfs file create call
  */
@@ -1405,19 +1428,7 @@ again:
 	}
 	mtx_unlock(&dnp->n_mtx);
 
-#ifdef INET
-	CURVNET_SET(CRED_TO_VNET(cnp->cn_cred));
-	IN_IFADDR_RLOCK();
-	if (!TAILQ_EMPTY(&V_in_ifaddrhead))
-		cverf.lval[0] = IA_SIN(TAILQ_FIRST(&V_in_ifaddrhead))->sin_addr.s_addr;
-	else
-#endif
-		cverf.lval[0] = create_verf;
-#ifdef INET
-	IN_IFADDR_RUNLOCK();
-	CURVNET_RESTORE();
-#endif
-	cverf.lval[1] = ++create_verf;
+	cverf = nfs_get_cverf();
 	error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen,
 	    vap, cverf, fmode, cnp->cn_cred, cnp->cn_thread, &dnfsva, &nfsva,
 	    &nfhp, &attrflag, &dattrflag, NULL);

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 18:28:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37DE8106566B;
	Wed, 11 Nov 2009 18:28:13 +0000 (UTC)
	(envelope-from rene@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 26C3A8FC0C;
	Wed, 11 Nov 2009 18:28: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 nABISDid003047;
	Wed, 11 Nov 2009 18:28:13 GMT (envelope-from rene@svn.freebsd.org)
Received: (from rene@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABISDWD003046;
	Wed, 11 Nov 2009 18:28:13 GMT (envelope-from rene@svn.freebsd.org)
Message-Id: <200911111828.nABISDWD003046@svn.freebsd.org>
From: Rene Ladan 
Date: Wed, 11 Nov 2009 18:28:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199190 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 18:28:13 -0000

Author: rene (doc committer)
Date: Wed Nov 11 18:28:12 2009
New Revision: 199190
URL: http://svn.freebsd.org/changeset/base/199190

Log:
  Synchronize with C.msg revision 199083 and improve some existing messages.
  
  Reviewed by:	remko
  Approved by:	remko

Modified:
  head/lib/libc/nls/nl_NL.ISO8859-1.msg

Modified: head/lib/libc/nls/nl_NL.ISO8859-1.msg
==============================================================================
--- head/lib/libc/nls/nl_NL.ISO8859-1.msg	Wed Nov 11 15:43:07 2009	(r199189)
+++ head/lib/libc/nls/nl_NL.ISO8859-1.msg	Wed Nov 11 18:28:12 2009	(r199190)
@@ -26,7 +26,7 @@ $ EBADF
 $ ECHILD
 10 Geen kindprocessen
 $ EDEADLK
-11 Een deadlock is vermeden
+11 Een deadlock op een bron is vermeden
 $ ENOMEM
 12 Kan geen geheugen meer verkrijgen
 $ EACCES
@@ -40,13 +40,13 @@ $ EBUSY
 $ EEXIST
 17 Bestand bestaat reeds
 $ EXDEV
-18 Verwijzing tussen bestanden op verschillende bestandssystemen
+18 Verwijzing tussen verschillende apparaten
 $ ENODEV
 19 Bewerking wordt niet ondersteund door dit apparaat
 $ ENOTDIR
 20 Dit is geen map
 $ EISDIR
-21 Dit is een map 
+21 Dit is een map
 $ EINVAL
 22 Ongeldig argument
 $ ENFILE
@@ -62,7 +62,7 @@ $ EFBIG
 $ ENOSPC
 28 Geen ruimte meer op dit apparaat
 $ ESPIPE
-29 Onuitvoerbare zoekopdracht
+29 Ongeldige zoekopdracht
 $ EROFS
 30 Van dit bestandssysteem kan alleen worden gelezen
 $ EMLINK
@@ -84,7 +84,7 @@ $ ENOTSOCK
 $ EDESTADDRREQ
 39 Een bestemmingsadres is vereist
 $ EMSGSIZE
-40 Te grote bericht
+40 Te groot bericht
 $ EPROTOTYPE
 41 Protocol past niet bij dit contactpunt
 $ ENOPROTOOPT
@@ -116,7 +116,7 @@ $ ECONNRESET
 $ ENOBUFS
 55 Geen bufferruimte meer beschikbaar
 $ EISCONN
-56 Dit contactpunt is al verbonden
+56 Contactpunt is al verbonden
 $ ENOTCONN
 57 Contactpunt is niet verbonden
 $ ESHUTDOWN
@@ -136,9 +136,9 @@ $ EHOSTDOWN
 $ EHOSTUNREACH
 65 Bestemming niet bereikbaar
 $ ENOTEMPTY
-66 Directory is niet leeg
+66 Map is niet leeg
 $ EPROCLIM
-67 Te veel taken
+67 Te veel processen
 $ EUSERS
 68 Te veel gebruikers
 $ EDQUOT
@@ -160,7 +160,7 @@ $ EPROCUNAVAIL
 $ ENOLCK
 77 Geen sloten beschikbaar
 $ ENOSYS
-78 Deze systeemfunctie is niet geimplementeerd
+78 Systeemfunctie is niet geimplementeerd
 $ EFTYPE
 79 Bestandsformaat niet van toepassing
 $ EAUTH
@@ -173,30 +173,24 @@ $ ENOMSG
 83 Geen bericht van het gewenste type
 $ EOVERFLOW
 84 Waarde te groot om te bewaren in gegevenstype
-$ EILSEQ
-85 Ongeldige bytereeks
-$ ENOTSUP
-86 Niet ondersteund
 $ ECANCELED
-87 Bewerking geannuleerd
-$ EBADMSG
-88 Verkeerd of defect bericht
-$ ENODATA
-89 Geen bericht beschikbaar
-$ ENOSR
-90 Geen STREAM-voorraad
-$ ENOSTR
-91 Dit is geen STREAM
-$ ETIME
-92 STREAM-ioctl verlopen
+85 Bewerking geannuleerd
+$ EILSEQ
+86 Ongeldige bytereeks
 $ ENOATTR
-93 Attribuut niet gevonden
+87 Attribuut niet gevonden
+$ EDOOFUS
+88 Programmeerfout
+$ EBADMSG
+89 Verkeerd of defect bericht
 $ EMULTIHOP
-94 Multihopverzoek
+90 Multihopverzoek
 $ ENOLINK
-95 Verbinding werd verstoord
+91 Verbinding werd verstoord
 $ EPROTO
-96 Protocolfout
+92 Protocolfout
+$ ENOTCAPABLE
+93 Onvoldoende mogelijkheden
 $
 $ strsignal() support catalog
 $
@@ -263,5 +257,38 @@ $ SIGUSR1
 30 Gebruikersignaal 1
 $ SIGUSR2
 31 Gebruikersignaal 2
-$ SIGPWR
-32 Stroomuitval/stroominschakeling
+$
+$ gai_strerror() support catalog
+$set 3
+$ 1 (obsolete)
+1 Adresfamilie voor hostnaam niet ondersteund
+$ EAI_AGAIN
+2 Tijdelijke fout in naamresolutie
+$ EAI_BADFLAGS
+3 Ongeldige waarde voor ai_flags
+$ EAI_FAIL
+4 Onherstelbare fout in naamresolutie
+$ EAI_FAMILY
+5 ai_familie niet ondersteund
+$ EAI_MEMORY
+6 Geheugenallocatiefout
+$ 7 (obsolete)
+7 Geen adres met hostnaam geassocieerd
+$ EAI_NONAME
+8 hostname noch servname gegeven, of onbekend
+$ EAI_SERVICE
+9 servname niet ondersteund voor ai_socktype
+$ EAI_SOCKTYPE
+10 ai_socktype niet ondersteund
+$ EAI_SYSTEM
+11 Systeemfout geretourneerd in errno
+$ EAI_BADHINTS
+12 Ongeldige waarde voor hints
+$ EAI_PROTOCOL
+13 Opgelost protocol is onbekend
+$ EAI_OVERFLOW
+14 Argumentbuffer overstroomd
+$ 0
+32766 Succes
+$ NL_MSGMAX
+32767 Onbekende fout

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 19:13:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BACFB1065692;
	Wed, 11 Nov 2009 19:13:40 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9C958FC1B;
	Wed, 11 Nov 2009 19:13: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 nABJDeX4004321;
	Wed, 11 Nov 2009 19:13:40 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABJDewR004319;
	Wed, 11 Nov 2009 19:13:40 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200911111913.nABJDewR004319@svn.freebsd.org>
From: Jack F Vogel 
Date: Wed, 11 Nov 2009 19:13: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: r199192 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 19:13:40 -0000

Author: jfv
Date: Wed Nov 11 19:13:40 2009
New Revision: 199192
URL: http://svn.freebsd.org/changeset/base/199192

Log:
  With an i386 kernel the igb driver can cause a
  page fault panic on initialization due to a large
  number of bounce pages being allocated. This is due
  to the dma tag requiring page alignment on mbuf mapping.
  This was removed some time back from the ixgbe driver
  and is not needed here either.

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

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Wed Nov 11 19:00:12 2009	(r199191)
+++ head/sys/dev/e1000/if_igb.c	Wed Nov 11 19:13:40 2009	(r199192)
@@ -2654,7 +2654,7 @@ igb_dma_malloc(struct adapter *adapter, 
 	int error;
 
 	error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */
-				IGB_DBA_ALIGN, 0,	/* alignment, bounds */
+				1, 0,			/* alignment, bounds */
 				BUS_SPACE_MAXADDR,	/* lowaddr */
 				BUS_SPACE_MAXADDR,	/* highaddr */
 				NULL, NULL,		/* filter, filterarg */
@@ -2867,7 +2867,7 @@ igb_allocate_transmit_buffers(struct tx_
 	 * Setup DMA descriptor areas.
 	 */
 	if ((error = bus_dma_tag_create(NULL,		/* parent */
-			       PAGE_SIZE, 0,		/* alignment, bounds */
+			       1, 0,			/* alignment, bounds */
 			       BUS_SPACE_MAXADDR,	/* lowaddr */
 			       BUS_SPACE_MAXADDR,	/* highaddr */
 			       NULL, NULL,		/* filter, filterarg */
@@ -3554,7 +3554,7 @@ igb_allocate_receive_buffers(struct rx_r
 	** it may not always use this.
 	*/
 	if ((error = bus_dma_tag_create(NULL,		/* parent */
-				   PAGE_SIZE, 0,	/* alignment, bounds */
+				   1, 0,		/* alignment, bounds */
 				   BUS_SPACE_MAXADDR,	/* lowaddr */
 				   BUS_SPACE_MAXADDR,	/* highaddr */
 				   NULL, NULL,		/* filter, filterarg */

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 19:39:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C7398106568F;
	Wed, 11 Nov 2009 19:39:45 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B62F48FC15;
	Wed, 11 Nov 2009 19: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 nABJdjNf004856;
	Wed, 11 Nov 2009 19:39:45 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABJdjFB004854;
	Wed, 11 Nov 2009 19:39:45 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <200911111939.nABJdjFB004854@svn.freebsd.org>
From: Antoine Brodin 
Date: Wed, 11 Nov 2009 19: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: r199193 - head/sys/boot/uboot/lib
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 19:39:45 -0000

Author: antoine
Date: Wed Nov 11 19:39:45 2009
New Revision: 199193
URL: http://svn.freebsd.org/changeset/base/199193

Log:
  - Remove trailing ";" after if statement
  - Remove #if 0 section that was never needed/used
  
  Reviewed by:	raj@
  MFC after:	1 month

Modified:
  head/sys/boot/uboot/lib/glue.c

Modified: head/sys/boot/uboot/lib/glue.c
==============================================================================
--- head/sys/boot/uboot/lib/glue.c	Wed Nov 11 19:13:40 2009	(r199192)
+++ head/sys/boot/uboot/lib/glue.c	Wed Nov 11 19:39:45 2009	(r199193)
@@ -467,7 +467,7 @@ ub_stor_type(int type)
 	if (type & DT_STOR_USB)
 		return ("USB");
 
-	if (type & DT_STOR_MMC);
+	if (type & DT_STOR_MMC)
 		return ("MMC");
 
 	return ("Unknown");
@@ -581,11 +581,6 @@ ub_env_enum(const char *last)
 	if (!env)
 		/* no more env. variables to enumerate */
 		return (NULL);
-#if 0
-	if (last && strncmp(env, last, strlen(last)) == 0);
-		/* error, trying to enumerate non existing env. variable */
-		return NULL;
-#endif
 
 	/* next enumerated env var */
 	memset(env_name, 0, 256);

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 20:27:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A13EB1065672;
	Wed, 11 Nov 2009 20:27:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 902638FC18;
	Wed, 11 Nov 2009 20:27: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 nABKRrox005990;
	Wed, 11 Nov 2009 20:27:53 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABKRriX005987;
	Wed, 11 Nov 2009 20:27:53 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200911112027.nABKRriX005987@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 11 Nov 2009 20:27: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: r199197 - head/sys/dev/bwi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 20:27:53 -0000

Author: jhb
Date: Wed Nov 11 20:27:53 2009
New Revision: 199197
URL: http://svn.freebsd.org/changeset/base/199197

Log:
  Use a dedicated callout to drive the transmit watchdog timer instead of
  using if_watchdog and if_timer.
  
  Tested by:	gavin

Modified:
  head/sys/dev/bwi/if_bwi.c
  head/sys/dev/bwi/if_bwivar.h

Modified: head/sys/dev/bwi/if_bwi.c
==============================================================================
--- head/sys/dev/bwi/if_bwi.c	Wed Nov 11 20:00:57 2009	(r199196)
+++ head/sys/dev/bwi/if_bwi.c	Wed Nov 11 20:27:53 2009	(r199197)
@@ -106,7 +106,7 @@ static void	bwi_start(struct ifnet *);
 static void	bwi_start_locked(struct ifnet *);
 static int	bwi_raw_xmit(struct ieee80211_node *, struct mbuf *,
 			const struct ieee80211_bpf_params *);
-static void	bwi_watchdog(struct ifnet *);
+static void	bwi_watchdog(void *);
 static void	bwi_scan_start(struct ieee80211com *);
 static void	bwi_set_channel(struct ieee80211com *);
 static void	bwi_scan_end(struct ieee80211com *);
@@ -464,10 +464,10 @@ bwi_attach(struct bwi_softc *sc)
 	ifp->if_init = bwi_init;
 	ifp->if_ioctl = bwi_ioctl;
 	ifp->if_start = bwi_start;
-	ifp->if_watchdog = bwi_watchdog;
 	IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
 	ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
 	IFQ_SET_READY(&ifp->if_snd);
+	callout_init_mtx(&sc->sc_watchdog_timer, &sc->sc_mtx, 0);
 
 	/*
 	 * Setup ratesets, phytype, channels and get MAC address
@@ -581,6 +581,7 @@ bwi_detach(struct bwi_softc *sc)
 	bwi_stop(sc, 1);
 	callout_drain(&sc->sc_led_blink_ch);
 	callout_drain(&sc->sc_calib_ch);
+	callout_drain(&sc->sc_watchdog_timer);
 	ieee80211_ifdetach(ic);
 
 	for (i = 0; i < sc->sc_nmac; ++i)
@@ -1295,6 +1296,7 @@ bwi_init_statechg(struct bwi_softc *sc, 
 	sc->sc_flags &= ~BWI_F_STOP;
 
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
+	callout_reset(&sc->sc_watchdog_timer, hz, bwi_watchdog, sc);
 
 	/* Enable intrs */
 	bwi_enable_intrs(sc, BWI_INIT_INTRS);
@@ -1433,7 +1435,7 @@ bwi_start_locked(struct ifnet *ifp)
 	tbd->tbd_idx = idx;
 
 	if (trans)
-		ifp->if_timer = 5;
+		sc->sc_tx_timer = 5;
 }
 
 static int
@@ -1474,7 +1476,7 @@ bwi_raw_xmit(struct ieee80211_node *ni, 
 		if (++tbd->tbd_used + BWI_TX_NSPRDESC >= BWI_TX_NDESC)
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 		tbd->tbd_idx = (idx + 1) % BWI_TX_NDESC;
-		ifp->if_timer = 5;
+		sc->sc_tx_timer = 5;
 	} else {
 		/* NB: m is reclaimed on encap failure */
 		ieee80211_free_node(ni);
@@ -1485,17 +1487,20 @@ bwi_raw_xmit(struct ieee80211_node *ni, 
 }
 
 static void
-bwi_watchdog(struct ifnet *ifp)
+bwi_watchdog(void *arg)
 {
-	struct bwi_softc *sc = ifp->if_softc;
+	struct bwi_softc *sc;
+	struct ifnet *ifp;
 
-	BWI_LOCK(sc);
-	if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+	sc = arg;
+	ifp = sc->sc_ifp;
+	BWI_ASSERT_LOCKED(sc);
+	if (sc->sc_tx_timer != 0 && --sc->sc_tx_timer == 0) {
 		if_printf(ifp, "watchdog timeout\n");
 		ifp->if_oerrors++;
 		taskqueue_enqueue(sc->sc_tq, &sc->sc_restart_task);
 	}
-	BWI_UNLOCK(sc);
+	callout_reset(&sc->sc_watchdog_timer, hz, bwi_watchdog, sc);
 }
 
 static void
@@ -1551,7 +1556,7 @@ bwi_stop_locked(struct bwi_softc *sc, in
 		bwi_bbp_power_off(sc);
 
 	sc->sc_tx_timer = 0;
-	ifp->if_timer = 0;
+	callout_stop(&sc->sc_watchdog_timer);
 	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
 }
 
@@ -3420,7 +3425,7 @@ _bwi_txeof(struct bwi_softc *sc, uint16_
 	tb->tb_mbuf = NULL;
 
 	if (tbd->tbd_used == 0)
-		ifp->if_timer = 0;
+		sc->sc_tx_timer = 0;
 
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 }
@@ -3922,7 +3927,7 @@ bwi_led_attach(struct bwi_softc *sc)
 			"%dth led, act %d, lowact %d\n", i,
 			led->l_act, led->l_flags & BWI_LED_F_ACTLOW);
 	}
-	callout_init(&sc->sc_led_blink_ch, CALLOUT_MPSAFE);
+	callout_init_mtx(&sc->sc_led_blink_ch, &sc->sc_mtx, 0);
 }
 
 static __inline uint16_t

Modified: head/sys/dev/bwi/if_bwivar.h
==============================================================================
--- head/sys/dev/bwi/if_bwivar.h	Wed Nov 11 20:00:57 2009	(r199196)
+++ head/sys/dev/bwi/if_bwivar.h	Wed Nov 11 20:27:53 2009	(r199197)
@@ -578,6 +578,7 @@ struct bwi_softc {
 	bus_space_handle_t	sc_mem_bh;
 
 	struct callout		sc_calib_ch;
+	struct callout	sc_watchdog_timer;
 
 	struct bwi_regwin	*sc_cur_regwin;
 	struct bwi_regwin	sc_com_regwin;

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 20:29:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3603106566B;
	Wed, 11 Nov 2009 20:29:40 +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 92D608FC0C;
	Wed, 11 Nov 2009 20:29: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 nABKTenO006064;
	Wed, 11 Nov 2009 20:29:40 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABKTeS7006062;
	Wed, 11 Nov 2009 20:29:40 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200911112029.nABKTeS7006062@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 11 Nov 2009 20:29: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: r199198 - head/sys/dev/bwi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 20:29:40 -0000

Author: jhb
Date: Wed Nov 11 20:29:40 2009
New Revision: 199198
URL: http://svn.freebsd.org/changeset/base/199198

Log:
  More consistent whitespace.

Modified:
  head/sys/dev/bwi/if_bwivar.h

Modified: head/sys/dev/bwi/if_bwivar.h
==============================================================================
--- head/sys/dev/bwi/if_bwivar.h	Wed Nov 11 20:27:53 2009	(r199197)
+++ head/sys/dev/bwi/if_bwivar.h	Wed Nov 11 20:29:40 2009	(r199198)
@@ -578,7 +578,7 @@ struct bwi_softc {
 	bus_space_handle_t	sc_mem_bh;
 
 	struct callout		sc_calib_ch;
-	struct callout	sc_watchdog_timer;
+	struct callout		sc_watchdog_timer;
 
 	struct bwi_regwin	*sc_cur_regwin;
 	struct bwi_regwin	sc_com_regwin;

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 21:30:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C742E106566B;
	Wed, 11 Nov 2009 21:30: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 B424B8FC23;
	Wed, 11 Nov 2009 21:30: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 nABLUwxG007780;
	Wed, 11 Nov 2009 21:30:58 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABLUw9b007768;
	Wed, 11 Nov 2009 21:30:58 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200911112130.nABLUw9b007768@svn.freebsd.org>
From: Xin LI 
Date: Wed, 11 Nov 2009 21:30:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 21:30:58 -0000

Author: delphij
Date: Wed Nov 11 21:30:58 2009
New Revision: 199201
URL: http://svn.freebsd.org/changeset/base/199201

Log:
  Add interface description capability as inspired by OpenBSD.
  
  MFC after:	3 months

Modified:
  head/contrib/libpcap/inet.c
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifconfig.c
  head/share/man/man4/netintro.4
  head/sys/kern/kern_jail.c
  head/sys/net/if.c
  head/sys/net/if.h
  head/sys/net/if_var.h
  head/sys/sys/param.h
  head/sys/sys/priv.h
  head/sys/sys/sockio.h

Modified: head/contrib/libpcap/inet.c
==============================================================================
--- head/contrib/libpcap/inet.c	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/contrib/libpcap/inet.c	Wed Nov 11 21:30:58 2009	(r199201)
@@ -403,22 +403,30 @@ add_addr_to_iflist(pcap_if_t **alldevs, 
 	pcap_addr_t *curaddr, *prevaddr, *nextaddr;
 #ifdef SIOCGIFDESCR
 	struct ifreq ifrdesc;
+#ifdef __FreeBSD__
+#define _IFDESCRSIZE 64
+	char ifdescr[_IFDESCRSIZE];
+#else
 	char ifdescr[IFDESCRSIZE];
-	int s;
 #endif
+	int s;
 
-#ifdef SIOCGIFDESCR
 	/*
 	 * Get the description for the interface.
 	 */
 	memset(&ifrdesc, 0, sizeof ifrdesc);
 	strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
+#ifdef __FreeBSD__
+	ifrdesc.ifr_buffer.buffer = ifdescr;
+	ifrdesc.ifr_buffer.length = _IFDESCRSIZE;
+#else
 	ifrdesc.ifr_data = (caddr_t)&ifdescr;
+#endif
 	s = socket(AF_INET, SOCK_DGRAM, 0);
 	if (s >= 0) {
 		if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0 &&
-		    strlen(ifrdesc.ifr_data) != 0)
-			description = ifrdesc.ifr_data;
+		    strlen(ifdescr) != 0)
+			description = ifdescr;
 		close(s);
 	}
 #endif

Modified: head/sbin/ifconfig/ifconfig.8
==============================================================================
--- head/sbin/ifconfig/ifconfig.8	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sbin/ifconfig/ifconfig.8	Wed Nov 11 21:30:58 2009	(r199201)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd September 23, 2009
+.Dd November 11, 2009
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -258,6 +258,12 @@ Disable permanently promiscuous mode.
 Another name for the
 .Fl alias
 parameter.
+.It Cm description Ar value
+Specify a description of the interface.
+This can be used to label interfaces in situations where they may
+otherwise be difficult to distinguish.
+.It Cm -description
+Clear the interface description.
 .It Cm down
 Mark an interface
 .Dq down .
@@ -2512,6 +2518,10 @@ Configure the interface
 to use 100baseTX, full duplex Ethernet media options:
 .Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
 .Pp
+Label the em0 interface as an uplink:
+.Pp
+.Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
+.Pp
 Create the software network interface
 .Li gif1 :
 .Dl # ifconfig gif1 create

Modified: head/sbin/ifconfig/ifconfig.c
==============================================================================
--- head/sbin/ifconfig/ifconfig.c	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sbin/ifconfig/ifconfig.c	Wed Nov 11 21:30:58 2009	(r199201)
@@ -83,6 +83,8 @@ static const char rcsid[] =
 struct	ifreq ifr;
 
 char	name[IFNAMSIZ];
+char	*descr = NULL;
+size_t	descrlen = 64;
 int	setaddr;
 int	setmask;
 int	doalias;
@@ -822,6 +824,36 @@ setifname(const char *val, int dummy __u
 	free(newname);
 }
 
+/* ARGSUSED */
+static void
+setifdescr(const char *val, int dummy __unused, int s, 
+    const struct afswtch *afp)
+{
+	char *newdescr;
+
+	newdescr = strdup(val);
+	if (newdescr == NULL) {
+		warn("no memory to set ifdescr");
+		return;
+	}
+	ifr.ifr_buffer.buffer = newdescr;
+	ifr.ifr_buffer.length = strlen(newdescr);
+	if (ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0) {
+		warn("ioctl (set descr)");
+		free(newdescr);
+		return;
+	}
+	free(newdescr);
+}
+
+/* ARGSUSED */
+static void
+unsetifdescr(const char *val, int value, int s, const struct afswtch *afp)
+{
+
+	setifdescr("", 0, s, 0);
+}
+
 #define	IFFBITS \
 "\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6SMART\7RUNNING" \
 "\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2" \
@@ -866,6 +898,23 @@ status(const struct afswtch *afp, const 
 		printf(" mtu %d", ifr.ifr_mtu);
 	putchar('\n');
 
+	descr = reallocf(descr, descrlen);
+	if (descr != NULL) {
+		do {
+			ifr.ifr_buffer.buffer = descr;
+			ifr.ifr_buffer.length = descrlen;
+			if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) {
+			    if (strlen(descr) > 0)
+				printf("\tdescription: %s\n", descr);
+			    break;
+			}
+			if (errno == ENAMETOOLONG) {
+				descrlen *= 2;
+				descr = reallocf(descr, descrlen);
+			}
+		} while (errno == ENAMETOOLONG);
+	}
+
 	if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) {
 		if (ifr.ifr_curcap != 0) {
 			printb("\toptions", ifr.ifr_curcap, IFCAPBITS);
@@ -1035,6 +1084,10 @@ static struct cmd basic_cmds[] = {
 	DEF_CMD("-arp",		IFF_NOARP,	setifflags),
 	DEF_CMD("debug",	IFF_DEBUG,	setifflags),
 	DEF_CMD("-debug",	-IFF_DEBUG,	setifflags),
+	DEF_CMD_ARG("description",		setifdescr),
+	DEF_CMD_ARG("descr",			setifdescr),
+	DEF_CMD("-description",	0,		unsetifdescr),
+	DEF_CMD("-descr",	0,		unsetifdescr),
 	DEF_CMD("promisc",	IFF_PPROMISC,	setifflags),
 	DEF_CMD("-promisc",	-IFF_PPROMISC,	setifflags),
 	DEF_CMD("add",		IFF_UP,		notealias),

Modified: head/share/man/man4/netintro.4
==============================================================================
--- head/share/man/man4/netintro.4	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/share/man/man4/netintro.4	Wed Nov 11 21:30:58 2009	(r199201)
@@ -32,7 +32,7 @@
 .\"     @(#)netintro.4	8.2 (Berkeley) 11/30/93
 .\" $FreeBSD$
 .\"
-.Dd June 18, 2004
+.Dd November 11, 2009
 .Dt NETINTRO 4
 .Os
 .Sh NAME
@@ -277,6 +277,25 @@ and
 fields of the
 .Vt ifreq
 structure, respectively.
+.It Dv SIOCGIFDESCR
+Get the interface description, returned in the
+.Va buffer
+field of
+.Va ifru_buffer
+struct.
+The user supplied buffer length should defined in the
+.Va length
+field of
+.Va ifru_buffer
+struct passed in as parameter.
+.It Dv SIOCSIFDESCR
+Set the interface description to the value of the
+.Va buffer
+field of
+.Va ifru_buffer
+struct, with
+.Va length
+field specifying its length.
 .It Dv SIOCSIFFLAGS
 Set interface flags field.
 If the interface is marked down,

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/kern/kern_jail.c	Wed Nov 11 21:30:58 2009	(r199201)
@@ -3467,6 +3467,7 @@ prison_priv_check(struct ucred *cred, in
 	case PRIV_NET_SETIFMTU:
 	case PRIV_NET_SETIFFLAGS:
 	case PRIV_NET_SETIFCAP:
+	case PRIV_NET_SETIFDESCR:
 	case PRIV_NET_SETIFNAME	:
 	case PRIV_NET_SETIFMETRIC:
 	case PRIV_NET_SETIFPHYS:

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/net/if.c	Wed Nov 11 21:30:58 2009	(r199201)
@@ -463,6 +463,8 @@ if_free_internal(struct ifnet *ifp)
 #ifdef MAC
 	mac_ifnet_destroy(ifp);
 #endif /* MAC */
+	if (ifp->if_description != NULL)
+		sbuf_delete(ifp->if_description);
 	IF_AFDATA_DESTROY(ifp);
 	IF_ADDR_LOCK_DESTROY(ifp);
 	ifq_delete(&ifp->if_snd);
@@ -2090,6 +2092,45 @@ ifhwioctl(u_long cmd, struct ifnet *ifp,
 		ifr->ifr_phys = ifp->if_physical;
 		break;
 
+	case SIOCGIFDESCR:
+		IF_AFDATA_RLOCK(ifp);
+		if (ifp->if_description == NULL)
+			error = ENOMSG;
+		else
+			error = copystr(sbuf_data(ifp->if_description),
+					ifr->ifr_buffer.buffer,
+					ifr->ifr_buffer.length, NULL);
+		IF_AFDATA_RUNLOCK(ifp);
+		break;
+
+	case SIOCSIFDESCR:
+		error = priv_check(td, PRIV_NET_SETIFDESCR);
+		if (error)
+			return (error);
+
+		IF_AFDATA_WLOCK(ifp);
+		if (ifp->if_description == NULL) {
+			ifp->if_description = sbuf_new_auto();
+			if (ifp->if_description == NULL) {
+				error = ENOMEM;
+				IF_AFDATA_WUNLOCK(ifp);
+				break;
+			}
+		} else
+			sbuf_clear(ifp->if_description);
+
+		if (sbuf_copyin(ifp->if_description, ifr->ifr_buffer.buffer,
+				ifr->ifr_buffer.length) == -1)
+			error = EFAULT;
+
+		if (error == 0) {
+			sbuf_finish(ifp->if_description);
+			getmicrotime(&ifp->if_lastchange);
+		}
+		IF_AFDATA_WUNLOCK(ifp);
+
+		break;
+
 	case SIOCSIFFLAGS:
 		error = priv_check(td, PRIV_NET_SETIFFLAGS);
 		if (error)

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/net/if.h	Wed Nov 11 21:30:58 2009	(r199201)
@@ -294,6 +294,7 @@ struct	ifreq {
 		struct	sockaddr ifru_addr;
 		struct	sockaddr ifru_dstaddr;
 		struct	sockaddr ifru_broadaddr;
+		struct { size_t length; caddr_t	buffer; } ifru_buffer;
 		short	ifru_flags[2];
 		short	ifru_index;
 		int	ifru_jid;
@@ -307,6 +308,7 @@ struct	ifreq {
 #define	ifr_addr	ifr_ifru.ifru_addr	/* address */
 #define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
 #define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address */
+#define	ifr_buffer	ifr_ifru.ifru_buffer	/* user supplied buffer with its length */
 #define	ifr_flags	ifr_ifru.ifru_flags[0]	/* flags (low 16 bits) */
 #define	ifr_flagshigh	ifr_ifru.ifru_flags[1]	/* flags (high 16 bits) */
 #define	ifr_jid		ifr_ifru.ifru_jid	/* jail/vnet */

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/net/if_var.h	Wed Nov 11 21:30:58 2009	(r199201)
@@ -198,6 +198,7 @@ struct ifnet {
 	void	*if_pf_kif;
 	void	*if_lagg;		/* lagg glue */
 	u_char	 if_alloctype;		/* if_type at time of allocation */
+	struct sbuf *if_description;	/* interface description */
 
 	/*
 	 * Spare fields are added so that we can modify sensitive data
@@ -205,7 +206,7 @@ struct ifnet {
 	 * be used with care where binary compatibility is required.
 	 */
 	char	 if_cspare[3];
-	void	*if_pspare[8];
+	void	*if_pspare[7];
 	int	if_ispare[4];
 };
 

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/sys/param.h	Wed Nov 11 21:30:58 2009	(r199201)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 900002	/* Master, propagated to newvers */
+#define __FreeBSD_version 900003	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/sys/priv.h	Wed Nov 11 21:30:58 2009	(r199201)
@@ -335,6 +335,7 @@
 #define	PRIV_NET_LAGG		415	/* Administer lagg interface. */
 #define	PRIV_NET_GIF		416	/* Administer gif interface. */
 #define	PRIV_NET_SETIFVNET	417	/* Move interface to vnet. */
+#define	PRIV_NET_SETIFDESCR	418	/* Set interface description. */
 
 /*
  * 802.11-related privileges.

Modified: head/sys/sys/sockio.h
==============================================================================
--- head/sys/sys/sockio.h	Wed Nov 11 21:18:27 2009	(r199200)
+++ head/sys/sys/sockio.h	Wed Nov 11 21:30:58 2009	(r199201)
@@ -82,6 +82,8 @@
 #define	SIOCGIFMAC	_IOWR('i', 38, struct ifreq)	/* get IF MAC label */
 #define	SIOCSIFMAC	 _IOW('i', 39, struct ifreq)	/* set IF MAC label */
 #define	SIOCSIFNAME	 _IOW('i', 40, struct ifreq)	/* set IF name */
+#define	SIOCSIFDESCR	 _IOW('i', 41, struct ifreq)	/* set ifnet descr */ 
+#define	SIOCGIFDESCR	_IOWR('i', 42, struct ifreq)	/* get ifnet descr */ 
 
 #define	SIOCADDMULTI	 _IOW('i', 49, struct ifreq)	/* add m'cast addr */
 #define	SIOCDELMULTI	 _IOW('i', 50, struct ifreq)	/* del m'cast addr */

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 21:56:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44F261065670;
	Wed, 11 Nov 2009 21:56:54 +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 D7AA78FC12;
	Wed, 11 Nov 2009 21:56:53 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 51B411CCF3; Wed, 11 Nov 2009 22:56:51 +0100 (CET)
Date: Wed, 11 Nov 2009 22:56:51 +0100
From: Ed Schouten 
To: Jun Kuriyama 
Message-ID: <20091111215651.GM64905@hoeg.nl>
References: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="XLsjFikA86nwwlhe"
Content-Disposition: inline
In-Reply-To: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
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: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 21:56:54 -0000


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

Hi,

* Jun Kuriyama  wrote:
> Can you test with these patches?  Testing on only one of both system
> is enough.  "patch-1" forces disabling CLFLUSH feature even if SS bit
> exists.  "patch-2" forces no CLFLUSH tweak.  I'd like to know with
> which patch your system can live.

For some reason they both seem to boot. Yikes. I've done some more
testing and it seems the old version even hangs if I add some additional
printf's above and below, which makes me believe the problem is a bit
more complex than we realize...

--=20
 Ed Schouten 
 WWW: http://80386.nl/

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr7MyMACgkQ52SDGA2eCwX+0QCfZWieNhaeOSSXR4KVr1RUevAi
Hw0An3se8TacEY19/Uu/cHQkDV0DPmoF
=S41m
-----END PGP SIGNATURE-----

--XLsjFikA86nwwlhe--

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 22:33:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E54451065679;
	Wed, 11 Nov 2009 22:33:48 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194])
	by mx1.freebsd.org (Postfix) with ESMTP id 39E9C8FC16;
	Wed, 11 Nov 2009 22:33:47 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nABMXfbo099165
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 12 Nov 2009 00:33:41 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	nABMXftZ074107; Thu, 12 Nov 2009 00:33:41 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nABMXeEk074106; 
	Thu, 12 Nov 2009 00:33:40 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Thu, 12 Nov 2009 00:33:40 +0200
From: Kostik Belousov 
To: Ed Schouten 
Message-ID: <20091111223340.GF2331@deviant.kiev.zoral.com.ua>
References: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
	<20091111215651.GM64905@hoeg.nl>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="IIdFmnBmmFp+Aeao"
Content-Disposition: inline
In-Reply-To: <20091111215651.GM64905@hoeg.nl>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 22:33:49 -0000


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

On Wed, Nov 11, 2009 at 10:56:51PM +0100, Ed Schouten wrote:
> Hi,
>=20
> * Jun Kuriyama  wrote:
> > Can you test with these patches?  Testing on only one of both system
> > is enough.  "patch-1" forces disabling CLFLUSH feature even if SS bit
> > exists.  "patch-2" forces no CLFLUSH tweak.  I'd like to know with
> > which patch your system can live.
>=20
> For some reason they both seem to boot. Yikes. I've done some more
> testing and it seems the old version even hangs if I add some additional
> printf's above and below, which makes me believe the problem is a bit
> more complex than we realize...

The only thing I see now is that TUNABLE_INT declaration is not needed,
since SYSINIT is started after hammer_time(), so TUNABLE_FETCH is
processed after everything is done for BSP.

Wait, are your machines SMP ? Hmm, could you, please, remove TUNABLE_INT()
and see how it ends up ?

--IIdFmnBmmFp+Aeao
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr7O8QACgkQC3+MBN1Mb4jaHwCcC6woSO93ThwmaRa8IA/0KQJK
QGoAninWshUhnbCNQUp9q39gjGPoUd3w
=8CG0
-----END PGP SIGNATURE-----

--IIdFmnBmmFp+Aeao--

From owner-svn-src-head@FreeBSD.ORG  Wed Nov 11 23:13:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2614D106568F;
	Wed, 11 Nov 2009 23:13:26 +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 159F18FC0A;
	Wed, 11 Nov 2009 23:13:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nABNDOjN010522;
	Wed, 11 Nov 2009 23:13:24 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nABNDOGZ010520;
	Wed, 11 Nov 2009 23:13:24 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200911112313.nABNDOGZ010520@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Wed, 11 Nov 2009 23:13: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: r199205 - head/bin/sh
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 11 Nov 2009 23:13:26 -0000

Author: jilles
Date: Wed Nov 11 23:13:24 2009
New Revision: 199205
URL: http://svn.freebsd.org/changeset/base/199205

Log:
  sh: Use sigaction instead of signal/siginterrupt combination.

Modified:
  head/bin/sh/trap.c

Modified: head/bin/sh/trap.c
==============================================================================
--- head/bin/sh/trap.c	Wed Nov 11 22:37:17 2009	(r199204)
+++ head/bin/sh/trap.c	Wed Nov 11 23:13:24 2009	(r199205)
@@ -244,7 +244,8 @@ void
 setsignal(int signo)
 {
 	int action;
-	sig_t sig, sigact = SIG_DFL;
+	sig_t sigact = SIG_DFL;
+	struct sigaction sa;
 	char *t;
 
 	if ((t = trap[signo]) == NULL)
@@ -320,9 +321,10 @@ setsignal(int signo)
 		case S_IGN:	sigact = SIG_IGN;	break;
 	}
 	*t = action;
-	sig = signal(signo, sigact);
-	if (sig != SIG_ERR && action == S_CATCH)
-		siginterrupt(signo, 1);
+	sa.sa_handler = sigact;
+	sa.sa_flags = 0;
+	sigemptyset(&sa.sa_mask);
+	sigaction(signo, &sa, NULL);
 }
 
 

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 00:46:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC1911065672;
	Thu, 12 Nov 2009 00:46:28 +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 90F188FC18;
	Thu, 12 Nov 2009 00:46: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 nAC0kS6e012736;
	Thu, 12 Nov 2009 00:46:28 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC0kS2V012731;
	Thu, 12 Nov 2009 00:46:28 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200911120046.nAC0kS2V012731@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 12 Nov 2009 00:46: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: r199208 - in head/sys: conf libkern netinet
	netinet/libalias
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 00:46:28 -0000

Author: attilio
Date: Thu Nov 12 00:46:28 2009
New Revision: 199208
URL: http://svn.freebsd.org/changeset/base/199208

Log:
  Move inet_aton() (specular to inet_ntoa(), already present in libkern)
  into libkern in order to made it usable by other modules than alias_proxy.
  
  Obtained from:	Sandvine Incorporated
  Sponsored by:	Sandvine Incorporated
  MFC:		1 week

Added:
  head/sys/libkern/inet_aton.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/netinet/in.h
  head/sys/netinet/libalias/alias_proxy.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Nov 12 00:36:22 2009	(r199207)
+++ head/sys/conf/files	Thu Nov 12 00:46:28 2009	(r199208)
@@ -2193,6 +2193,7 @@ libkern/iconv_converter_if.m	optional li
 libkern/iconv_xlat.c		optional libiconv
 libkern/iconv_xlat16.c		optional libiconv
 libkern/index.c			standard
+libkern/inet_aton.c		standard
 libkern/inet_ntoa.c		standard
 libkern/mcount.c		optional profiling-routine
 libkern/memcmp.c		standard

Added: head/sys/libkern/inet_aton.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/libkern/inet_aton.c	Thu Nov 12 00:46:28 2009	(r199208)
@@ -0,0 +1,136 @@
+/*-
+ * Copyright (c) 2001 Charles Mott 
+ * 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 
+
+int
+inet_aton(const char *cp, struct in_addr *addr)
+{
+	u_long parts[4];
+	in_addr_t val;
+	const char *c;
+	char *endptr;
+	int gotend, n;
+
+	c = (const char *)cp;
+	n = 0;
+
+	/*
+	 * Run through the string, grabbing numbers until
+	 * the end of the string, or some error
+	 */
+	gotend = 0;
+	while (!gotend) {
+		unsigned long l;
+
+		l = strtoul(c, &endptr, 0);
+
+		if (l == ULONG_MAX || (l == 0 && endptr == c))
+			return (0);
+
+		val = (in_addr_t)l;
+
+		/*
+		 * If the whole string is invalid, endptr will equal
+		 * c.. this way we can make sure someone hasn't
+		 * gone '.12' or something which would get past
+		 * the next check.
+		 */
+		if (endptr == c)
+			return (0);
+		parts[n] = val;
+		c = endptr;
+
+		/* Check the next character past the previous number's end */
+		switch (*c) {
+		case '.' :
+
+			/* Make sure we only do 3 dots .. */
+			if (n == 3)	/* Whoops. Quit. */
+				return (0);
+			n++;
+			c++;
+			break;
+
+		case '\0':
+			gotend = 1;
+			break;
+
+		default:
+			if (isspace((unsigned char)*c)) {
+				gotend = 1;
+				break;
+			} else {
+
+				/* Invalid character, then fail. */
+				return (0);
+			}
+		}
+
+	}
+
+	/* Concoct the address according to the number of parts specified. */
+	switch (n) {
+	case 0:				/* a -- 32 bits */
+
+		/*
+		 * Nothing is necessary here.  Overflow checking was
+		 * already done in strtoul().
+		 */
+		break;
+	case 1:				/* a.b -- 8.24 bits */
+		if (val > 0xffffff || parts[0] > 0xff)
+			return (0);
+		val |= parts[0] << 24;
+		break;
+
+	case 2:				/* a.b.c -- 8.8.16 bits */
+		if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff)
+			return (0);
+		val |= (parts[0] << 24) | (parts[1] << 16);
+		break;
+
+	case 3:				/* a.b.c.d -- 8.8.8.8 bits */
+		if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff ||
+		    parts[2] > 0xff)
+			return (0);
+		val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
+		break;
+	}
+
+	if (addr != NULL)
+		addr->s_addr = htonl(val);
+	return (1);
+}
+

Modified: head/sys/netinet/in.h
==============================================================================
--- head/sys/netinet/in.h	Thu Nov 12 00:36:22 2009	(r199207)
+++ head/sys/netinet/in.h	Thu Nov 12 00:46:28 2009	(r199208)
@@ -713,6 +713,7 @@ int	 in_broadcast(struct in_addr, struct
 int	 in_canforward(struct in_addr);
 int	 in_localaddr(struct in_addr);
 int	 in_localip(struct in_addr);
+int	 inet_aton(const char *, struct in_addr *); /* in libkern */
 char	*inet_ntoa(struct in_addr); /* in libkern */
 char	*inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
 void	 in_ifdetach(struct ifnet *);

Modified: head/sys/netinet/libalias/alias_proxy.c
==============================================================================
--- head/sys/netinet/libalias/alias_proxy.c	Thu Nov 12 00:36:22 2009	(r199207)
+++ head/sys/netinet/libalias/alias_proxy.c	Thu Nov 12 00:46:28 2009	(r199208)
@@ -137,9 +137,6 @@ struct proxy_entry {
 				destination of a proxied IP packet
 */
 
-#ifdef	_KERNEL		/* XXX: can it be moved to libkern? */
-static int inet_aton(const char *cp, struct in_addr *addr);
-#endif
 static int	IpMask(int, struct in_addr *);
 static int	IpAddr(char *, struct in_addr *);
 static int	IpPort(char *, int, int *);
@@ -149,107 +146,6 @@ static int	RuleNumberDelete(struct libal
 static void	ProxyEncodeTcpStream(struct alias_link *, struct ip *, int);
 static void	ProxyEncodeIpHeader(struct ip *, int);
 
-#ifdef	_KERNEL
-static int
-inet_aton(cp, addr)
-        const char *cp;
-        struct in_addr *addr;
-{
-	u_long parts[4];
-	in_addr_t val;
-	const char *c;
-	char *endptr;
-	int gotend, n;
-
-	c = (const char *)cp;
-	n = 0;
-	/*
-	 * Run through the string, grabbing numbers until
-	 * the end of the string, or some error
-	 */
-	gotend = 0;
-	while (!gotend) {
-		unsigned long l;
-
-		l = strtoul(c, &endptr, 0);
-
-		if (l == ULONG_MAX || (l == 0 && endptr == c))
-			return (0);
-
-		val = (in_addr_t)l;
-		/*
-		 * If the whole string is invalid, endptr will equal
-		 * c.. this way we can make sure someone hasn't
-		 * gone '.12' or something which would get past
-		 * the next check.
-		 */
-		if (endptr == c)
-			return (0);
-		parts[n] = val;
-		c = endptr;
-
-		/* Check the next character past the previous number's end */
-		switch (*c) {
-		case '.' :
-			/* Make sure we only do 3 dots .. */
-			if (n == 3)	/* Whoops. Quit. */
-				return (0);
-			n++;
-			c++;
-			break;
-
-		case '\0':
-			gotend = 1;
-			break;
-
-		default:
-			if (isspace((unsigned char)*c)) {
-				gotend = 1;
-				break;
-			} else
-				return (0);	/* Invalid character, so fail */
-		}
-
-	}
-
-	/*
-	 * Concoct the address according to
-	 * the number of parts specified.
-	 */
-
-	switch (n) {
-	case 0:				/* a -- 32 bits */
-		/*
-		 * Nothing is necessary here.  Overflow checking was
-		 * already done in strtoul().
-		 */
-		break;
-	case 1:				/* a.b -- 8.24 bits */
-		if (val > 0xffffff || parts[0] > 0xff)
-			return (0);
-		val |= parts[0] << 24;
-		break;
-
-	case 2:				/* a.b.c -- 8.8.16 bits */
-		if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff)
-			return (0);
-		val |= (parts[0] << 24) | (parts[1] << 16);
-		break;
-
-	case 3:				/* a.b.c.d -- 8.8.8.8 bits */
-		if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff ||
-		    parts[2] > 0xff)
-			return (0);
-		val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
-		break;
-	}
-
-	if (addr != NULL)
-		addr->s_addr = htonl(val);
-	return (1);
-}
-#endif
-
 static int
 IpMask(int nbits, struct in_addr *mask)
 {

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 00:52:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1E5A106568F;
	Thu, 12 Nov 2009 00:52:14 +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 A0FE48FC1D;
	Thu, 12 Nov 2009 00:52: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 nAC0qEE1012883;
	Thu, 12 Nov 2009 00:52:14 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC0qEjC012881;
	Thu, 12 Nov 2009 00:52:14 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200911120052.nAC0qEjC012881@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 12 Nov 2009 00:52: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: r199209 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 00:52:14 -0000

Author: attilio
Date: Thu Nov 12 00:52:14 2009
New Revision: 199209
URL: http://svn.freebsd.org/changeset/base/199209

Log:
  The building the dev nameunit string, in devclass_add_device() is based
  on the assumption that the unit linked with the device is invariant but
  that can change when calling devclass_alloc_unit() (because -1 is passed
  or, more simply, because the unit choosen is beyond the table limits).
  This results in a completely bogus string building.
  
  Fix this by reserving the necessary room for all the possible characters
  printable by a positive integer (we do not allow for negative unit
  number).
  
  Reported by:	Sandvine Incorporated
  Reviewed by:	emaste
  Sponsored by:	Sandvine Incorporated
  MFC:		1 week

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Thu Nov 12 00:46:28 2009	(r199208)
+++ head/sys/kern/subr_bus.c	Thu Nov 12 00:52:14 2009	(r199209)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1584,7 +1585,7 @@ devclass_add_device(devclass_t dc, devic
 
 	PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc)));
 
-	buflen = snprintf(NULL, 0, "%s%d$", dc->name, dev->unit);
+	buflen = snprintf(NULL, 0, "%s%d$", dc->name, INT_MAX);
 	if (buflen < 0)
 		return (ENOMEM);
 	dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 01:22:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1F6C106566B;
	Thu, 12 Nov 2009 01:22:05 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com
	[209.85.220.227])
	by mx1.freebsd.org (Postfix) with ESMTP id E03EB8FC12;
	Thu, 12 Nov 2009 01:22:04 +0000 (UTC)
Received: by fxm27 with SMTP id 27so1801266fxm.3
	for ; Wed, 11 Nov 2009 17:22:03 -0800 (PST)
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
	:content-type; bh=r3SwY+1qetzwIhDEzZg36bCh7Z2/iP1SHpzCjnM+SlQ=;
	b=Cdj5VMrrIrSPqjX9NnD0e19r6C/FN1F6xrTW+UbJZs26a8b/lmGPyXUlCSm7ax1FXK
	SOBmeexoWpr29j2zJSXxwVQPvQf5BY8lrSIKtnXX5RU1NR9yWuiivzuae5JEIIxw42Rt
	oDtPCSdPLH1VI9upfVLMn0YgcznMW9+yiNZeA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type;
	b=nxoPZUO0bLZLYdrlvkuhJvxmxim2jN2OKwP7ScPdqo0HYguyDm4Fom/JLRWfAFy7KJ
	14LkesYmBPirRCZbRcpYgYK9QfF2CTHjxJ39bWA7uhwD4ZO6Ch7itYU3OdDpnPwoJOAJ
	LZ3ulP2tobNIwDb2mtyGPjX5WSZXq+VSKI8K4=
MIME-Version: 1.0
Sender: asmrookie@gmail.com
Received: by 10.223.2.69 with SMTP id 5mr319003fai.88.1257988923676; Wed, 11 
	Nov 2009 17:22:03 -0800 (PST)
In-Reply-To: <200911120052.nAC0qEjC012881@svn.freebsd.org>
References: <200911120052.nAC0qEjC012881@svn.freebsd.org>
Date: Thu, 12 Nov 2009 02:22:03 +0100
X-Google-Sender-Auth: 55a5a7d14c6603f1
Message-ID: <3bbf2fe10911111722j436d8b82oa66fb5cb581c7205@mail.gmail.com>
From: Attilio Rao 
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
Content-Type: text/plain; charset=UTF-8
Cc: 
Subject: Re: svn commit: r199209 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 01:22:05 -0000

2009/11/12 Attilio Rao :
> Author: attilio
> Date: Thu Nov 12 00:52:14 2009
> New Revision: 199209
> URL: http://svn.freebsd.org/changeset/base/199209
>
> Log:
>  The building the dev nameunit string, in devclass_add_device() is based
>  on the assumption that the unit linked with the device is invariant but
>  that can change when calling devclass_alloc_unit() (because -1 is passed
>  or, more simply, because the unit choosen is beyond the table limits).
>  This results in a completely bogus string building.
>
>  Fix this by reserving the necessary room for all the possible characters
>  printable by a positive integer (we do not allow for negative unit
>  number).
>
>  Reported by:  Sandvine Incorporated
>  Reviewed by:  emaste

Sorry, forgot to add:
reviewed by: jhb, imp

Attilio


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

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 01:30:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 40CEC106566C;
	Thu, 12 Nov 2009 01:30: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 2F7158FC13;
	Thu, 12 Nov 2009 01:30: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 nAC1UHCk013752;
	Thu, 12 Nov 2009 01:30:17 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC1UHbK013749;
	Thu, 12 Nov 2009 01:30:17 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200911120130.nAC1UHbK013749@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 12 Nov 2009 01:30: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: r199210 - head/sys/boot/common
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 01:30:18 -0000

Author: attilio
Date: Thu Nov 12 01:30:17 2009
New Revision: 199210
URL: http://svn.freebsd.org/changeset/base/199210

Log:
  Introduce a new option (BOOT_PROMPT_123) that lets enter the boot prompt
  only when typing the sequence "123" (opposite to the standard 'push any
  button' approach).
  That results useful when using serial lines sending garbage and leading
  to unwilling boot prompt appearence.
  
  Obtained from:	Sandvine Incorporated
  Reviewed by:	emaste, jhb
  Sponsored by:	Sandvine Incorporated
  MFC:		1 week

Modified:
  head/sys/boot/common/Makefile.inc
  head/sys/boot/common/boot.c

Modified: head/sys/boot/common/Makefile.inc
==============================================================================
--- head/sys/boot/common/Makefile.inc	Thu Nov 12 00:52:14 2009	(r199209)
+++ head/sys/boot/common/Makefile.inc	Thu Nov 12 01:30:17 2009	(r199210)
@@ -38,4 +38,8 @@ MAN+=	../forth/loader.conf.5
 MAN+=	../forth/loader.4th.8
 .endif
 
+.if defined(BOOT_PROMPT_123)
+CFLAGS+=	-DBOOT_PROMPT_123
+.endif
+
 MAN+=	loader.8

Modified: head/sys/boot/common/boot.c
==============================================================================
--- head/sys/boot/common/boot.c	Thu Nov 12 00:52:14 2009	(r199209)
+++ head/sys/boot/common/boot.c	Thu Nov 12 01:30:17 2009	(r199210)
@@ -162,6 +162,9 @@ autoboot(int timeout, char *prompt)
     int		c, yes;
     char	*argv[2], *cp, *ep;
     char	*kernelname;
+#ifdef BOOT_PROMPT_123
+    const char	*seq = "123", *p = seq;
+#endif
 
     autoboot_tried = 1;
 
@@ -192,14 +195,29 @@ autoboot(int timeout, char *prompt)
 
         yes = 0;
 
+#ifdef BOOT_PROMPT_123
+        printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or "
+	    "1 2 3 sequence for command prompt." : prompt);
+#else
         printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt);
+#endif
 
         for (;;) {
 	    if (ischar()) {
 	        c = getchar();
+#ifdef BOOT_PROMPT_123
+		if ((c == '\r') || (c == '\n')) {
+			yes = 1;
+			break;
+		} else if (c != *p++)
+			p = seq;
+		if (*p == 0)
+			break;
+#else
 	        if ((c == '\r') || (c == '\n'))
 		    yes = 1;
 	        break;
+#endif
 	    }
 	    ntime = time(NULL);
 	    if (ntime >= when) {

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 01:33:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09BCA1065672;
	Thu, 12 Nov 2009 01:33:58 +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 E307C8FC26;
	Thu, 12 Nov 2009 01:33: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 nAC1Xvtg013870;
	Thu, 12 Nov 2009 01:33:57 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC1Xvim013866;
	Thu, 12 Nov 2009 01:33:57 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911120133.nAC1Xvim013866@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 12 Nov 2009 01:33: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: r199211 - head/tools/regression/lib/libutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 01:33:58 -0000

Author: des
Date: Thu Nov 12 01:33:57 2009
New Revision: 199211
URL: http://svn.freebsd.org/changeset/base/199211

Log:
  Fix warnings

Modified:
  head/tools/regression/lib/libutil/test-grp.c
  head/tools/regression/lib/libutil/test-trimdomain-nodomain.c
  head/tools/regression/lib/libutil/test-trimdomain.c

Modified: head/tools/regression/lib/libutil/test-grp.c
==============================================================================
--- head/tools/regression/lib/libutil/test-grp.c	Thu Nov 12 01:30:17 2009	(r199210)
+++ head/tools/regression/lib/libutil/test-grp.c	Thu Nov 12 01:33:57 2009	(r199211)
@@ -64,7 +64,7 @@ build_grp(struct group *grp)
 
 
 int
-main(int argc, char **argv)
+main(void)
 {
 	char *strGrp;
 	int testNdx;

Modified: head/tools/regression/lib/libutil/test-trimdomain-nodomain.c
==============================================================================
--- head/tools/regression/lib/libutil/test-trimdomain-nodomain.c	Thu Nov 12 01:30:17 2009	(r199210)
+++ head/tools/regression/lib/libutil/test-trimdomain-nodomain.c	Thu Nov 12 01:33:57 2009	(r199211)
@@ -47,7 +47,8 @@ int tests = 0;
  * This makes the tests much easier to write and less likely to fail on
  * oddly configured systems.
  */
-int gethostname(char *name, size_t namelen)
+int
+gethostname(char *name, size_t namelen)
 {
 	if (strlcpy(name, TESTFQDN, namelen) > namelen) {
 		errno = ENAMETOOLONG;
@@ -63,7 +64,7 @@ testit(const char *input, int hostsize, 
 	const char *expected = (output == NULL) ? input : output;
 
 	testhost = strdup(input);
-	trimdomain(testhost, hostsize < 0 ? strlen(testhost) : hostsize);
+	trimdomain(testhost, hostsize < 0 ? (int)strlen(testhost) : hostsize);
 	tests++;
 	if (strcmp(testhost, expected) != 0) {
 		printf("not ok %d - %s\n", tests, test);
@@ -75,7 +76,7 @@ testit(const char *input, int hostsize, 
 }
 
 int
-main (int argc, char **argv)
+main(void)
 {
 
 	printf("1..5\n");

Modified: head/tools/regression/lib/libutil/test-trimdomain.c
==============================================================================
--- head/tools/regression/lib/libutil/test-trimdomain.c	Thu Nov 12 01:30:17 2009	(r199210)
+++ head/tools/regression/lib/libutil/test-trimdomain.c	Thu Nov 12 01:33:57 2009	(r199211)
@@ -47,7 +47,8 @@ int tests = 0;
  * This makes the tests much easier to write and less likely to fail on
  * oddly configured systems.
  */
-int gethostname(char *name, size_t namelen)
+int
+gethostname(char *name, size_t namelen)
 {
 	if (strlcpy(name, TESTFQDN, namelen) > namelen) {
 		errno = ENAMETOOLONG;
@@ -63,7 +64,7 @@ testit(const char *input, int hostsize, 
 	const char *expected = (output == NULL) ? input : output;
 
 	testhost = strdup(input);
-	trimdomain(testhost, hostsize < 0 ? strlen(testhost) : hostsize);
+	trimdomain(testhost, hostsize < 0 ? (int)strlen(testhost) : hostsize);
 	tests++;
 	if (strcmp(testhost, expected) != 0) {
 		printf("not ok %d - %s\n", tests, test);
@@ -75,7 +76,7 @@ testit(const char *input, int hostsize, 
 }
 
 int
-main (int argc, char **argv)
+main(void)
 {
 
 	printf("1..5\n");

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 01:34:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A094B106566B;
	Thu, 12 Nov 2009 01:34:55 +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 8F7E58FC12;
	Thu, 12 Nov 2009 01:34: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 nAC1Ytxt013924;
	Thu, 12 Nov 2009 01:34:55 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC1YtCn013922;
	Thu, 12 Nov 2009 01:34:55 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911120134.nAC1YtCn013922@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 12 Nov 2009 01:34: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: r199212 - head/tools/regression/lib/libutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 01:34:55 -0000

Author: des
Date: Thu Nov 12 01:34:55 2009
New Revision: 199212
URL: http://svn.freebsd.org/changeset/base/199212

Log:
  Fix warnings and remove one unnecessary use of vfork().  The other could
  also be removed with a little more work.

Modified:
  head/tools/regression/lib/libutil/test-flopen.c

Modified: head/tools/regression/lib/libutil/test-flopen.c
==============================================================================
--- head/tools/regression/lib/libutil/test-flopen.c	Thu Nov 12 01:33:57 2009	(r199211)
+++ head/tools/regression/lib/libutil/test-flopen.c	Thu Nov 12 01:34:55 2009	(r199212)
@@ -28,11 +28,11 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -169,16 +169,10 @@ test_flopen_lock_child(void)
 			_exit(0);
 		}
 		close(fd1);
-		fd2 = -42;
-		if (vfork() == 0) {
-			fd2 = flopen(fn, O_RDWR|O_NONBLOCK);
+		if ((fd2 = flopen(fn, O_RDWR|O_NONBLOCK)) != -1) {
+			result = "second open succeeded";
 			close(fd2);
-			_exit(0);
 		}
-		if (fd2 == -42)
-			result = "vfork() doesn't work as expected";
-		if (fd2 >= 0)
-			result = "second open succeeded";
 		kill(pid, SIGINT);
 	}
 	unlink(fn);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 01:37:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 527E2106566C;
	Thu, 12 Nov 2009 01:37:03 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 40A958FC1D;
	Thu, 12 Nov 2009 01:37: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 nAC1b3oQ014022;
	Thu, 12 Nov 2009 01:37:03 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC1b3wX014020;
	Thu, 12 Nov 2009 01:37:03 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911120137.nAC1b3wX014020@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 12 Nov 2009 01:37: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: r199213 - head/tools/regression/lib/libutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 01:37:03 -0000

Author: des
Date: Thu Nov 12 01:37:02 2009
New Revision: 199213
URL: http://svn.freebsd.org/changeset/base/199213

Log:
  Test cases for pidfile(3) - including two designed to catch issues arising
  from the incorrect use of fcntl(2) instead of flock(2).

Added:
  head/tools/regression/lib/libutil/test-pidfile.c   (contents, props changed)

Added: head/tools/regression/lib/libutil/test-pidfile.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/lib/libutil/test-pidfile.c	Thu Nov 12 01:37:02 2009	(r199213)
@@ -0,0 +1,280 @@
+/*-
+ * Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav
+ * 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
+ *    in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/*
+ * We need a signal handler so kill(2) will interrupt our child's
+ * select(2) instead of killing it.
+ */
+static void
+signal_handler(int sig)
+{
+	(void)sig;
+}
+
+/*
+ * Test that pidfile_open() can create a pidfile and that pidfile_write()
+ * can write to it.
+ */
+static const char *
+test_pidfile_uncontested(void)
+{
+	const char *fn = "test_pidfile_uncontested";
+	struct pidfh *pf;
+	pid_t other = 0;
+
+	unlink(fn);
+	pf = pidfile_open(fn, 0600, &other);
+	if (pf == NULL && other != 0)
+		return ("pidfile exists and is locked");
+	if (pf == NULL)
+		return (strerror(errno));
+	if (pidfile_write(pf) != 0) {
+		pidfile_close(pf);
+		unlink(fn);
+		return ("failed to write PID");
+	}
+	pidfile_close(pf);
+	unlink(fn);
+	return (NULL);
+}
+
+/*
+ * Test that pidfile_open() locks against self.
+ */
+static const char *
+test_pidfile_self(void)
+{
+	const char *fn = "test_pidfile_self";
+	struct pidfh *pf1, *pf2;
+	pid_t other = 0;
+	int serrno;
+
+	unlink(fn);
+	pf1 = pidfile_open(fn, 0600, &other);
+	if (pf1 == NULL && other != 0)
+		return ("pidfile exists and is locked");
+	if (pf1 == NULL)
+		return (strerror(errno));
+	if (pidfile_write(pf1) != 0) {
+		serrno = errno;
+		pidfile_close(pf1);
+		unlink(fn);
+		return (strerror(serrno));
+	}
+	// second open should fail
+	pf2 = pidfile_open(fn, 0600, &other);
+	if (pf2 != NULL) {
+		pidfile_close(pf1);
+		pidfile_close(pf2);
+		unlink(fn);
+		return ("managed to opened pidfile twice");
+	}
+	if (other != getpid()) {
+		pidfile_close(pf1);
+		unlink(fn);
+		return ("pidfile contained wrong PID");
+	}
+	pidfile_close(pf1);
+	unlink(fn);
+	return (NULL);
+}
+
+/*
+ * Common code for test_pidfile_{contested,inherited}.
+ */
+static const char *
+common_test_pidfile_child(const char *fn, int parent_open)
+{
+	struct pidfh *pf = NULL;
+	pid_t other = 0, pid = 0;
+	int fd[2], serrno, status;
+	char ch;
+
+	unlink(fn);
+	if (pipe(fd) != 0)
+		return (strerror(errno));
+
+	if (parent_open) {
+		pf = pidfile_open(fn, 0600, &other);
+		if (pf == NULL && other != 0)
+			return ("pidfile exists and is locked");
+		if (pf == NULL)
+			return (strerror(errno));
+	}
+
+	pid = fork();
+	if (pid == -1)
+		return (strerror(errno));
+	if (pid == 0) {
+		// child
+		close(fd[0]);
+		signal(SIGINT, signal_handler);
+		if (!parent_open) {
+			pf = pidfile_open(fn, 0600, &other);
+			if (pf == NULL && other != 0)
+				return ("pidfile exists and is locked");
+			if (pf == NULL)
+				return (strerror(errno));
+		}
+		if (pidfile_write(pf) != 0) {
+			serrno = errno;
+			pidfile_close(pf);
+			unlink(fn);
+			return (strerror(serrno));
+		}
+		if (pf == NULL)
+			_exit(1);
+		if (pidfile_write(pf) != 0)
+			_exit(1);
+		if (write(fd[1], "*", 1) != 1)
+			_exit(1);
+		select(0, 0, 0, 0, 0);
+		_exit(0);
+	}
+	// parent
+	close(fd[1]);
+	if (pf)
+		pidfile_close(pf);
+
+	// wait for the child to signal us
+	if (read(fd[0], &ch, 1) != 1) {
+		serrno = errno;
+		unlink(fn);
+		kill(pid, SIGTERM);
+		errno = serrno;
+		return (strerror(errno));
+	}
+
+	// We shouldn't be able to lock the same pidfile as our child
+	pf = pidfile_open(fn, 0600, &other);
+	if (pf != NULL) {
+		pidfile_close(pf);
+		unlink(fn);
+		return ("managed to lock contested pidfile");
+	}
+
+	// Failed to lock, but not because it was contested
+	if (other == 0) {
+		unlink(fn);
+		return (strerror(errno));
+	}
+
+	// Locked by the wrong process
+	if (other != pid) {
+		unlink(fn);
+		return ("pidfile contained wrong PID");
+	}
+
+	// check our child's fate
+	if (pf)
+		pidfile_close(pf);
+	unlink(fn);
+	if (kill(pid, SIGINT) != 0)
+		return (strerror(errno));
+	if (waitpid(pid, &status, 0) == -1)
+		return (strerror(errno));
+	if (WIFSIGNALED(status))
+		return ("child caught signal");
+	if (WEXITSTATUS(status) != 0) 
+		return ("child returned non-zero status");
+
+	// success
+	return (NULL);
+}
+
+/*
+ * Test that pidfile_open() fails when attempting to open a pidfile that
+ * is already locked, and that it returns the correct PID.
+ */
+static const char *
+test_pidfile_contested(void)
+{
+	const char *fn = "test_pidfile_contested";
+	const char *result;
+
+	result = common_test_pidfile_child(fn, 0);
+	return (result);
+}
+
+/*
+ * Test that the pidfile lock is inherited.
+ */
+static const char *
+test_pidfile_inherited(void)
+{
+	const char *fn = "test_pidfile_inherited";
+	const char *result;
+
+	result = common_test_pidfile_child(fn, 1);
+	return (result);
+}
+
+static struct test {
+	const char *name;
+	const char *(*func)(void);
+} t[] = {
+	{ "pidfile_uncontested", test_pidfile_uncontested },
+	{ "pidfile_self", test_pidfile_self },
+	{ "pidfile_contested", test_pidfile_contested },
+	{ "pidfile_inherited", test_pidfile_inherited },
+};
+
+int
+main(void)
+{
+	const char *result;
+	int i, nt;
+
+	nt = sizeof(t) / sizeof(*t);
+	printf("1..%d\n", nt);
+	for (i = 0; i < nt; ++i) {
+		if ((result = t[i].func()) != NULL)
+			printf("not ok %d - %s # %s\n", i + 1,
+			    t[i].name, result);
+		else
+			printf("ok %d - %s\n", i + 1,
+			    t[i].name);
+	}
+	exit(0);
+}

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 01:37:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 630DE1065695;
	Thu, 12 Nov 2009 01:37: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 5252C8FC08;
	Thu, 12 Nov 2009 01: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 nAC1bP3D014064;
	Thu, 12 Nov 2009 01:37:25 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC1bP3Y014062;
	Thu, 12 Nov 2009 01:37:25 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911120137.nAC1bP3Y014062@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 12 Nov 2009 01:37:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199214 - head/tools/regression/lib/libutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 01:37:25 -0000

Author: des
Date: Thu Nov 12 01:37:25 2009
New Revision: 199214
URL: http://svn.freebsd.org/changeset/base/199214

Log:
  Add test-pidfile.c and increase warning level.

Modified:
  head/tools/regression/lib/libutil/Makefile

Modified: head/tools/regression/lib/libutil/Makefile
==============================================================================
--- head/tools/regression/lib/libutil/Makefile	Thu Nov 12 01:37:02 2009	(r199213)
+++ head/tools/regression/lib/libutil/Makefile	Thu Nov 12 01:37:25 2009	(r199214)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
-TESTS=	test-trimdomain test-trimdomain-nodomain test-flopen test-grp
-CFLAGS+= -g -Wall -lutil
+TESTS=	test-trimdomain test-trimdomain-nodomain test-flopen test-grp test-pidfile
+CFLAGS+= -g -Wall -Wextra -Werror -lutil
 
 .PHONY: tests
 tests: ${TESTS}

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 03:31:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EC64106566B;
	Thu, 12 Nov 2009 03:31:20 +0000 (UTC)
	(envelope-from kuriyama@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F18878FC0C;
	Thu, 12 Nov 2009 03:31: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 nAC3VJ75016613;
	Thu, 12 Nov 2009 03:31:19 GMT
	(envelope-from kuriyama@svn.freebsd.org)
Received: (from kuriyama@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC3VJtJ016610;
	Thu, 12 Nov 2009 03:31:19 GMT
	(envelope-from kuriyama@svn.freebsd.org)
Message-Id: <200911120331.nAC3VJtJ016610@svn.freebsd.org>
From: Jun Kuriyama 
Date: Thu, 12 Nov 2009 03:31: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: r199215 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 03:31:20 -0000

Author: kuriyama
Date: Thu Nov 12 03:31:19 2009
New Revision: 199215
URL: http://svn.freebsd.org/changeset/base/199215

Log:
  - Style nits.
  - Remove unneeded TUNABLE_INT().
  
  Suggested by:	avg, kib

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

Modified: head/sys/amd64/amd64/initcpu.c
==============================================================================
--- head/sys/amd64/amd64/initcpu.c	Thu Nov 12 01:37:25 2009	(r199214)
+++ head/sys/amd64/amd64/initcpu.c	Thu Nov 12 03:31:19 2009	(r199215)
@@ -53,7 +53,6 @@ SYSCTL_INT(_hw, OID_AUTO, instruction_ss
  *  1: force disable CLFLUSH
  */
 static int	hw_clflush_disable = -1;
-TUNABLE_INT("hw.clflush_disable", &hw_clflush_disable);
 
 int	cpu;			/* Are we 386, 386sx, 486, etc? */
 u_int	cpu_feature;		/* Feature flags */
@@ -185,7 +184,6 @@ initializecpu(void)
 	 * hw.clflush_disable tunable.  This may help Xen guest on some AMD
 	 * CPUs.
 	 */
-	if (hw_clflush_disable == 1) {
+	if (hw_clflush_disable == 1)
 		cpu_feature &= ~CPUID_CLFSH;
-	}
 }

Modified: head/sys/i386/i386/initcpu.c
==============================================================================
--- head/sys/i386/i386/initcpu.c	Thu Nov 12 01:37:25 2009	(r199214)
+++ head/sys/i386/i386/initcpu.c	Thu Nov 12 03:31:19 2009	(r199215)
@@ -81,7 +81,6 @@ SYSCTL_INT(_hw, OID_AUTO, instruction_ss
  *  1: force disable CLFLUSH
  */
 static int	hw_clflush_disable = -1;
-TUNABLE_INT("hw.clflush_disable", &hw_clflush_disable);
 
 /* Must *NOT* be BSS or locore will bzero these after setting them */
 int	cpu = 0;		/* Are we 386, 386sx, 486, etc? */
@@ -737,9 +736,8 @@ initializecpu(void)
 	 * hw.clflush_disable tunable.  This may help Xen guest on some AMD
 	 * CPUs.
 	 */
-	if (hw_clflush_disable == 1) {
+	if (hw_clflush_disable == 1)
 		cpu_feature &= ~CPUID_CLFSH;
-	}
 
 #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE)
 	/*

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 03:55:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69FC2106566B;
	Thu, 12 Nov 2009 03:55:41 +0000 (UTC)
	(envelope-from nparhar@gmail.com)
Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com
	[209.85.222.185])
	by mx1.freebsd.org (Postfix) with ESMTP id 2919F8FC12;
	Thu, 12 Nov 2009 03:55:40 +0000 (UTC)
Received: by pzk15 with SMTP id 15so1298198pzk.3
	for ; Wed, 11 Nov 2009 19:55:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=sxYmk77lcq70ap745/N7YwJ8csgXi3P90Ud4R/dxOKc=;
	b=Q5Gg0xk1lB5AIYCJuB7dXAtv2fHrzLuJN6a6hMVPkliZQqfGWLDs+toN3Qn9w+Zkvs
	FI+tijzIJFC4VtsvNpxfr5qukdzoeawbljgon0h7XjXnB1wEB2sqQzmPXhCUGvC//8Qm
	p4bJYZCUZuviDRSz4ipyQlk8uzyUbldboBySw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=qkhfs/2Qc0gLyj1XOFOe3CJOOoCYXTu0330TniNyiA5DBr8IliwzMc9nSFR0HXMTa+
	K5sCdD/aizcQASVZa7W89wJQnSFWZ2fq0f40+EYxf3i0d2+WKCB/5onGeaa8vrlAL+LZ
	GcnN63bjn/R6QNl9BiKDQrzkwrQ8QBLPDUqsg=
MIME-Version: 1.0
Received: by 10.142.120.1 with SMTP id s1mr248473wfc.245.1257998140621; Wed, 
	11 Nov 2009 19:55:40 -0800 (PST)
In-Reply-To: <200911120046.nAC0kS2V012731@svn.freebsd.org>
References: <200911120046.nAC0kS2V012731@svn.freebsd.org>
Date: Wed, 11 Nov 2009 19:55:40 -0800
Message-ID: 
From: Navdeep Parhar 
To: Attilio Rao 
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: r199208 - in head/sys: conf libkern netinet 
	netinet/libalias
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 03:55:41 -0000

This seems to break kernel builds.  Throwing away the private
inet_aton implementation inside krping.c will probably fix it.

/usr/src/sys/modules/rdma/krping/../../../contrib/rdma/krping/krping.c:117:
error: static declaration of 'inet_aton' follows non-static
declaration
@/netinet/in.h:716: error: previous declaration of 'inet_aton' was here
*** Error code 1

Regards,
Navdeep

On Wed, Nov 11, 2009 at 4:46 PM, Attilio Rao  wrote:
> Author: attilio
> Date: Thu Nov 12 00:46:28 2009
> New Revision: 199208
> URL: http://svn.freebsd.org/changeset/base/199208
>
> Log:
> =A0Move inet_aton() (specular to inet_ntoa(), already present in libkern)
> =A0into libkern in order to made it usable by other modules than alias_pr=
oxy.
>
> =A0Obtained from: =A0 =A0 =A0 =A0Sandvine Incorporated
> =A0Sponsored by: Sandvine Incorporated
> =A0MFC: =A0 =A0 =A0 =A0 =A01 week
>
> Added:
> =A0head/sys/libkern/inet_aton.c =A0 (contents, props changed)
> Modified:
> =A0head/sys/conf/files
> =A0head/sys/netinet/in.h
> =A0head/sys/netinet/libalias/alias_proxy.c
>
> Modified: head/sys/conf/files
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=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 Thu Nov 12 00:36:22 2009 =A0 =A0 =A0 =A0(r199207)
> +++ head/sys/conf/files Thu Nov 12 00:46:28 2009 =A0 =A0 =A0 =A0(r199208)
> @@ -2193,6 +2193,7 @@ libkern/iconv_converter_if.m =A0 =A0 =A0optional li
> =A0libkern/iconv_xlat.c =A0 =A0 =A0 =A0 =A0 optional libiconv
> =A0libkern/iconv_xlat16.c =A0 =A0 =A0 =A0 optional libiconv
> =A0libkern/index.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0standar=
d
> +libkern/inet_aton.c =A0 =A0 =A0 =A0 =A0 =A0standard
> =A0libkern/inet_ntoa.c =A0 =A0 =A0 =A0 =A0 =A0standard
> =A0libkern/mcount.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 optional profiling-routin=
e
> =A0libkern/memcmp.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 standard
>
> Added: head/sys/libkern/inet_aton.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added)
> +++ head/sys/libkern/inet_aton.c =A0 =A0 =A0 =A0Thu Nov 12 00:46:28 2009 =
=A0 =A0 =A0 =A0(r199208)
> @@ -0,0 +1,136 @@
> +/*-
> + * Copyright (c) 2001 Charles Mott 
> + * 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
> + * =A0 =A0notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + * =A0 =A0notice, this list of conditions and the following disclaimer i=
n the
> + * =A0 =A0documentation and/or other materials provided with the distrib=
ution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN=
D
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU=
RPOSE
> + * ARE DISCLAIMED. =A0IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LI=
ABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE=
NTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO=
DS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S=
TRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY=
 WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O=
F
> + * SUCH DAMAGE.
> + */
> +
> +#include 
> +__FBSDID("$FreeBSD$");
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +int
> +inet_aton(const char *cp, struct in_addr *addr)
> +{
> + =A0 =A0 =A0 u_long parts[4];
> + =A0 =A0 =A0 in_addr_t val;
> + =A0 =A0 =A0 const char *c;
> + =A0 =A0 =A0 char *endptr;
> + =A0 =A0 =A0 int gotend, n;
> +
> + =A0 =A0 =A0 c =3D (const char *)cp;
> + =A0 =A0 =A0 n =3D 0;
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Run through the string, grabbing numbers until
> + =A0 =A0 =A0 =A0* the end of the string, or some error
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 gotend =3D 0;
> + =A0 =A0 =A0 while (!gotend) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long l;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 l =3D strtoul(c, &endptr, 0);
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (l =3D=3D ULONG_MAX || (l =3D=3D 0 && en=
dptr =3D=3D c))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val =3D (in_addr_t)l;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If the whole string is invalid, endptr=
 will equal
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* c.. this way we can make sure someone =
hasn't
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* gone '.12' or something which would ge=
t past
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* the next check.
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (endptr =3D=3D c)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[n] =3D val;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 c =3D endptr;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Check the next character past the previo=
us number's end */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (*c) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '.' :
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure we only do 3 d=
ots .. */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (n =3D=3D 3) =A0 =A0 /* =
Whoops. Quit. */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n++;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 c++;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '\0':
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D 1;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 default:
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (isspace((unsigned char)=
*c)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D =
1;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else {
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Invalid =
character, then fail. */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 /* Concoct the address according to the number of parts spe=
cified. */
> + =A0 =A0 =A0 switch (n) {
> + =A0 =A0 =A0 case 0: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a -- 32 bits */
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Nothing is necessary here. =A0Overflow=
 checking was
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* already done in strtoul().
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 case 1: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a.b -- 8.24 bits */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffffff || parts[0] > 0xff)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D parts[0] << 24;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> +
> + =A0 =A0 =A0 case 2: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a.b.c -- 8.8.16 bits */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffff || parts[0] > 0xff || part=
s[1] > 0xff)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16=
);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> +
> + =A0 =A0 =A0 case 3: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a.b.c.d -- 8.8.8.8 bits */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xff || parts[0] > 0xff || parts[=
1] > 0xff ||
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[2] > 0xff)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16=
) | (parts[2] << 8);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 if (addr !=3D NULL)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr->s_addr =3D htonl(val);
> + =A0 =A0 =A0 return (1);
> +}
> +
>
> Modified: head/sys/netinet/in.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/netinet/in.h =A0 =A0 =A0 Thu Nov 12 00:36:22 2009 =A0 =A0 =
=A0 =A0(r199207)
> +++ head/sys/netinet/in.h =A0 =A0 =A0 Thu Nov 12 00:46:28 2009 =A0 =A0 =
=A0 =A0(r199208)
> @@ -713,6 +713,7 @@ int =A0in_broadcast(struct in_addr, struct
> =A0int =A0 =A0 in_canforward(struct in_addr);
> =A0int =A0 =A0 in_localaddr(struct in_addr);
> =A0int =A0 =A0 in_localip(struct in_addr);
> +int =A0 =A0 inet_aton(const char *, struct in_addr *); /* in libkern */
> =A0char =A0 *inet_ntoa(struct in_addr); /* in libkern */
> =A0char =A0 *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
> =A0void =A0 =A0in_ifdetach(struct ifnet *);
>
> Modified: head/sys/netinet/libalias/alias_proxy.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/netinet/libalias/alias_proxy.c =A0 =A0 Thu Nov 12 00:36:22 2=
009 =A0 =A0 =A0 =A0(r199207)
> +++ head/sys/netinet/libalias/alias_proxy.c =A0 =A0 Thu Nov 12 00:46:28 2=
009 =A0 =A0 =A0 =A0(r199208)
> @@ -137,9 +137,6 @@ struct proxy_entry {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0destinatio=
n of a proxied IP packet
> =A0*/
>
> -#ifdef _KERNEL =A0 =A0 =A0 =A0 /* XXX: can it be moved to libkern? */
> -static int inet_aton(const char *cp, struct in_addr *addr);
> -#endif
> =A0static int =A0 =A0 IpMask(int, struct in_addr *);
> =A0static int =A0 =A0 IpAddr(char *, struct in_addr *);
> =A0static int =A0 =A0 IpPort(char *, int, int *);
> @@ -149,107 +146,6 @@ static int =A0 =A0 =A0 =A0RuleNumberDelete(struct l=
ibal
> =A0static void =A0 =A0ProxyEncodeTcpStream(struct alias_link *, struct ip=
 *, int);
> =A0static void =A0 =A0ProxyEncodeIpHeader(struct ip *, int);
>
> -#ifdef _KERNEL
> -static int
> -inet_aton(cp, addr)
> - =A0 =A0 =A0 =A0const char *cp;
> - =A0 =A0 =A0 =A0struct in_addr *addr;
> -{
> - =A0 =A0 =A0 u_long parts[4];
> - =A0 =A0 =A0 in_addr_t val;
> - =A0 =A0 =A0 const char *c;
> - =A0 =A0 =A0 char *endptr;
> - =A0 =A0 =A0 int gotend, n;
> -
> - =A0 =A0 =A0 c =3D (const char *)cp;
> - =A0 =A0 =A0 n =3D 0;
> - =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0* Run through the string, grabbing numbers until
> - =A0 =A0 =A0 =A0* the end of the string, or some error
> - =A0 =A0 =A0 =A0*/
> - =A0 =A0 =A0 gotend =3D 0;
> - =A0 =A0 =A0 while (!gotend) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long l;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 l =3D strtoul(c, &endptr, 0);
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (l =3D=3D ULONG_MAX || (l =3D=3D 0 && en=
dptr =3D=3D c))
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val =3D (in_addr_t)l;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If the whole string is invalid, endptr=
 will equal
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* c.. this way we can make sure someone =
hasn't
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* gone '.12' or something which would ge=
t past
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* the next check.
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (endptr =3D=3D c)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[n] =3D val;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 c =3D endptr;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Check the next character past the previo=
us number's end */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (*c) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '.' :
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure we only do 3 d=
ots .. */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (n =3D=3D 3) =A0 =A0 /* =
Whoops. Quit. */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n++;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 c++;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '\0':
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D 1;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 default:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (isspace((unsigned char)=
*c)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D =
1;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);=
 =A0 =A0 /* Invalid character, so fail */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> -
> - =A0 =A0 =A0 }
> -
> - =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0* Concoct the address according to
> - =A0 =A0 =A0 =A0* the number of parts specified.
> - =A0 =A0 =A0 =A0*/
> -
> - =A0 =A0 =A0 switch (n) {
> - =A0 =A0 =A0 case 0: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a -- 32 bits */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Nothing is necessary here. =A0Overflow=
 checking was
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* already done in strtoul().
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 case 1: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a.b -- 8.24 bits */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffffff || parts[0] > 0xff)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D parts[0] << 24;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> - =A0 =A0 =A0 case 2: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a.b.c -- 8.8.16 bits */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffff || parts[0] > 0xff || part=
s[1] > 0xff)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16=
);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> - =A0 =A0 =A0 case 3: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* =
a.b.c.d -- 8.8.8.8 bits */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xff || parts[0] > 0xff || parts[=
1] > 0xff ||
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[2] > 0xff)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16=
) | (parts[2] << 8);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 }
> -
> - =A0 =A0 =A0 if (addr !=3D NULL)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr->s_addr =3D htonl(val);
> - =A0 =A0 =A0 return (1);
> -}
> -#endif
> -
> =A0static int
> =A0IpMask(int nbits, struct in_addr *mask)
> =A0{
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
>

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 05:06:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 623511065670;
	Thu, 12 Nov 2009 05:06:04 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au
	[211.29.132.193])
	by mx1.freebsd.org (Postfix) with ESMTP id A5D238FC1C;
	Thu, 12 Nov 2009 05:06:03 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c122-106-232-83.belrs3.nsw.optusnet.com.au [122.106.232.83])
	by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	nAC55GmW017225
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 12 Nov 2009 16:05:17 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id nAC55GBB015217;
	Thu, 12 Nov 2009 16:05:16 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id nAC55F14015216;
	Thu, 12 Nov 2009 16:05:15 +1100 (EST) (envelope-from peter)
Date: Thu, 12 Nov 2009 16:05:15 +1100
From: Peter Jeremy 
To: Bruce Evans 
Message-ID: <20091112050515.GA15002@server.vk2pj.dyndns.org>
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org>
	<4AF4B6B2.3090706@delphij.net>
	<20091111230915.B3510@besplex.bde.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND"
Content-Disposition: inline
In-Reply-To: <20091111230915.B3510@besplex.bde.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, Xin LI ,
	svn-src-all@freebsd.org, src-committers@freebsd.org, d@delphij.net
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 05:06:04 -0000


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

On 2009-Nov-11 23:22:36 +1100, Bruce Evans  wrote:
>On Fri, 6 Nov 2009, Xin LI wrote:
>> Will it sound reasonable to divide pcpu by ncpu and cap the number at 10=
0?
>
>I don't like that.  It would break scripts even more than units changes.
>It is hard for users to interpret too.  Suddenly, processes taking
>100% of 1 CPU would take 12.5% of 8 CPUs on a system with 8 CPUs, and
>different %CPU on systems with a different number of CPUs.

Solaris does this.  I found it particularly annoying for identifying
spinning, single-threaded processes - it's not as immediately obvious
that 1.6% CPU means a spinning process on a T5000, and the granularity
gets worse.

>Just print %CPU in %4.0f format when it is >=3D 99.5 (or whatever rounds
>to 100.0).  This works up to 999.5 %CPU.

Actually, %4.0f works up to 9999.5 %CPU because there's no '.' in the
result.  I think this is an excellent solution.  And since FreeBSD
currently has a hard limit of 64 CPUs, it's unlikely to be exceeded
for a while.

--=20
Peter Jeremy

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

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

iEYEARECAAYFAkr7l4sACgkQ/opHv/APuIcj9ACfR+Ducpm4YRXDe3PfwM1D+H7E
MbkAn0xiVXD1VR6SOsBdDzKmwK2oyvCd
=1XgZ
-----END PGP SIGNATURE-----

--d6Gm4EdcadzBjdND--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 06:48:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 805C1106574A;
	Thu, 12 Nov 2009 06:48:16 +0000 (UTC)
	(envelope-from antoine.brodin.freebsd@gmail.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155])
	by mx1.freebsd.org (Postfix) with ESMTP id 929928FC1C;
	Thu, 12 Nov 2009 06:48:15 +0000 (UTC)
Received: by fg-out-1718.google.com with SMTP id e12so1707900fga.13
	for ; Wed, 11 Nov 2009 22:48:14 -0800 (PST)
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=tPQDCmY/Qh29OjObjwpj6v4iF32DXKdOx4dwdlDJ2Po=;
	b=TwQN3suJAqNjC8YDgA6wSuPqo4CF9IulAtzo96XzOsAI3sa0wnhLqEcf5C5S9DpC9B
	Doxn/UTWkDXIbA6K6ras+7+/QuNe5jo5MOnQTEOSYFRRBlOBabE139u8TWvlQiBbMa7R
	RoAAiARHkaOdoaobcd/BbAZHIzSsCOyIPVfNw=
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=KSWzSmXUuUdm1ES5loZw91wMoC38XLVS9g9mg6/qYLKBDV+bCH2NpbZI4/7A7mQaT5
	6d7DSw+eTi0w7HPi2+RPU7b05f5rLIMN8qT3GizXPHDbCFXUOZvATyuIXbqGmPZh5zuN
	8jBSLXqX5izV+XYmNaqDS0/cOmBTB4fVpfFmM=
MIME-Version: 1.0
Sender: antoine.brodin.freebsd@gmail.com
Received: by 10.239.163.195 with SMTP id q3mr249422hbd.108.1258008494295; Wed, 
	11 Nov 2009 22:48:14 -0800 (PST)
In-Reply-To: <200911112130.nABLUw9b007768@svn.freebsd.org>
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
Date: Thu, 12 Nov 2009 07:48:14 +0100
X-Google-Sender-Auth: baa9159c7d642515
Message-ID: 
From: Antoine Brodin 
To: Xin LI 
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: r199201 - in head: contrib/libpcap sbin/ifconfig 
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 06:48:16 -0000

On Wed, Nov 11, 2009 at 10:30 PM, Xin LI  wrote:
> Author: delphij
> Date: Wed Nov 11 21:30:58 2009
> New Revision: 199201
> URL: http://svn.freebsd.org/changeset/base/199201
>
> Log:
> =A0Add interface description capability as inspired by OpenBSD.
>
> =A0MFC after: =A0 =A03 months
>
> Modified:
> =A0head/contrib/libpcap/inet.c
> =A0head/sbin/ifconfig/ifconfig.8
> =A0head/sbin/ifconfig/ifconfig.c
> =A0head/share/man/man4/netintro.4
> =A0head/sys/kern/kern_jail.c
> =A0head/sys/net/if.c
> =A0head/sys/net/if.h
> =A0head/sys/net/if_var.h
> =A0head/sys/sys/param.h
> =A0head/sys/sys/priv.h
> =A0head/sys/sys/sockio.h
...
> Modified: head/sys/net/if_var.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/net/if_var.h =A0 =A0 =A0 Wed Nov 11 21:18:27 2009 =A0 =A0 =
=A0 =A0(r199200)
> +++ head/sys/net/if_var.h =A0 =A0 =A0 Wed Nov 11 21:30:58 2009 =A0 =A0 =
=A0 =A0(r199201)
> @@ -198,6 +198,7 @@ struct ifnet {
> =A0 =A0 =A0 =A0void =A0 =A0*if_pf_kif;
> =A0 =A0 =A0 =A0void =A0 =A0*if_lagg; =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* lagg =
glue */
> =A0 =A0 =A0 =A0u_char =A0 if_alloctype; =A0 =A0 =A0 =A0 =A0/* if_type at =
time of allocation */
> + =A0 =A0 =A0 struct sbuf *if_description; =A0 =A0/* interface descriptio=
n */
>
> =A0 =A0 =A0 =A0/*
> =A0 =A0 =A0 =A0 * Spare fields are added so that we can modify sensitive =
data
> @@ -205,7 +206,7 @@ struct ifnet {
> =A0 =A0 =A0 =A0 * be used with care where binary compatibility is require=
d.
> =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0char =A0 =A0 if_cspare[3];
> - =A0 =A0 =A0 void =A0 =A0*if_pspare[8];
> + =A0 =A0 =A0 void =A0 =A0*if_pspare[7];
> =A0 =A0 =A0 =A0int =A0 =A0 if_ispare[4];
> =A0};

Hi Delphij,

Doesn't this break ABI gratuitously?  (I think it changes the size of
struct ifnet)

Cheers,

Antoine

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 07:51:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 624111065693;
	Thu, 12 Nov 2009 07:51:59 +0000 (UTC) (envelope-from flo@smeets.im)
Received: from mail.solomo.de (mail.solomo.de [85.214.49.72])
	by mx1.freebsd.org (Postfix) with ESMTP id 182058FC17;
	Thu, 12 Nov 2009 07:51:58 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by mail.solomo.de (Postfix) with ESMTP id D06CB3F593;
	Thu, 12 Nov 2009 08:41:13 +0100 (CET)
X-Virus-Scanned: amavisd-new at vistream.de
Received: from mail.solomo.de ([127.0.0.1])
	by localhost (mail.solomo.de [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id NRp6oPgG1G+c; Thu, 12 Nov 2009 08:41:10 +0100 (CET)
Received: from nibbler.vistream.local (relay3.vistream.de [87.139.10.28])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.solomo.de (Postfix) with ESMTPSA id 3125D3F4E1;
	Thu, 12 Nov 2009 08:41:10 +0100 (CET)
Message-ID: <4AFBBC15.8080101@smeets.im>
Date: Thu, 12 Nov 2009 08:41:09 +0100
From: Florian Smeets 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.1.6pre) Gecko/20091110 Lightning/1.0pre Shredder/3.0pre
MIME-Version: 1.0
To: Ed Schouten 
References: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
	<20091111215651.GM64905@hoeg.nl>
In-Reply-To: <20091111215651.GM64905@hoeg.nl>
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, Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 07:51:59 -0000

On 11/11/09 10:56 PM, Ed Schouten wrote:
> Hi,
>
> * Jun Kuriyama  wrote:
>> Can you test with these patches?  Testing on only one of both system
>> is enough.  "patch-1" forces disabling CLFLUSH feature even if SS bit
>> exists.  "patch-2" forces no CLFLUSH tweak.  I'd like to know with
>> which patch your system can live.
>
> For some reason they both seem to boot. Yikes. I've done some more
> testing and it seems the old version even hangs if I add some additional
> printf's above and below, which makes me believe the problem is a bit
> more complex than we realize...
>

FWIW, this also breaks my Intel Atom 330 setup.

CPU: Intel(R) Atom(TM) CPU  330   @ 1.60GHz (1606.47-MHz K8-class CPU)
   Origin = "GenuineIntel"  Id = 0x106c2  Stepping = 2
 
Features=0xbfe9fbff
   Features2=0x40e31d>
   AMD Features=0x20100800
   AMD Features2=0x1

r199066 boots, r199067 does not.

I get a page fault:

SMP: AP CPU #1 Launched!
SMP: AP CPU #2 Launched!
SMP: AP CPU #3 Launched!


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address	= 0x288
fault code		= supervisor read data, page not present
instruction pointer	= 0x20:0xffffffff802b014e
stack pointer	        = 0x28:0xffffffff8083db30
frame pointer	        = 0x28:0xffffffff8083db50
code segment		= base 0x0, limit 0xfffff, type 0x1b
			= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags	= interrupt enabled, resume, IOPL = 0
current process		= 0 (swapper)

You can have a look at the backtrace here: 
http://smeets.im/~flo/panic_20091109.jpg

I also tried r199215, it does not help. The back trace looks almost the 
same (http://smeets.im/~flo/panic_20091112.JPG)

I can try the proposed patches tonight if it helps.

Cheers,
Florian

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 10:59:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0F2271065672;
	Thu, 12 Nov 2009 10:59:01 +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 F21A48FC08;
	Thu, 12 Nov 2009 10:59: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 nACAx0Ek028575;
	Thu, 12 Nov 2009 10:59:00 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACAx0LE028572;
	Thu, 12 Nov 2009 10:59:00 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200911121059.nACAx0LE028572@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 12 Nov 2009 10: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: r199219 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 10:59:01 -0000

Author: nyan
Date: Thu Nov 12 10:59:00 2009
New Revision: 199219
URL: http://svn.freebsd.org/changeset/base/199219

Log:
  Fix cpu model for PODP5V83.  It is P24T, not P54T.
  Also remove redundant 'Overdrive' word.
  
  Pointed out by:	SATOU Tomokazu (tomo1770 at maple ocn ne jp)
  MFC after:	1 week

Modified:
  head/sys/i386/i386/identcpu.c

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Thu Nov 12 10:44:29 2009	(r199218)
+++ head/sys/i386/i386/identcpu.c	Thu Nov 12 10:59:00 2009	(r199219)
@@ -265,7 +265,7 @@ printcpuinfo(void)
 				        strcat(cpu_model, "/P54C");
 					break;
 				case 0x30:
-				        strcat(cpu_model, "/P54T Overdrive");
+				        strcat(cpu_model, "/P24T");
 					break;
 				case 0x40:
 				        strcat(cpu_model, "/P55C");

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 11:27:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 217D3106566C;
	Thu, 12 Nov 2009 11:27:08 +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 0FBAA8FC1A;
	Thu, 12 Nov 2009 11:27: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 nACBR7Cv029234;
	Thu, 12 Nov 2009 11:27:07 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACBR7gn029232;
	Thu, 12 Nov 2009 11:27:07 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200911121127.nACBR7gn029232@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 12 Nov 2009 11:27: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: r199220 - head/sys/pc98/cbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 11:27:08 -0000

Author: nyan
Date: Thu Nov 12 11:27:07 2009
New Revision: 199220
URL: http://svn.freebsd.org/changeset/base/199220

Log:
  MFi386: revision 199104
  
    Make isa_dma functions MPSAFE by introducing its own private lock.

Modified:
  head/sys/pc98/cbus/cbus_dma.c

Modified: head/sys/pc98/cbus/cbus_dma.c
==============================================================================
--- head/sys/pc98/cbus/cbus_dma.c	Thu Nov 12 10:59:00 2009	(r199219)
+++ head/sys/pc98/cbus/cbus_dma.c	Thu Nov 12 11:27:07 2009	(r199220)
@@ -72,6 +72,8 @@ static u_int8_t	dma_bounced = 0;
 static u_int8_t	dma_busy = 0;		/* Used in isa_dmastart() */
 static u_int8_t	dma_inuse = 0;		/* User for acquire/release */
 static u_int8_t dma_auto_mode = 0;
+static struct mtx isa_dma_lock;
+MTX_SYSINIT(isa_dma_lock, &isa_dma_lock, "isa DMA lock", MTX_DEF);
 
 #define VALID_DMA_MASK (3)
 
@@ -93,22 +95,31 @@ isa_dma_init(int chan, u_int bouncebufsi
 		panic("isa_dma_init: impossible request"); 
 #endif
 
-	dma_bouncebufsize[chan] = bouncebufsize;
 
 	/* Try malloc() first.  It works better if it works. */
 	buf = malloc(bouncebufsize, M_DEVBUF, flag);
 	if (buf != NULL) {
-		if (isa_dmarangecheck(buf, bouncebufsize, chan) == 0) {
-			dma_bouncebuf[chan] = buf;
-			return (0);
+		if (isa_dmarangecheck(buf, bouncebufsize, chan) != 0) {
+			free(buf, M_DEVBUF);
+			buf = NULL;
 		}
-		free(buf, M_DEVBUF);
 	}
-	buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul, 0xfffffful,
+
+	if (buf == NULL) {
+		buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul, 0xfffffful,
 			   1ul, chan & 4 ? 0x20000ul : 0x10000ul);
+	}
+
 	if (buf == NULL)
 		return (ENOMEM);
+
+	mtx_lock(&isa_dma_lock);
+
+	dma_bouncebufsize[chan] = bouncebufsize;
 	dma_bouncebuf[chan] = buf;
+
+	mtx_unlock(&isa_dma_lock);
+
 	return (0);
 }
 
@@ -125,12 +136,15 @@ isa_dma_acquire(chan)
 		panic("isa_dma_acquire: channel out of range");
 #endif
 
+	mtx_lock(&isa_dma_lock);
 	if (dma_inuse & (1 << chan)) {
 		printf("isa_dma_acquire: channel %d already in use\n", chan);
+		mtx_unlock(&isa_dma_lock);
 		return (EBUSY);
 	}
 	dma_inuse |= (1 << chan);
 	dma_auto_mode &= ~(1 << chan);
+	mtx_unlock(&isa_dma_lock);
 
 	return (0);
 }
@@ -147,8 +161,11 @@ isa_dma_release(chan)
 	if (chan & ~VALID_DMA_MASK)
 		panic("isa_dma_release: channel out of range");
 
+	mtx_lock(&isa_dma_lock);
 	if ((dma_inuse & (1 << chan)) == 0)
 		printf("isa_dma_release: channel %d not in use\n", chan);
+#else
+	mtx_lock(&isa_dma_lock);
 #endif
 
 	if (dma_busy & (1 << chan)) {
@@ -163,6 +180,8 @@ isa_dma_release(chan)
 
 	dma_inuse &= ~(1 << chan);
 	dma_auto_mode &= ~(1 << chan);
+
+	mtx_unlock(&isa_dma_lock);
 }
 
 /*
@@ -175,8 +194,11 @@ isa_dmastart(int flags, caddr_t addr, u_
 	vm_paddr_t phys;
 	int waport;
 	caddr_t newaddr;
+	int dma_range_checked;
 
-	GIANT_REQUIRED;
+	/* translate to physical */
+	phys = pmap_extract(kernel_pmap, (vm_offset_t)addr);
+	dma_range_checked = isa_dmarangecheck(addr, nbytes, chan);
 
 #ifdef DIAGNOSTIC
 	if (chan & ~VALID_DMA_MASK)
@@ -186,8 +208,11 @@ isa_dmastart(int flags, caddr_t addr, u_
 	    || (chan >= 4 && (nbytes > (1<<17) || (u_int)addr & 1)))
 		panic("isa_dmastart: impossible request");
 
+	mtx_lock(&isa_dma_lock);
 	if ((dma_inuse & (1 << chan)) == 0)
 		printf("isa_dmastart: channel %d not acquired\n", chan);
+#else
+	mtx_lock(&isa_dma_lock);
 #endif
 
 #if 0
@@ -202,7 +227,7 @@ isa_dmastart(int flags, caddr_t addr, u_
 
 	dma_busy |= (1 << chan);
 
-	if (isa_dmarangecheck(addr, nbytes, chan)) {
+	if (dma_range_checked) {
 		if (dma_bouncebuf[chan] == NULL
 		    || dma_bouncebufsize[chan] < nbytes)
 			panic("isa_dmastart: bad bounce buffer"); 
@@ -215,9 +240,6 @@ isa_dmastart(int flags, caddr_t addr, u_
 		addr = newaddr;
 	}
 
-	/* translate to physical */
-	phys = pmap_extract(kernel_pmap, (vm_offset_t)addr);
-
 	if (flags & ISADMA_RAW) {
 	    dma_auto_mode |= (1 << chan);
 	} else { 
@@ -255,6 +277,8 @@ isa_dmastart(int flags, caddr_t addr, u_
 
 	/* unmask channel */
 	outb(DMA1_SMSK, chan);
+
+	mtx_unlock(&isa_dma_lock);
 }
 
 void
@@ -275,6 +299,7 @@ isa_dmadone(int flags, caddr_t addr, int
 		printf("isa_dmadone: channel %d not acquired\n", chan);
 #endif
 
+	mtx_lock(&isa_dma_lock);
 	if (((dma_busy & (1 << chan)) == 0) && 
 	    (dma_auto_mode & (1 << chan)) == 0 )
 		printf("isa_dmadone: channel %d not busy\n", chan);
@@ -290,6 +315,7 @@ isa_dmadone(int flags, caddr_t addr, int
 		dma_bounced &= ~(1 << chan);
 	}
 	dma_busy &= ~(1 << chan);
+	mtx_unlock(&isa_dma_lock);
 }
 
 /*
@@ -306,8 +332,6 @@ isa_dmarangecheck(caddr_t va, u_int leng
 	vm_offset_t endva;
 	u_int dma_pgmsk = (chan & 4) ?  ~(128*1024-1) : ~(64*1024-1);
 
-	GIANT_REQUIRED;
-
 	endva = (vm_offset_t)round_page((vm_offset_t)va + length);
 	for (; va < (caddr_t) endva ; va += PAGE_SIZE) {
 		phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va));
@@ -364,13 +388,15 @@ isa_dmarangecheck(caddr_t va, u_int leng
  * or -1 if the channel requested is not active.
  *
  */
-int
-isa_dmastatus(int chan)
+static int
+isa_dmastatus_locked(int chan)
 {
 	u_long	cnt = 0;
 	int	ffport, waport;
 	u_long	low1, high1, low2, high2;
 
+	mtx_assert(&isa_dma_lock, MA_OWNED);
+
 	/* channel active? */
 	if ((dma_inuse & (1 << chan)) == 0) {
 		printf("isa_dmastatus: channel %d not active\n", chan);
@@ -411,6 +437,18 @@ isa_dmastatus(int chan)
 	return(cnt);
 }
 
+int
+isa_dmastatus(int chan)
+{
+	int status;
+
+	mtx_lock(&isa_dma_lock);
+	status = isa_dmastatus_locked(chan);
+	mtx_unlock(&isa_dma_lock);
+
+	return (status);
+}
+
 /*
  * Reached terminal count yet ?
  */
@@ -427,19 +465,27 @@ isa_dmatc(int chan)
 int
 isa_dmastop(int chan) 
 {
+	int status;
+
+	mtx_lock(&isa_dma_lock);
 	if ((dma_inuse & (1 << chan)) == 0)
 		printf("isa_dmastop: channel %d not acquired\n", chan);  
 
 	if (((dma_busy & (1 << chan)) == 0) &&
 	    ((dma_auto_mode & (1 << chan)) == 0)) {
 		printf("chan %d not busy\n", chan);
+		mtx_unlock(&isa_dma_lock);
 		return -2 ;
 	}
     
 	if ((chan & 4) == 0)
 		outb(DMA1_SMSK, (chan & 3) | 4 /* disable mask */);
 
-	return(isa_dmastatus(chan));
+	status = isa_dmastatus_locked(chan);
+
+	mtx_unlock(&isa_dma_lock);
+
+	return (status);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 11:40:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5FA1106566B;
	Thu, 12 Nov 2009 11:40:06 +0000 (UTC)
	(envelope-from bzeeb-lists@lists.zabbadoz.net)
Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3])
	by mx1.freebsd.org (Postfix) with ESMTP id A160B8FC19;
	Thu, 12 Nov 2009 11:40:06 +0000 (UTC)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id CC31341C64C;
	Thu, 12 Nov 2009 12:40:05 +0100 (CET)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([192.168.74.103])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id 9L7IHvyYTh1R; Thu, 12 Nov 2009 12:40:05 +0100 (CET)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 6CBB341C612; Thu, 12 Nov 2009 12:40:05 +0100 (CET)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 783134448E6;
	Thu, 12 Nov 2009 11:38:13 +0000 (UTC)
Date: Thu, 12 Nov 2009 11:38:13 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Jun Kuriyama 
In-Reply-To: <200911090254.nA92sG1G005921@svn.freebsd.org>
Message-ID: <20091112113708.I37440@maildrop.int.zabbadoz.net>
References: <200911090254.nA92sG1G005921@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 11:40:07 -0000

On Mon, 9 Nov 2009, Jun Kuriyama wrote:

Hi,

> Author: kuriyama
> Date: Mon Nov  9 02:54:16 2009
> New Revision: 199067
> URL: http://svn.freebsd.org/changeset/base/199067
>
> Log:
>  - Add hw.clflush_disable loader tunable to avoid panic (trap 9) at
>    map_invalidate_cache_range() even if CPU is not Intel.
>  - This tunable can be set to -1 (default), 0 and 1.  -1 is same as
>    current behavior, which automatically disable CLFLUSH on Intel CPUs
>    without CPUID_SS (should be occured on Xen only).  You can specify 1
>    when this panic happened on non-Intel CPUs (such as AMD's).  Because
>    disabling CLFLUSH may reduce performance, you can try with setting 0
>    on Intel CPUs without SS to use CLFLUSH feature.

I wasn't able to boot dual Xeon machines anymore.

 	svn merge -c -199067 $FBDSVN/head/sys sys

fixed this problem.


-- 
Bjoern A. Zeeb         It will not break if you know what you are doing.

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 11:54:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 742831065672;
	Thu, 12 Nov 2009 11:54:13 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 631DE8FC1A;
	Thu, 12 Nov 2009 11:54:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nACBsDwQ029776;
	Thu, 12 Nov 2009 11:54:13 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACBsDX7029775;
	Thu, 12 Nov 2009 11:54:13 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911121154.nACBsDX7029775@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Thu, 12 Nov 2009 11:54: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: r199221 - head/lib/libc/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 11:54:13 -0000

Author: ume
Date: Thu Nov 12 11:54:12 2009
New Revision: 199221
URL: http://svn.freebsd.org/changeset/base/199221

Log:
  Add missing IEEE1394 support dropped during merge from NetBSD.

Modified:
  head/lib/libc/net/getnameinfo.c

Modified: head/lib/libc/net/getnameinfo.c
==============================================================================
--- head/lib/libc/net/getnameinfo.c	Thu Nov 12 11:27:07 2009	(r199220)
+++ head/lib/libc/net/getnameinfo.c	Thu Nov 12 11:54:12 2009	(r199221)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -385,6 +386,7 @@ getnameinfo_link(const struct sockaddr *
 {
 	const struct sockaddr_dl *sdl =
 	    (const struct sockaddr_dl *)(const void *)sa;
+	const struct fw_hwaddr *iha;
 	int n;
 
 	if (serv != NULL && servlen > 0)
@@ -400,6 +402,15 @@ getnameinfo_link(const struct sockaddr *
 	}
 
 	switch (sdl->sdl_type) {
+	case IFT_IEEE1394:
+		if (sdl->sdl_alen < sizeof(iha->sender_unique_ID_hi) +
+		    sizeof(iha->sender_unique_ID_lo))
+			return EAI_FAMILY;
+		iha = (const struct fw_hwaddr *)(const void *)LLADDR(sdl);
+		return hexname((const u_int8_t *)&iha->sender_unique_ID_hi,
+		    sizeof(iha->sender_unique_ID_hi) +
+		    sizeof(iha->sender_unique_ID_lo),
+		    host, hostlen);
 	/*
 	 * The following have zero-length addresses.
 	 * IFT_ATM	(net/if_atmsubr.c)

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 13:52:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C76EB1065696;
	Thu, 12 Nov 2009 13:52:12 +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 8ACB28FC17;
	Thu, 12 Nov 2009 13:52:12 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id B5CF71CDE9; Thu, 12 Nov 2009 14:52:11 +0100 (CET)
Date: Thu, 12 Nov 2009 14:52:11 +0100
From: Ed Schouten 
To: Xin LI 
Message-ID: <20091112135211.GT64905@hoeg.nl>
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="HC0F8i/BfMshQzR8"
Content-Disposition: inline
In-Reply-To: <200911112130.nABLUw9b007768@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 13:52:12 -0000


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

Hi,

* Xin LI  wrote:
> Modified: head/sys/net/if_var.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/net/if_var.h	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/sys/net/if_var.h	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -198,6 +198,7 @@ struct ifnet {
>  	void	*if_pf_kif;
>  	void	*if_lagg;		/* lagg glue */
>  	u_char	 if_alloctype;		/* if_type at time of allocation */
> +	struct sbuf *if_description;	/* interface description */
> =20
>  	/*
>  	 * Spare fields are added so that we can modify sensitive data
> @@ -205,7 +206,7 @@ struct ifnet {
>  	 * be used with care where binary compatibility is required.
>  	 */
>  	char	 if_cspare[3];
> -	void	*if_pspare[8];
> +	void	*if_pspare[7];
>  	int	if_ispare[4];
>  };

So there used to be four chars in a row here (between if_description and
if_cspare). Are you sure moving the pointer in between doesn't increase
the structure size?

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--HC0F8i/BfMshQzR8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr8EwsACgkQ52SDGA2eCwVoiACcDYc3d3KzLm0ycZBqFqXMuvW7
qzoAmgOI8tUIIo9Te5M9bltXF/5kj2WQ
=k0KH
-----END PGP SIGNATURE-----

--HC0F8i/BfMshQzR8--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 13:52:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1205106568D;
	Thu, 12 Nov 2009 13:52:41 +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 7E7338FC21;
	Thu, 12 Nov 2009 13:52:41 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 3673A46B46;
	Thu, 12 Nov 2009 08:52:41 -0500 (EST)
Date: Thu, 12 Nov 2009 13:52:41 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Xin LI 
In-Reply-To: <200911112130.nABLUw9b007768@svn.freebsd.org>
Message-ID: 
References: <200911112130.nABLUw9b007768@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: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 13:52:42 -0000


On Wed, 11 Nov 2009, Xin LI wrote:

> Author: delphij
> Date: Wed Nov 11 21:30:58 2009
> New Revision: 199201
> URL: http://svn.freebsd.org/changeset/base/199201
>
> Log:
>  Add interface description capability as inspired by OpenBSD.

Patches like this keep being proposed and rejected, so I was a bit surprised 
to see it hit the tree (but also see that I missed yet another thread on it on 
net@ in August, apparently).  Most of my thoughts on it are here:

   http://www.freebsd.org/cgi/query-pr.cgi?pr=83622

This commit seems to have quite a few problems, and would likely have 
benefited from further review before being committed.

> Modified: head/contrib/libpcap/inet.c
> ==============================================================================
> --- head/contrib/libpcap/inet.c	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/contrib/libpcap/inet.c	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -403,22 +403,30 @@ add_addr_to_iflist(pcap_if_t **alldevs,
> 	pcap_addr_t *curaddr, *prevaddr, *nextaddr;
> #ifdef SIOCGIFDESCR
> 	struct ifreq ifrdesc;
> +#ifdef __FreeBSD__
> +#define _IFDESCRSIZE 64

Seems like this should be #ifdef IFDESCRSIZE rather than ifdef FreeBSD?  Also, 
have you checked with upstream to see if autoconf foo wouldn't be preferred?

> +	char ifdescr[_IFDESCRSIZE];
> +#else
> 	char ifdescr[IFDESCRSIZE];
> -	int s;
> #endif
> +	int s;
>
> -#ifdef SIOCGIFDESCR
> 	/*
> 	 * Get the description for the interface.
> 	 */
> 	memset(&ifrdesc, 0, sizeof ifrdesc);
> 	strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
> +#ifdef __FreeBSD__
> +	ifrdesc.ifr_buffer.buffer = ifdescr;
> +	ifrdesc.ifr_buffer.length = _IFDESCRSIZE;
> +#else
> 	ifrdesc.ifr_data = (caddr_t)&ifdescr;

sizeof(ifdescr) would be more robust in the presence of future code changes.

> @@ -258,6 +258,12 @@ Disable permanently promiscuous mode.
> Another name for the
> .Fl alias
> parameter.
> +.It Cm description Ar value
> +Specify a description of the interface.
> +This can be used to label interfaces in situations where they may
> +otherwise be difficult to distinguish.
> +.It Cm -description
> +Clear the interface description.

Possibly a comment on length limits would be appropriate?

> Modified: head/sbin/ifconfig/ifconfig.c
> ==============================================================================
> --- head/sbin/ifconfig/ifconfig.c	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/sbin/ifconfig/ifconfig.c	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -83,6 +83,8 @@ static const char rcsid[] =
> struct	ifreq ifr;
>
> char	name[IFNAMSIZ];
> +char	*descr = NULL;
> +size_t	descrlen = 64;
> int	setaddr;
> int	setmask;
> int	doalias;
> @@ -822,6 +824,36 @@ setifname(const char *val, int dummy __u
> 	free(newname);
> }
>
> +/* ARGSUSED */
> +static void
> +setifdescr(const char *val, int dummy __unused, int s,
> +    const struct afswtch *afp)
> +{
> +	char *newdescr;
> +
> +	newdescr = strdup(val);
> +	if (newdescr == NULL) {
> +		warn("no memory to set ifdescr");
> +		return;
> +	}
> +	ifr.ifr_buffer.buffer = newdescr;
> +	ifr.ifr_buffer.length = strlen(newdescr);
> +	if (ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0) {
> +		warn("ioctl (set descr)");
> +		free(newdescr);
> +		return;

I'm confused about the semantics here: is ifr_buffer.buffer guaranteed to be 
nul-terminated or not?  In some cases the code seems to imply nul-termination 
(especially on the string coming back to userspace), but in other places (such 
as here), the nul termination is not included in the buffer.  It would be nice 
to consistently do one or the other, and given the way the code is written, I 
suggest always having the nul termination.

> @@ -866,6 +898,23 @@ status(const struct afswtch *afp, const
> 		printf(" mtu %d", ifr.ifr_mtu);
> 	putchar('\n');
>
> +	descr = reallocf(descr, descrlen);
> +	if (descr != NULL) {
> +		do {
> +			ifr.ifr_buffer.buffer = descr;
> +			ifr.ifr_buffer.length = descrlen;
> +			if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) {
> +			    if (strlen(descr) > 0)
> +				printf("\tdescription: %s\n", descr);

Here, we seem to assume that the buffer is nul-terminated.

> +			    break;
> +			}
> +			if (errno == ENAMETOOLONG) {
> +				descrlen *= 2;
> +				descr = reallocf(descr, descrlen);
> +			}
> +		} while (errno == ENAMETOOLONG);
> +	}

Shouldn't we be erroring out if reallocf() fails?  That seems to be normal 
practice elsewhere in ifconfig.

> Modified: head/sys/net/if.c
> ==============================================================================
> --- head/sys/net/if.c	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/sys/net/if.c	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -463,6 +463,8 @@ if_free_internal(struct ifnet *ifp)
> #ifdef MAC
> 	mac_ifnet_destroy(ifp);
> #endif /* MAC */
> +	if (ifp->if_description != NULL)
> +		sbuf_delete(ifp->if_description);
> 	IF_AFDATA_DESTROY(ifp);
> 	IF_ADDR_LOCK_DESTROY(ifp);
> 	ifq_delete(&ifp->if_snd);
> @@ -2090,6 +2092,45 @@ ifhwioctl(u_long cmd, struct ifnet *ifp,
> 		ifr->ifr_phys = ifp->if_physical;
> 		break;
>
> +	case SIOCGIFDESCR:
> +		IF_AFDATA_RLOCK(ifp);
> +		if (ifp->if_description == NULL)
> +			error = ENOMSG;
> +		else
> +			error = copystr(sbuf_data(ifp->if_description),
> +					ifr->ifr_buffer.buffer,
> +					ifr->ifr_buffer.length, NULL);
> +		IF_AFDATA_RUNLOCK(ifp);

Isn't copystr() for use only on kernel addresses, and isn't ifr_buffer a user 
address?  And if this is a user address, you can't access it while the 
IF_AFDATA lock is held.

> +	case SIOCSIFDESCR:
> +		error = priv_check(td, PRIV_NET_SETIFDESCR);
> +		if (error)
> +			return (error);
> +
> +		IF_AFDATA_WLOCK(ifp);

This is not really what this lock is for, perhaps it's time to introduce an 
actual per-if lock.

> +		if (ifp->if_description == NULL) {
> +			ifp->if_description = sbuf_new_auto();

Can't do potentially sleeping memory allocations with the afdata lock held.

> +			if (ifp->if_description == NULL) {
> +				error = ENOMEM;
> +				IF_AFDATA_WUNLOCK(ifp);
> +				break;
> +			}
> +		} else
> +			sbuf_clear(ifp->if_description);
> +
> +		if (sbuf_copyin(ifp->if_description, ifr->ifr_buffer.buffer,
> +				ifr->ifr_buffer.length) == -1)

Access to user addresses while holding the afdata lock isn't allowed.

Here, ifr_buffer.buffer is treated as non-nul-terminated.

Some administrative limit on string length here would be appropriate; perhaps 
128 bytes or 1024 bytes -- panicking because someone passes in a 1GB string by 
mistake in some C code is not what we want to do.

> Modified: head/sys/net/if.h
> ==============================================================================
> --- head/sys/net/if.h	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/sys/net/if.h	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -294,6 +294,7 @@ struct	ifreq {
> 		struct	sockaddr ifru_addr;
> 		struct	sockaddr ifru_dstaddr;
> 		struct	sockaddr ifru_broadaddr;
> +		struct { size_t length; caddr_t	buffer; } ifru_buffer;

While ifreq already contains a pointer, this adds two more fields that vary in 
size across 32/64-bit, making it more difficult to support in 32-bit processes 
on a 64-bit kernel.

> Modified: head/sys/net/if_var.h
> ==============================================================================
> --- head/sys/net/if_var.h	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/sys/net/if_var.h	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -198,6 +198,7 @@ struct ifnet {
> 	void	*if_pf_kif;
> 	void	*if_lagg;		/* lagg glue */
> 	u_char	 if_alloctype;		/* if_type at time of allocation */
> +	struct sbuf *if_description;	/* interface description */
>
> 	/*
> 	 * Spare fields are added so that we can modify sensitive data
> @@ -205,7 +206,7 @@ struct ifnet {
> 	 * be used with care where binary compatibility is required.
> 	 */
> 	char	 if_cspare[3];
> -	void	*if_pspare[8];
> +	void	*if_pspare[7];
> 	int	if_ispare[4];
> };

Could you confirm that ifnet hasn't changed size on arm, i386, and amd64? 
This looks like fairly dubious use of a spare field -- normally I'd expect to 
see if_cspare, which is 3 bytes long, remain after if_alloctype, and that 
pspare[0] be replaced in-place to prevent alignment decisions in the compiler 
from spacing out the structure further (i.e., adding another byte of padding 
on i386 and another 5 bytes of padding on amd64 after if_cspare and before 
if_pspare).

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:14:05 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 78953106566C;
	Thu, 12 Nov 2009 14:14:05 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
	[211.29.132.190])
	by mx1.freebsd.org (Postfix) with ESMTP id EA4A88FC12;
	Thu, 12 Nov 2009 14:14:04 +0000 (UTC)
Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au
	[220.239.235.116])
	by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	nACEDK9D027323
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 13 Nov 2009 01:13:21 +1100
Date: Fri, 13 Nov 2009 01:13:20 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Peter Jeremy 
In-Reply-To: <20091112050515.GA15002@server.vk2pj.dyndns.org>
Message-ID: <20091113010924.M1122@besplex.bde.org>
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org> <4AF4B6B2.3090706@delphij.net>
	<20091111230915.B3510@besplex.bde.org>
	<20091112050515.GA15002@server.vk2pj.dyndns.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: src-committers@FreeBSD.org, d@delphij.net, svn-src-all@FreeBSD.org,
	Xin LI , Bruce Evans ,
	svn-src-head@FreeBSD.org
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:14:05 -0000

On Thu, 12 Nov 2009, Peter Jeremy wrote:

> On 2009-Nov-11 23:22:36 +1100, Bruce Evans  wrote:
>> On Fri, 6 Nov 2009, Xin LI wrote:
>>> Will it sound reasonable to divide pcpu by ncpu and cap the number at 100?
>>
>> I don't like that.  It would break scripts even more than units changes.
>> It is hard for users to interpret too.  Suddenly, processes taking
>> 100% of 1 CPU would take 12.5% of 8 CPUs on a system with 8 CPUs, and
>> different %CPU on systems with a different number of CPUs.
>
> Solaris does this.  I found it particularly annoying for identifying
> spinning, single-threaded processes - it's not as immediately obvious
> that 1.6% CPU means a spinning process on a T5000, and the granularity
> gets worse.

We might eventually need an option for bug for bug compatibility with
Solaris(Olaris?)/POSIX.  A %cpu format could give the divided %CPU for
anyone that wants it sooner.

>> Just print %CPU in %4.0f format when it is >= 99.5 (or whatever rounds
>> to 100.0).  This works up to 999.5 %CPU.
>
> Actually, %4.0f works up to 9999.5 %CPU because there's no '.' in the
> result.  I think this is an excellent solution.  And since FreeBSD
> currently has a hard limit of 64 CPUs, it's unlikely to be exceeded
> for a while.

Oops.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:18:28 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C1441065679;
	Thu, 12 Nov 2009 14:18:28 +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 551168FC0C;
	Thu, 12 Nov 2009 14:18:28 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 0D43046B2C;
	Thu, 12 Nov 2009 09:18:28 -0500 (EST)
Date: Thu, 12 Nov 2009 14:18:27 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Bruce Evans 
In-Reply-To: <20091113010924.M1122@besplex.bde.org>
Message-ID: 
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org>
	<4AF4B6B2.3090706@delphij.net>
	<20091111230915.B3510@besplex.bde.org>
	<20091112050515.GA15002@server.vk2pj.dyndns.org>
	<20091113010924.M1122@besplex.bde.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: src-committers@FreeBSD.org, d@delphij.net,
	Peter Jeremy , svn-src-all@FreeBSD.org,
	Xin LI , svn-src-head@FreeBSD.org
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:18:28 -0000


On Fri, 13 Nov 2009, Bruce Evans wrote:

>>> Just print %CPU in %4.0f format when it is >= 99.5 (or whatever rounds to 
>>> 100.0).  This works up to 999.5 %CPU.
>> 
>> Actually, %4.0f works up to 9999.5 %CPU because there's no '.' in the 
>> result.  I think this is an excellent solution.  And since FreeBSD 
>> currently has a hard limit of 64 CPUs, it's unlikely to be exceeded for a 
>> while.
>
> Oops.

With 128-thread hardware just around the corner, we should be working to scrub 
assumption of 32 or 64 core limits wherever we find them.  I don't know what 
the next "reasonable" limit is, perhaps 1024, but arrays indexed by MAXCPU are 
becoming decreasingly useful in that light.  The dynamic per-CPU stuff for the 
kernel addresses some but not all of these problems.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:22:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EBC4E106566C;
	Thu, 12 Nov 2009 14:22:12 +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 C0D768FC15;
	Thu, 12 Nov 2009 14:22:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nACEMCa9032696;
	Thu, 12 Nov 2009 14:22:12 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACEMCAA032694;
	Thu, 12 Nov 2009 14:22:12 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200911121422.nACEMCAA032694@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 12 Nov 2009 14:22:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199223 - head/sys/contrib/rdma/krping
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:22:13 -0000

Author: attilio
Date: Thu Nov 12 14:22:12 2009
New Revision: 199223
URL: http://svn.freebsd.org/changeset/base/199223

Log:
  Remove the explicit definition of inet_aton() as it was introduced as a
  general function in r199208.
  
  Reported by:	np
  Sponsored by:	Sandvine Incorporated
  MFC:		1 week

Modified:
  head/sys/contrib/rdma/krping/krping.c

Modified: head/sys/contrib/rdma/krping/krping.c
==============================================================================
--- head/sys/contrib/rdma/krping/krping.c	Thu Nov 12 13:09:36 2009	(r199222)
+++ head/sys/contrib/rdma/krping/krping.c	Thu Nov 12 14:22:12 2009	(r199223)
@@ -112,109 +112,6 @@ struct krping_cb_list krping_cbs;
 #define RPING_BUFSIZE 128*1024
 #define RPING_SQ_DEPTH 32
 
-
-/* lifted from netinet/libalias/alias_proxy.c */
-static int inet_aton(const char *cp, struct in_addr *addr);
-static int
-inet_aton(cp, addr)
-        const char *cp;
-        struct in_addr *addr;
-{
-	u_long parts[4];
-	in_addr_t val;
-	const char *c;
-	char *endptr;
-	int gotend, n;
-
-	c = (const char *)cp;
-	n = 0;
-	/*
-	 * Run through the string, grabbing numbers until
-	 * the end of the string, or some error
-	 */
-	gotend = 0;
-	while (!gotend) {
-		unsigned long l;
-
-		l = strtoul(c, &endptr, 0);
-
-		if (l == ULONG_MAX || (l == 0 && endptr == c))
-			return (0);
-
-		val = (in_addr_t)l;
-		/*
-		 * If the whole string is invalid, endptr will equal
-		 * c.. this way we can make sure someone hasn't
-		 * gone '.12' or something which would get past
-		 * the next check.
-		 */
-		if (endptr == c)
-			return (0);
-		parts[n] = val;
-		c = endptr;
-
-		/* Check the next character past the previous number's end */
-		switch (*c) {
-		case '.' :
-			/* Make sure we only do 3 dots .. */
-			if (n == 3)	/* Whoops. Quit. */
-				return (0);
-			n++;
-			c++;
-			break;
-
-		case '\0':
-			gotend = 1;
-			break;
-
-		default:
-			if (isspace((unsigned char)*c)) {
-				gotend = 1;
-				break;
-			} else
-				return (0);	/* Invalid character, so fail */
-		}
-
-	}
-
-	/*
-	 * Concoct the address according to
-	 * the number of parts specified.
-	 */
-
-	switch (n) {
-	case 0:				/* a -- 32 bits */
-		/*
-		 * Nothing is necessary here.  Overflow checking was
-		 * already done in strtoul().
-		 */
-		break;
-	case 1:				/* a.b -- 8.24 bits */
-		if (val > 0xffffff || parts[0] > 0xff)
-			return (0);
-		val |= parts[0] << 24;
-		break;
-
-	case 2:				/* a.b.c -- 8.8.16 bits */
-		if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff)
-			return (0);
-		val |= (parts[0] << 24) | (parts[1] << 16);
-		break;
-
-	case 3:				/* a.b.c.d -- 8.8.8.8 bits */
-		if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff ||
-		    parts[2] > 0xff)
-			return (0);
-		val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
-		break;
-	}
-
-	if (addr != NULL)
-		addr->s_addr = htonl(val);
-	return (1);
-}
-
-
 static void krping_wait(struct krping_cb *cb, int state)
 {
 	int rc;

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:22:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A588A1065785;
	Thu, 12 Nov 2009 14:22:46 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com
	[209.85.218.213])
	by mx1.freebsd.org (Postfix) with ESMTP id D4E4F8FC1B;
	Thu, 12 Nov 2009 14:22:45 +0000 (UTC)
Received: by bwz5 with SMTP id 5so2396729bwz.3
	for ; Thu, 12 Nov 2009 06:22:44 -0800 (PST)
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; bh=MpoBpFfM0OieMOTZ2nhE+gaXsPuQ+oScGWGvoTuqOfM=;
	b=gEmLvWiipv+5ylVpD8d9ofAqBnW4QaWJIrUe94PSU4IYo8JeI16lyKk1+Vo9LA7n++
	LR66wM8EhR4N1nm6N9q7ayHnKEz7YO3i6SGlAXUYXydUQ0SNe2STkbrQET2xoEZ0Js4B
	m3inTMPWbMaMK+6zA+RoMmrjhrbgUwsEilQ4g=
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;
	b=LnyAufDUnAidSmcujaRy8xXifv94E3c0ZscgI4bNuy9nxdxtJajE/Em8iLDtNbs2LL
	ytLZUG3qm+4XUkbP40Z44p1aiDu6/Tk2pmziKOnvFgGhCIEJVCl3g01Y2AlIrOWC2h3i
	a5Rxkpuydawq2vb1OrxAYx/dzzB0K9jEGU4F0=
MIME-Version: 1.0
Sender: asmrookie@gmail.com
Received: by 10.223.68.155 with SMTP id v27mr467365fai.10.1258035764788; Thu, 
	12 Nov 2009 06:22:44 -0800 (PST)
In-Reply-To: 
References: <200911120046.nAC0kS2V012731@svn.freebsd.org>
	
Date: Thu, 12 Nov 2009 15:22:44 +0100
X-Google-Sender-Auth: 3f685e4fb8ca90c3
Message-ID: <3bbf2fe10911120622s7ce9bd0fpa67e3c53a005f148@mail.gmail.com>
From: Attilio Rao 
To: Navdeep Parhar 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199208 - in head/sys: conf libkern netinet 
	netinet/libalias
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:22:46 -0000

2009/11/12 Navdeep Parhar :
> This seems to break kernel builds.  Throwing away the private
> inet_aton implementation inside krping.c will probably fix it.
>
> /usr/src/sys/modules/rdma/krping/../../../contrib/rdma/krping/krping.c:117:
> error: static declaration of 'inet_aton' follows non-static
> declaration
> @/netinet/in.h:716: error: previous declaration of 'inet_aton' was here
> *** Error code 1

This should be fixed in r199223.

Thanks,
Attilio


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

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:31:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7BF71065672;
	Thu, 12 Nov 2009 14:31:18 +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 A3F208FC1D;
	Thu, 12 Nov 2009 14:31:18 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id B9DEB6D41C;
	Thu, 12 Nov 2009 14:31:17 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 8AABA84513; Thu, 12 Nov 2009 15:31:17 +0100 (CET)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Ed Schouten 
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	<20091112135211.GT64905@hoeg.nl>
Date: Thu, 12 Nov 2009 15:31:17 +0100
In-Reply-To: <20091112135211.GT64905@hoeg.nl> (Ed Schouten's message of "Thu, 
	12 Nov 2009 14:52:11 +0100")
Message-ID: <86hbsz24sq.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, Xin LI 
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:31:19 -0000

Ed Schouten  writes:
> Xin LI  writes:
> > @@ -198,6 +198,7 @@ struct ifnet {
> >  	void	*if_pf_kif;
> >  	void	*if_lagg;		/* lagg glue */
> >  	u_char	 if_alloctype;		/* if_type at time of allocation */
> > +	struct sbuf *if_description;	/* interface description */
> >=20=20
> >  	/*
> >  	 * Spare fields are added so that we can modify sensitive data
> > @@ -205,7 +206,7 @@ struct ifnet {
> >  	 * be used with care where binary compatibility is required.
> >  	 */
> >  	char	 if_cspare[3];
> > -	void	*if_pspare[8];
> > +	void	*if_pspare[7];
> >  	int	if_ispare[4];
> So there used to be four chars in a row here (between if_description and
> if_cspare). Are you sure moving the pointer in between doesn't increase
> the structure size?

I can guarantee you that it does.  On i386, for instance, there are now
three bytes of implicit padding between if_alloctype and if_description,
and one more between if_cspare and if_pspare, so struct ifnet has grown
by four bytes.

We should have CASSERTs for sizeof(struct ifnet) and other structs we
really care about.

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

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:48:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEA6A106568F;
	Thu, 12 Nov 2009 14:48:36 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DDAC88FC0A;
	Thu, 12 Nov 2009 14:48: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 nACEmact033444;
	Thu, 12 Nov 2009 14:48:36 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACEma08033442;
	Thu, 12 Nov 2009 14:48:36 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911121448.nACEma08033442@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Thu, 12 Nov 2009 14:48:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199225 - head/sys/netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:48:37 -0000

Author: ume
Date: Thu Nov 12 14:48:36 2009
New Revision: 199225
URL: http://svn.freebsd.org/changeset/base/199225

Log:
  - We are not guaranteed that we're not dropping a reference that
    we did not add.  Call LLE_REMREF() only when callout_stop()
    actually canceled a pending callout.
  - callout_reset() may cancel a pending callout.  When
    callout_reset() canceled a pending callout, call LLE_REMREF()
    to drop a reference for the canceled callout.
  
  MFC after:	1 week

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Thu Nov 12 14:27:09 2009	(r199224)
+++ head/sys/netinet6/nd6.c	Thu Nov 12 14:48:36 2009	(r199225)
@@ -439,31 +439,27 @@ skip1:
 void
 nd6_llinfo_settimer_locked(struct llentry *ln, long tick)
 {
+	int canceled;
+
 	if (tick < 0) {
 		ln->la_expire = 0;
 		ln->ln_ntick = 0;
-		callout_stop(&ln->ln_timer_ch);
-		/*
-		 * XXX - do we know that there is
-		 * callout installed? i.e. are we 
-		 * guaranteed that we're not dropping
-		 * a reference that we did not add?
-		 * KMM 
-		 */
-		LLE_REMREF(ln);
+		canceled = callout_stop(&ln->ln_timer_ch);
 	} else {
 		ln->la_expire = time_second + tick / hz;
 		LLE_ADDREF(ln);
 		if (tick > INT_MAX) {
 			ln->ln_ntick = tick - INT_MAX;
-			callout_reset(&ln->ln_timer_ch, INT_MAX,
+			canceled = callout_reset(&ln->ln_timer_ch, INT_MAX,
 			    nd6_llinfo_timer, ln);
 		} else {
 			ln->ln_ntick = 0;
-			callout_reset(&ln->ln_timer_ch, tick,
+			canceled = callout_reset(&ln->ln_timer_ch, tick,
 			    nd6_llinfo_timer, ln);
 		}
 	}
+	if (canceled)
+		LLE_REMREF(ln);
 }
 
 void
@@ -1048,6 +1044,9 @@ nd6_free(struct llentry *ln, int gc)
 			else
 				nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz);
 			splx(s);
+			LLE_WLOCK(ln);
+			LLE_REMREF(ln);
+			LLE_WUNLOCK(ln);
 			return (LIST_NEXT(ln, lle_next));
 		}
 

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:53:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E013106568B;
	Thu, 12 Nov 2009 14:53:58 +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 59CAC8FC16;
	Thu, 12 Nov 2009 14:53:57 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id EC0356D41C;
	Thu, 12 Nov 2009 14:53:55 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id CB99184513; Thu, 12 Nov 2009 15:53:55 +0100 (CET)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Peter Jeremy 
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org> <4AF4B6B2.3090706@delphij.net>
	<20091111230915.B3510@besplex.bde.org>
	<20091112050515.GA15002@server.vk2pj.dyndns.org>
Date: Thu, 12 Nov 2009 15:53:55 +0100
In-Reply-To: <20091112050515.GA15002@server.vk2pj.dyndns.org> (Peter Jeremy's
	message of "Thu, 12 Nov 2009 16:05:15 +1100")
Message-ID: <86d43n23r0.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: src-committers@freebsd.org, d@delphij.net, svn-src-all@freebsd.org,
	Xin LI , Bruce Evans ,
	svn-src-head@freebsd.org
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:53:58 -0000

Peter Jeremy  writes:
> Actually, %4.0f works up to 9999.5 %CPU because there's no '.' in the
> result.  I think this is an excellent solution.  And since FreeBSD
> currently has a hard limit of 64 CPUs, it's unlikely to be exceeded
> for a while.

...if by "a while" you mean "a year or two", because I can't imagine
that restriction surviving much longer than that.  You can already get
off-the-shelf hardware with 64 threads per die.  If screen real-estate
is a concern, we can switch the scale from 100 to 1, so 1.0 is full tilt
on one thread, etc., and use "%.5g", which should work for up to 99999
threads (9999900%)

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

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 14:55:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 78F981065696;
	Thu, 12 Nov 2009 14:55:13 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194])
	by mx1.freebsd.org (Postfix) with ESMTP id 094AA8FC19;
	Thu, 12 Nov 2009 14:55:12 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nACEt6Kx099038
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 12 Nov 2009 16:55:06 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	nACEt6TZ095430; Thu, 12 Nov 2009 16:55:06 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nACEt6rm095429; 
	Thu, 12 Nov 2009 16:55:06 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Thu, 12 Nov 2009 16:55:06 +0200
From: Kostik Belousov 
To: Kostik Belousov 
Message-ID: <20091112145506.GH2331@deviant.kiev.zoral.com.ua>
References: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
	<20091111215651.GM64905@hoeg.nl>
	<20091111223340.GF2331@deviant.kiev.zoral.com.ua>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="v3iGHXxT5ZJOqjki"
Content-Disposition: inline
In-Reply-To: <20091111223340.GF2331@deviant.kiev.zoral.com.ua>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, Ed Schouten ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 14:55:13 -0000


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

On Thu, Nov 12, 2009 at 12:33:40AM +0200, Kostik Belousov wrote:
> On Wed, Nov 11, 2009 at 10:56:51PM +0100, Ed Schouten wrote:
> > Hi,
> >=20
> > * Jun Kuriyama  wrote:
> > > Can you test with these patches?  Testing on only one of both system
> > > is enough.  "patch-1" forces disabling CLFLUSH feature even if SS bit
> > > exists.  "patch-2" forces no CLFLUSH tweak.  I'd like to know with
> > > which patch your system can live.
> >=20
> > For some reason they both seem to boot. Yikes. I've done some more
> > testing and it seems the old version even hangs if I add some additional
> > printf's above and below, which makes me believe the problem is a bit
> > more complex than we realize...
>=20
> The only thing I see now is that TUNABLE_INT declaration is not needed,
> since SYSINIT is started after hammer_time(), so TUNABLE_FETCH is
> processed after everything is done for BSP.
>=20
> Wait, are your machines SMP ? Hmm, could you, please, remove TUNABLE_INT()
> and see how it ends up ?

[Selecting random email in the thread].

Luckily, my co-worker has laptop that runs HEAD and exhibited the
problem. Patch below fixed the hang for him. Will be happy to get
confirmation that patch fixes the hung for other people who reported it.

http://people.freebsd.org/~kib/misc/initcache.1.patch

Issue is that TUNABLE_INT_FETCH was called on AP while CPU was not
initialized properly, in particular, curthread was not set etc. But,
kernel environment is already switched to dynamic, so access needs to
lock a mutex.

I am currently looking at i386, that probably needs similar change.


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr8IckACgkQC3+MBN1Mb4irLACgiBJhfdLoRDhEjsalCC5GWtPI
oTYAoLO54S12EuejOGsAUeZ2MZWfllUM
=p2Vh
-----END PGP SIGNATURE-----

--v3iGHXxT5ZJOqjki--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 15:19:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5D073106566B;
	Thu, 12 Nov 2009 15:19:09 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B7188FC27;
	Thu, 12 Nov 2009 15:19: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 nACFJ9BQ034390;
	Thu, 12 Nov 2009 15:19:09 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACFJ9K0034388;
	Thu, 12 Nov 2009 15:19:09 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200911121519.nACFJ9K0034388@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 12 Nov 2009 15:19: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: r199226 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 15:19:09 -0000

Author: nwhitehorn
Date: Thu Nov 12 15:19:09 2009
New Revision: 199226
URL: http://svn.freebsd.org/changeset/base/199226

Log:
  Provide a real fix to the too-many-translations problem when booting
  from CD on 64-bit hardware to replace existing band-aids. This occurred
  when the preloaded mdroot required too many mappings for the static
  buffer.
  
  Since we only use the translations buffer once, allocate a dynamic
  buffer on the stack. This early in the boot process, the call chain
  is quite short and we can be assured of having sufficient stack space.
  
  Reviewed by:	grehan

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Thu Nov 12 14:48:36 2009	(r199225)
+++ head/sys/powerpc/aim/mmu_oea64.c	Thu Nov 12 15:19:09 2009	(r199226)
@@ -264,7 +264,6 @@ static struct	mem_region *pregions;
 extern u_int	phys_avail_count;
 extern int	regions_sz, pregions_sz;
 extern int	ofw_real_mode;
-static struct	ofw_map translations[96];
 
 extern struct pmap ofw_pmap;
 
@@ -709,17 +708,73 @@ moea64_bridge_cpu_bootstrap(mmu_t mmup, 
 }
 
 static void
+moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, size_t sz)
+{
+	struct ofw_map	translations[sz/sizeof(struct ofw_map)];
+	register_t	msr;
+	vm_offset_t	off;
+	int		i, ofw_mappings;
+
+	bzero(translations, sz);
+	if (OF_getprop(mmu, "translations", translations, sz) == -1)
+		panic("moea64_bootstrap: can't get ofw translations");
+
+	CTR0(KTR_PMAP, "moea64_add_ofw_mappings: translations");
+	sz /= sizeof(*translations);
+	qsort(translations, sz, sizeof (*translations), om_cmp);
+
+	for (i = 0, ofw_mappings = 0; i < sz; i++) {
+		CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x",
+		    (uint32_t)(translations[i].om_pa_lo), translations[i].om_va,
+		    translations[i].om_len);
+
+		if (translations[i].om_pa_lo % PAGE_SIZE)
+			panic("OFW translation not page-aligned!");
+
+		if (translations[i].om_pa_hi)
+			panic("OFW translations above 32-bit boundary!");
+
+		/* Now enter the pages for this mapping */
+
+		/*
+		 * Lock the ofw pmap. pmap_kenter(), which we use for the
+		 * pages the kernel also needs, does its own locking.
+		 */
+		PMAP_LOCK(&ofw_pmap); 
+		DISABLE_TRANS(msr);
+		for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) {
+			struct vm_page m;
+
+			/* Map low memory mappings into the kernel pmap, too.
+			 * These are typically mappings made by the loader,
+			 * so we need them if we want to keep executing. */
+
+			if (translations[i].om_va + off < SEGMENT_LENGTH)
+				moea64_kenter(mmup, translations[i].om_va + off,
+				    translations[i].om_va + off);
+
+			m.phys_addr = translations[i].om_pa_lo + off;
+			moea64_enter_locked(&ofw_pmap,
+			    translations[i].om_va + off, &m, VM_PROT_ALL, 1);
+
+			ofw_mappings++;
+		}
+		ENABLE_TRANS(msr);
+		PMAP_UNLOCK(&ofw_pmap);
+	}
+}
+
+static void
 moea64_bridge_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
 {
 	ihandle_t	mmui;
 	phandle_t	chosen;
 	phandle_t	mmu;
-	int		sz;
+	size_t		sz;
 	int		i, j;
-	int		ofw_mappings;
 	vm_size_t	size, physsz, hwphyssz;
 	vm_offset_t	pa, va, off;
-	uint32_t	msr;
+	register_t	msr;
 	void		*dpcpu;
 
 	/* We don't have a direct map since there is no BAT */
@@ -865,7 +920,6 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 	off = (vm_offset_t)(moea64_bpvo_pool);
 	for (pa = off; pa < off + size; pa += PAGE_SIZE) 
 		moea64_kenter(mmup, pa, pa);
-	ENABLE_TRANS(msr);
 
 	/*
 	 * Map certain important things, like ourselves.
@@ -876,7 +930,6 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 	 * address.
 	 */
 
-	DISABLE_TRANS(msr);
 	for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; pa += PAGE_SIZE) 
 		moea64_kenter(mmup, pa, pa);
 	ENABLE_TRANS(msr);
@@ -897,57 +950,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 		panic("moea64_bootstrap: can't get mmu package");
 	    if ((sz = OF_getproplen(mmu, "translations")) == -1)
 		panic("moea64_bootstrap: can't get ofw translation count");
-	    if (sz > sizeof(translations))
-		panic("moea64_bootstrap: too many ofw translations (%d)",
-		      sz/sizeof(*translations));
-
-	    bzero(translations, sz);
-	    if (OF_getprop(mmu, "translations", translations, sz) == -1)
-		panic("moea64_bootstrap: can't get ofw translations");
-
-	    CTR0(KTR_PMAP, "moea64_bootstrap: translations");
-	    sz /= sizeof(*translations);
-	    qsort(translations, sz, sizeof (*translations), om_cmp);
-
-	    for (i = 0, ofw_mappings = 0; i < sz; i++) {
-		CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x",
-		    (uint32_t)(translations[i].om_pa_lo), translations[i].om_va,
-		    translations[i].om_len);
-
-		if (translations[i].om_pa_lo % PAGE_SIZE)
-			panic("OFW translation not page-aligned!");
-
-		if (translations[i].om_pa_hi)
-			panic("OFW translations above 32-bit boundary!");
-
-		/* Now enter the pages for this mapping */
-
-		/*
-		 * Lock the ofw pmap. pmap_kenter(), which we use for the
-		 * pages the kernel also needs, does its own locking.
-		 */
-		PMAP_LOCK(&ofw_pmap); 
-		DISABLE_TRANS(msr);
-		for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) {
-			struct vm_page m;
-
-			/* Map low memory mappings into the kernel pmap, too.
-			 * These are typically mappings made by the loader,
-			 * so we need them if we want to keep executing. */
-
-			if (translations[i].om_va + off < SEGMENT_LENGTH)
-				moea64_kenter(mmup, translations[i].om_va + off,
-				    translations[i].om_va + off);
+	    if (sz > 6144 /* tmpstksz - 2 KB headroom */)
+		panic("moea64_bootstrap: too many ofw translations");
 
-			m.phys_addr = translations[i].om_pa_lo + off;
-			moea64_enter_locked(&ofw_pmap,
-			    translations[i].om_va + off, &m, VM_PROT_ALL, 1);
-
-			ofw_mappings++;
-		}
-		ENABLE_TRANS(msr);
-		PMAP_UNLOCK(&ofw_pmap);
-	    }
+	    moea64_add_ofw_mappings(mmup, mmu, sz);
 	}
 
 #ifdef SMP

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 15:19:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 87A7C1065703;
	Thu, 12 Nov 2009 15:19:28 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B4858FC1A;
	Thu, 12 Nov 2009 15:19:28 +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 E05B146B06;
	Thu, 12 Nov 2009 10:19:27 -0500 (EST)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 2CE118A020;
	Thu, 12 Nov 2009 10:19:27 -0500 (EST)
From: John Baldwin 
To: Xin LI 
Date: Thu, 12 Nov 2009 10:14:12 -0500
User-Agent: KMail/1.9.7
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
In-Reply-To: <200911112130.nABLUw9b007768@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200911121014.12391.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Thu, 12 Nov 2009 10:19:27 -0500 (EST)
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: r199201 - in head: contrib/libpcap sbin/ifconfig
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 15:19:28 -0000

On Wednesday 11 November 2009 4:30:58 pm Xin LI wrote:
> Author: delphij
> Date: Wed Nov 11 21:30:58 2009
> New Revision: 199201
> URL: http://svn.freebsd.org/changeset/base/199201
> 
> Log:
>   Add interface description capability as inspired by OpenBSD.
>   
>   MFC after:	3 months
> 
> Modified: head/sys/net/if.c
> ==============================================================================
> --- head/sys/net/if.c	Wed Nov 11 21:18:27 2009	(r199200)
> +++ head/sys/net/if.c	Wed Nov 11 21:30:58 2009	(r199201)
> @@ -2090,6 +2092,45 @@ ifhwioctl(u_long cmd, struct ifnet *ifp,
>  		ifr->ifr_phys = ifp->if_physical;
>  		break;
>  
> +	case SIOCSIFDESCR:
> +		error = priv_check(td, PRIV_NET_SETIFDESCR);
> +		if (error)
> +			return (error);
> +
> +		IF_AFDATA_WLOCK(ifp);
> +		if (ifp->if_description == NULL) {
> +			ifp->if_description = sbuf_new_auto();
> +			if (ifp->if_description == NULL) {
> +				error = ENOMEM;
> +				IF_AFDATA_WUNLOCK(ifp);
> +				break;
> +			}
> +		} else
> +			sbuf_clear(ifp->if_description);
> +
> +		if (sbuf_copyin(ifp->if_description, ifr->ifr_buffer.buffer,
> +				ifr->ifr_buffer.length) == -1)
> +			error = EFAULT;
> +
> +		if (error == 0) {
> +			sbuf_finish(ifp->if_description);
> +			getmicrotime(&ifp->if_lastchange);
> +		}
> +		IF_AFDATA_WUNLOCK(ifp);

Since IF_AFDATA isn't a sleepable lock (e.g. an sx lock), it is not safe
to do a copyin() while holding this lock.  A better approach would probably
be something like:

	struct sbuf *new, *old;

	case SIOCSIFDESCR:
		/* priv check */

		new = sbuf_new_auto();
		if (new == NULL)
			return (ENOMEM);
		if (sbuf_copyin(new, ifr->ifr_buffer.buffer,
		    ifr->ifr_buffer.length) == -1) {
			sbuf_delete(new);
			return (EFAULT);
		}

		IF_AFDATA_WLOCK(ifp);
		old = ifp->if_description;
		ifp->if_description = new;
		getmicrotime(&ifp->if_lastchange);
		IF_AFDATA_WUNLOCK(ifp);
		if (old != NULL)
			sbuf_delete(old);
		break;

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 15:21:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66EDD106566B;
	Thu, 12 Nov 2009 15:21:41 +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 3CDF08FC19;
	Thu, 12 Nov 2009 15:21:41 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id E3FA646B2A;
	Thu, 12 Nov 2009 10:21:40 -0500 (EST)
Date: Thu, 12 Nov 2009 15:21:40 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= 
In-Reply-To: <86hbsz24sq.fsf@ds4.des.no>
Message-ID: 
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	<20091112135211.GT64905@hoeg.nl> <86hbsz24sq.fsf@ds4.des.no>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-128957440-1258039300=:11129"
Cc: svn-src-head@freebsd.org, Ed Schouten ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Xin LI 
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 15:21:41 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-128957440-1258039300=:11129
Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8BIT


On Thu, 12 Nov 2009, Dag-Erling Smørgrav wrote:

>> So there used to be four chars in a row here (between if_description and 
>> if_cspare). Are you sure moving the pointer in between doesn't increase the 
>> structure size?
>
> I can guarantee you that it does.  On i386, for instance, there are now 
> three bytes of implicit padding between if_alloctype and if_description, and 
> one more between if_cspare and if_pspare, so struct ifnet has grown by four 
> bytes.
>
> We should have CASSERTs for sizeof(struct ifnet) and other structs we really 
> care about.

We care less about ifnet than we used to, because ifnet is now allocated by 
the kernel rather than drivers.  However, if we want to take our KPI/KBI more 
seriously, then CTASSERTs on other "public" kernel structures might well be a 
good idea.  On the other hand, CTASSERT errors on build are almost impervious 
to mortal comprehension (if you haven't seen them before, they make little 
sense to the reader), and will make it more difficult for people hacking on 
our kernel to do so casually.  Some sort of other static checker might make 
more sense, and perhaps allow us to do more intelligent checking that just 
"total size" -- we'd also like to detect rearrangement of sensitive structs 
that would be size-preserving.

Robert
--621616949-128957440-1258039300=:11129--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 15:59:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BD76106566C;
	Thu, 12 Nov 2009 15:59:05 +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 4B21E8FC1A;
	Thu, 12 Nov 2009 15:59: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 nACFx5tr035250;
	Thu, 12 Nov 2009 15:59:05 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACFx5v0035248;
	Thu, 12 Nov 2009 15:59:05 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200911121559.nACFx5v0035248@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 12 Nov 2009 15:59: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: r199227 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 15:59:05 -0000

Author: attilio
Date: Thu Nov 12 15:59:05 2009
New Revision: 199227
URL: http://svn.freebsd.org/changeset/base/199227

Log:
  Add the possibility for vfs.root.mountfrom tunable to accept a list of
  items rather than a single one. The list is a space separated collection
  of items defined as the current one accepted.
  
  While there fix also a nit in a comment.
  
  Obtained from:	Sandvine Incorporated
  Reviewed by:	emaste
  Tested by:	Giovanni Trematerra
  		
  Sponsored by:	Sandvine Incorporated
  MFC:		2 weeks

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Thu Nov 12 15:19:09 2009	(r199226)
+++ head/sys/kern/vfs_mount.c	Thu Nov 12 15:59:05 2009	(r199227)
@@ -104,13 +104,17 @@ struct vnode	*rootvnode;
  * The root filesystem is detailed in the kernel environment variable
  * vfs.root.mountfrom, which is expected to be in the general format
  *
- * :[]
+ * :[][	:[] ...]
  * vfsname   := the name of a VFS known to the kernel and capable
  *              of being mounted as root
  * path      := disk device name or other data used by the filesystem
  *              to locate its physical store
  *
- * The environment variable vfs.root.mountfrom options is a comma delimited
+ * If the environment variable vfs.root.mountfrom is a space separated list,
+ * each list element is tried in turn and the root filesystem will be mounted
+ * from the first one that suceeds.
+ *
+ * The environment variable vfs.root.mountfrom.options is a comma delimited
  * set of string mount options.  These mount options must be parseable
  * by nmount() in the kernel.
  */
@@ -1643,7 +1647,7 @@ vfs_opterror(struct vfsoptlist *opts, co
 void
 vfs_mountroot(void)
 {
-	char *cp, *options;
+	char *cp, *cpt, *options, *tmpdev;
 	int error, i, asked = 0;
 
 	options = NULL;
@@ -1695,10 +1699,15 @@ vfs_mountroot(void)
 	 */
 	cp = getenv("vfs.root.mountfrom");
 	if (cp != NULL) {
-		error = vfs_mountroot_try(cp, options);
+		cpt = cp;
+		while ((tmpdev = strsep(&cpt, " \t")) != NULL) {
+			error = vfs_mountroot_try(tmpdev, options);
+			if (error == 0) {
+				freeenv(cp);
+				goto mounted;
+			}
+		}
 		freeenv(cp);
-		if (!error)
-			goto mounted;
 	}
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 16:03:10 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 278891065693;
	Thu, 12 Nov 2009 16:03:10 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au
	[211.29.132.184])
	by mx1.freebsd.org (Postfix) with ESMTP id AE7878FC24;
	Thu, 12 Nov 2009 16:03:09 +0000 (UTC)
Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au
	[220.239.235.116])
	by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	nACG2jir024197
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 13 Nov 2009 03:02:48 +1100
Date: Fri, 13 Nov 2009 03:02:45 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
In-Reply-To: <86d43n23r0.fsf@ds4.des.no>
Message-ID: <20091113022937.P1408@besplex.bde.org>
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org> <4AF4B6B2.3090706@delphij.net>
	<20091111230915.B3510@besplex.bde.org>
	<20091112050515.GA15002@server.vk2pj.dyndns.org>
	<86d43n23r0.fsf@ds4.des.no>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-1144117182-1258041765=:1408"
Cc: src-committers@FreeBSD.org, d@delphij.net,
	Peter Jeremy , svn-src-all@FreeBSD.org,
	Xin LI , Bruce Evans ,
	svn-src-head@FreeBSD.org
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 16:03:10 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1144117182-1258041765=:1408
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 12 Nov 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:

> Peter Jeremy  writes:
>> Actually, %4.0f works up to 9999.5 %CPU because there's no '.' in the
>> result.  I think this is an excellent solution.  And since FreeBSD
>> currently has a hard limit of 64 CPUs, it's unlikely to be exceeded
>> for a while.
>
> ...if by "a while" you mean "a year or two", because I can't imagine
> that restriction surviving much longer than that.  You can already get
> off-the-shelf hardware with 64 threads per die.

Can you imagine NCPU hitting a power wall or other technical barrier at
not much larger than 64?

> If screen real-estate
> is a concern, we can switch the scale from 100 to 1, so 1.0 is full tilt
> on one thread, etc., and use "%.5g", which should work for up to 99999
> threads (9999900%)

The extra character needed for this is one of the smallest problems
resulting from NCPU being huge.  The problem expands like O(log(NCPU))
and causes a non-fatal formatting error when it occurs.  Other problems
expand like O(NCPU).  A nearby one is the "pigs" display in systat.
This wants to display a on single screen without scrolling, so it will
soon take a 6 metre high display to fit just the idle pigs on a 1024-
CPU system.  These take at most 100% CPU each so they will be sorted
after multi-threaded pigs taking more, but they will be sorted before
most single-threaded pigs, thus displacing the latter from the window
except with > 6 meter high displays.

Bruce
--0-1144117182-1258041765=:1408--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 16:06:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00EA11065692;
	Thu, 12 Nov 2009 16:06:35 +0000 (UTC) (envelope-from philip@paeps.cx)
Received: from rincewind.paeps.cx (rincewind.paeps.cx
	[IPv6:2002:596a:f092::149])
	by mx1.freebsd.org (Postfix) with ESMTP id B64F58FC22;
	Thu, 12 Nov 2009 16:06:34 +0000 (UTC)
Received: by rincewind.paeps.cx (Postfix, from userid 1001)
	id 21178D74409; Thu, 12 Nov 2009 17:06:34 +0100 (CET)
Date: Thu, 12 Nov 2009 17:06:34 +0100
From: Philip Paeps 
To: Xin LI 
Message-ID: <20091112160634.GN8230@rincewind.paeps.cx>
Mail-Followup-To: Xin LI , src-committers@freebsd.org,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <200911112130.nABLUw9b007768@svn.freebsd.org>
X-PGP-Fingerprint: 356B AE02 4763 F739 2FA2  E438 2649 E628 C5D3 4D05
X-Date: Today is Sweetmorn, the 24th day of The Aftermath in the YOLD 3175
X-Phase-of-Moon: The Moon is Waning Crescent (19% of Full)
X-Philip-Conspiracy: There is no conspiracy
Organization: Happily Disorganized
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: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 16:06:35 -0000

On 2009-11-11 21:30:58 (+0000), Xin LI  wrote:
> Log:
>   Add interface description capability as inspired by OpenBSD.

In addition to the comments already made, I'd also like to note that it would
make a lot of sense to announce changes in interface descriptions to the
routing socket.  That way, SNMP or other userspace consumers (a daemon sending
CDP announcements, for instance - though arguably the kernel could send those)
can be notified of changes rather than having to poll for them.

 - Philip

-- 
Philip Paeps                                    Please don't Cc me, I am
philip@freebsd.org                               subscribed to the list.

  BOFH Excuse #363:
    Out of cards on drive D:

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 16:10:10 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE3201065679
	for ; Thu, 12 Nov 2009 16:10:10 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232])
	by mx1.freebsd.org (Postfix) with ESMTP id 449778FC18
	for ; Thu, 12 Nov 2009 16:10:09 +0000 (UTC)
Received: from lor.one-eyed-alien.net (localhost [127.0.0.1])
	by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id nACG8oQa065496; 
	Thu, 12 Nov 2009 10:08:50 -0600 (CST)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: (from brooks@localhost)
	by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id nACG8nuU065495;
	Thu, 12 Nov 2009 10:08:49 -0600 (CST) (envelope-from brooks)
Date: Thu, 12 Nov 2009 10:08:49 -0600
From: Brooks Davis 
To: Robert Watson 
Message-ID: <20091112160849.GB65026@lor.one-eyed-alien.net>
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	<20091112135211.GT64905@hoeg.nl> <86hbsz24sq.fsf@ds4.des.no>
	
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(lor.one-eyed-alien.net [127.0.0.1]);
	Thu, 12 Nov 2009 10:08:51 -0600 (CST)
Cc: Ed Schouten , src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org, Xin LI ,
	svn-src-head@FreeBSD.org, Dag-Erling Sm?rgrav 
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 16:10:10 -0000


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

On Thu, Nov 12, 2009 at 03:21:40PM +0000, Robert Watson wrote:
>=20
> On Thu, 12 Nov 2009, Dag-Erling Sm??rgrav wrote:
>=20
>>> So there used to be four chars in a row here (between if_description an=
d=20
>>> if_cspare). Are you sure moving the pointer in between doesn't increase=
=20
>>> the structure size?
>>=20
>> I can guarantee you that it does.  On i386, for instance, there are now=
=20
>> three bytes of implicit padding between if_alloctype and if_description,=
=20
>> and one more between if_cspare and if_pspare, so struct ifnet has grown =
by=20
>> four bytes.
>>=20
>> We should have CASSERTs for sizeof(struct ifnet) and other structs we=20
>> really care about.
>=20
> We care less about ifnet than we used to, because ifnet is now allocated =
by=20
> the kernel rather than drivers.  However, if we want to take our KPI/KBI=
=20
> more seriously, then CTASSERTs on other "public" kernel structures might=
=20
> well be a good idea.  On the other hand, CTASSERT errors on build are=20
> almost impervious to mortal comprehension (if you haven't seen them befor=
e,=20
> they make little sense to the reader), and will make it more difficult fo=
r=20
> people hacking on our kernel to do so casually.  Some sort of other stati=
c=20
> checker might make more sense, and perhaps allow us to do more intelligen=
t=20
> checking that just "total size" -- we'd also like to detect rearrangement=
=20
> of sensitive structs that would be size-preserving.

In this specific case, we should remove all the spare pointers since
they don't really add value.  The only rule should be that when you MFC
you have to add to the end rather than inserting in the strictly logical
location.

-- Brooks

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iD8DBQFK/DMRXY6L6fI4GtQRAuGsAJ9e65J9g3HLfajdU56nCRlRNU1kNQCfZACW
8K9lsTimLCfdrl3mG7N+x6A=
=QQT0
-----END PGP SIGNATURE-----

--ZfOjI3PrQbgiZnxM--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 16:10:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B361F106568D;
	Thu, 12 Nov 2009 16:10:58 +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 6D3308FC2F;
	Thu, 12 Nov 2009 16:10:58 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 873A66D41B;
	Thu, 12 Nov 2009 16:10:57 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 5950184513; Thu, 12 Nov 2009 17:10:57 +0100 (CET)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Robert Watson 
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	<20091112135211.GT64905@hoeg.nl> <86hbsz24sq.fsf@ds4.des.no>
	
Date: Thu, 12 Nov 2009 17:10:57 +0100
In-Reply-To:  (Robert
	Watson's message of "Thu, 12 Nov 2009 15:21:40 +0000 (GMT)")
Message-ID: <86zl6rzpta.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, Ed Schouten ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Xin LI 
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 16:10:58 -0000

Robert Watson  writes:
> We care less about ifnet than we used to, because ifnet is now
> allocated by the kernel rather than drivers.  However, if we want to
> take our KPI/KBI more seriously, then CTASSERTs on other "public"
> kernel structures might well be a good idea.  On the other hand,
> CTASSERT errors on build are almost impervious to mortal comprehension
> (if you haven't seen them before, they make little sense to the
> reader), and will make it more difficult for people hacking on our
> kernel to do so casually.  Some sort of other static checker might
> make more sense, and perhaps allow us to do more intelligent checking
> that just "total size" -- we'd also like to detect rearrangement of
> sensitive structs that would be size-preserving.

A while ago, I started working on a Perl script that parsed struct
declarations.  The idea was that we could store a reference copy of the
struct layout somewhere, and the script, using its knowledge of
alignment and padding rules on different architectures, would calculate
the current layout and compare it with the reference layout.

I set it aside when I realized how much work it would be to parse
function pointers, but we could dodge the issue by always typedef'ing
them, e.g. instead of

struct sigaction {
        union {
                void    (*__sa_handler)(int);
                void    (*__sa_sigaction)(int, struct __siginfo *, void *);
        } __sigaction_u;                /* signal handler */
        int     sa_flags;               /* see signal options below */
        sigset_t sa_mask;               /* signal mask to apply */
};

we'd have

typedef void (*__sa_handler_func_ptr)(int);
typedef void (*__sa_sigaction_func_ptr)(int, struct __siginfo *, void *);

struct sigaction {
        union {
                __sa_handler_func_ptr __sa_handler;
                __sa_sigaction_func_ptr __sa_sigaction;
        } __sigaction_u;                /* signal handler */
        int     sa_flags;               /* see signal options below */
        sigset_t sa_mask;               /* signal mask to apply */
};

My script understands typedefs, and it should be easy enough to fudge
the typedef parsing bit so it knows that __sa_handler_func_ptr and
__sa_sigaction_func_ptr are function pointers, which is enough to figure
out size and alignment on all architectures we support.

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

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 16:28:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72A9D106566B;
	Thu, 12 Nov 2009 16:28:39 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61FF78FC0A;
	Thu, 12 Nov 2009 16:28:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nACGSdqs035923;
	Thu, 12 Nov 2009 16:28:39 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACGSdlv035921;
	Thu, 12 Nov 2009 16:28:39 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200911121628.nACGSdlv035921@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 12 Nov 2009 16:28: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: r199228 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 16:28:39 -0000

Author: rnoland
Date: Thu Nov 12 16:28:39 2009
New Revision: 199228
URL: http://svn.freebsd.org/changeset/base/199228

Log:
  We need to allocate space for the header in the create path also.
  
  This fixes a null pointer dereference with "gpart create -s GPT" after
  the previous commit.
  
  Reported by:	Yuri Pankov
  Pointyhat to:	me
  MFC after:	1 week

Modified:
  head/sys/geom/part/g_part_gpt.c

Modified: head/sys/geom/part/g_part_gpt.c
==============================================================================
--- head/sys/geom/part/g_part_gpt.c	Thu Nov 12 15:59:05 2009	(r199227)
+++ head/sys/geom/part/g_part_gpt.c	Thu Nov 12 16:28:39 2009	(r199228)
@@ -444,6 +444,9 @@ g_part_gpt_create(struct g_part_table *b
 	table->lba[GPT_ELT_SECHDR] = last;
 	table->lba[GPT_ELT_SECTBL] = last - tblsz;
 
+	/* Allocate space for the header */
+	table->hdr = g_malloc(sizeof(struct gpt_hdr), M_WAITOK | M_ZERO);
+
 	bcopy(GPT_HDR_SIG, table->hdr->hdr_sig, sizeof(table->hdr->hdr_sig));
 	table->hdr->hdr_revision = GPT_HDR_REVISION;
 	table->hdr->hdr_size = offsetof(struct gpt_hdr, padding);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 16:31:24 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F1021065670;
	Thu, 12 Nov 2009 16:31:24 +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 4A9C18FC13;
	Thu, 12 Nov 2009 16:31:24 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 3B2DD6D41C;
	Thu, 12 Nov 2009 16:31:23 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 0C9E3844C2; Thu, 12 Nov 2009 17:31:23 +0100 (CET)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Bruce Evans 
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org> <4AF4B6B2.3090706@delphij.net>
	<20091111230915.B3510@besplex.bde.org>
	<20091112050515.GA15002@server.vk2pj.dyndns.org>
	<86d43n23r0.fsf@ds4.des.no> <20091113022937.P1408@besplex.bde.org>
Date: Thu, 12 Nov 2009 17:31:22 +0100
In-Reply-To: <20091113022937.P1408@besplex.bde.org> (Bruce Evans's message of
	"Fri, 13 Nov 2009 03:02:45 +1100 (EST)")
Message-ID: <86vdhfzov9.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: src-committers@FreeBSD.org, d@delphij.net,
	Peter Jeremy , svn-src-all@FreeBSD.org,
	Xin LI , svn-src-head@FreeBSD.org
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 16:31:24 -0000

Bruce Evans  writes:
> Can you imagine NCPU hitting a power wall or other technical barrier at
> not much larger than 64?

Do you have any idea how many threads a modern GPU has?  We're talking
high three to low four digits per die...

SGI built a 51,200-core single system image Itanium cluster for NASA.
Supposedly, it runs a stock Linux kernel.

Closer to home, the Sun T2 has 64 threads per die, and there are
four-way T2 systems (256 threads) on the market already.

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

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 17:56:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 360C1106566B;
	Thu, 12 Nov 2009 17:56:57 +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 241C08FC0A;
	Thu, 12 Nov 2009 17:56:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nACHuuAg037928;
	Thu, 12 Nov 2009 17:56:56 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACHuu8l037924;
	Thu, 12 Nov 2009 17:56:56 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200911121756.nACHuu8l037924@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 12 Nov 2009 17:56: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: r199229 - in head/sys: dev/fb dev/pci isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 17:56:57 -0000

Author: jkim
Date: Thu Nov 12 17:56:56 2009
New Revision: 199229
URL: http://svn.freebsd.org/changeset/base/199229

Log:
  - Partially revert hackish r198964 and r199002.
  - Add a proxy driver vgapm to help vgapci to save/load VGA state.
  - Move device_set_desc() to the right place while we are here.
  
  Reviewed by:	jhb

Modified:
  head/sys/dev/fb/vgareg.h
  head/sys/dev/pci/vga_pci.c
  head/sys/isa/vga_isa.c

Modified: head/sys/dev/fb/vgareg.h
==============================================================================
--- head/sys/dev/fb/vgareg.h	Thu Nov 12 16:28:39 2009	(r199228)
+++ head/sys/dev/fb/vgareg.h	Thu Nov 12 17:56:56 2009	(r199229)
@@ -69,7 +69,6 @@
 struct video_adapter;
 typedef struct vga_softc {
 	struct video_adapter	*adp;
-	device_t		pci_dev;
 	void			*state_buf;
 	void			*pal_buf;
 #ifdef FB_INSTALL_CDEV

Modified: head/sys/dev/pci/vga_pci.c
==============================================================================
--- head/sys/dev/pci/vga_pci.c	Thu Nov 12 16:28:39 2009	(r199228)
+++ head/sys/dev/pci/vga_pci.c	Thu Nov 12 17:56:56 2009	(r199229)
@@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 
@@ -57,7 +55,6 @@ struct vga_resource {
 };
 
 struct vga_pci_softc {
-	device_t	vga_isa_dev;	/* Sister isavga driver. */
 	device_t	vga_msi_child;	/* Child driver using MSI. */
 	struct vga_resource vga_res[PCIR_MAX_BAR_0 + 1];
 };
@@ -115,11 +112,6 @@ vga_pci_attach(device_t dev)
 static int
 vga_pci_suspend(device_t dev)
 {
-	struct vga_pci_softc *sc;
-
-	sc = device_get_softc(dev);
-	if (sc->vga_isa_dev != NULL)
-		(void)DEVICE_SUSPEND(sc->vga_isa_dev);
 
 	return (bus_generic_suspend(dev));
 }
@@ -127,11 +119,6 @@ vga_pci_suspend(device_t dev)
 static int
 vga_pci_resume(device_t dev)
 {
-	struct vga_pci_softc *sc;
-
-	sc = device_get_softc(dev);
-	if (sc->vga_isa_dev != NULL)
-		(void)DEVICE_RESUME(sc->vga_isa_dev);
 
 	return (bus_generic_resume(dev));
 }

Modified: head/sys/isa/vga_isa.c
==============================================================================
--- head/sys/isa/vga_isa.c	Thu Nov 12 16:28:39 2009	(r199228)
+++ head/sys/isa/vga_isa.c	Thu Nov 12 17:56:56 2009	(r199229)
@@ -59,6 +59,69 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+static void
+vga_suspend(device_t dev)
+{
+	vga_softc_t *sc;
+	int nbytes;
+
+	sc = device_get_softc(dev);
+
+	/* Save the video state across the suspend. */
+	if (sc->state_buf != NULL)
+		goto save_palette;
+	nbytes = vidd_save_state(sc->adp, NULL, 0);
+	if (nbytes <= 0)
+		goto save_palette;
+	sc->state_buf = malloc(nbytes, M_TEMP, M_NOWAIT);
+	if (sc->state_buf == NULL)
+		goto save_palette;
+	if (bootverbose)
+		device_printf(dev, "saving %d bytes of video state\n", nbytes);
+	if (vidd_save_state(sc->adp, sc->state_buf, nbytes) != 0) {
+		device_printf(dev, "failed to save state (nbytes=%d)\n",
+		    nbytes);
+		free(sc->state_buf, M_TEMP);
+		sc->state_buf = NULL;
+	}
+
+save_palette:
+	/* Save the color palette across the suspend. */
+	if (sc->pal_buf != NULL)
+		return;
+	sc->pal_buf = malloc(256 * 3, M_TEMP, M_NOWAIT);
+	if (sc->pal_buf == NULL)
+		return;
+	if (bootverbose)
+		device_printf(dev, "saving color palette\n");
+	if (vidd_save_palette(sc->adp, sc->pal_buf) != 0) {
+		device_printf(dev, "failed to save palette\n");
+		free(sc->pal_buf, M_TEMP);
+		sc->pal_buf = NULL;
+	}
+}
+
+static void
+vga_resume(device_t dev)
+{
+	vga_softc_t *sc;
+
+	sc = device_get_softc(dev);
+
+	if (sc->state_buf != NULL) {
+		if (vidd_load_state(sc->adp, sc->state_buf) != 0)
+			device_printf(dev, "failed to reload state\n");
+		free(sc->state_buf, M_TEMP);
+		sc->state_buf = NULL;
+	}
+	if (sc->pal_buf != NULL) {
+		if (vidd_load_palette(sc->adp, sc->pal_buf) != 0)
+			device_printf(dev, "failed to reload palette\n");
+		free(sc->pal_buf, M_TEMP);
+		sc->pal_buf = NULL;
+	}
+}
+
 #define VGA_SOFTC(unit)		\
 	((vga_softc_t *)devclass_get_softc(isavga_devclass, unit))
 
@@ -103,9 +166,9 @@ isavga_probe(device_t dev)
 	if (isa_get_vendorid(dev))
 		return (ENXIO);
 
-	device_set_desc(dev, "Generic ISA VGA");
 	error = vga_probe_unit(device_get_unit(dev), &adp, device_get_flags(dev));
 	if (error == 0) {
+		device_set_desc(dev, "Generic ISA VGA");
 		bus_set_resource(dev, SYS_RES_IOPORT, 0,
 				 adp.va_io_base, adp.va_io_size);
 		bus_set_resource(dev, SYS_RES_MEMORY, 0,
@@ -124,10 +187,6 @@ static int
 isavga_attach(device_t dev)
 {
 	vga_softc_t *sc;
-	devclass_t dc;
-	device_t *devs;
-	void *vgapci_sc;
-	int count, i;
 	int unit;
 	int rid;
 	int error;
@@ -161,108 +220,29 @@ isavga_attach(device_t dev)
 	bus_generic_attach(dev);
 #endif
 
-	/* Find the matching PCI video controller. */
-	if (unit == 0) {
-		dc = devclass_find("vgapci");
-		if (dc != NULL &&
-		    devclass_get_devices(dc, &devs, &count) == 0) {
-			for (i = 0; i < count; i++)
-				if (device_get_flags(devs[i]) != 0) {
-					sc->pci_dev = devs[i];
-					break;
-				}
-			free(devs, M_TEMP);
-		}
-		if (sc->pci_dev != NULL) {
-			vgapci_sc = device_get_softc(sc->pci_dev);
-			*(device_t *)vgapci_sc = dev;
-			device_printf(dev, "associated with %s\n",
-			    device_get_nameunit(sc->pci_dev));
-		}
-	}
-
 	return (0);
 }
 
 static int
 isavga_suspend(device_t dev)
 {
-	vga_softc_t *sc;
-	device_t isa_dev;
-	int err, nbytes;
-
-	err = 0;
-	isa_dev = dev;
-	sc = device_get_softc(isa_dev);
-	if (sc->pci_dev != NULL)
-		dev = sc->pci_dev;
-	else
-		err = bus_generic_suspend(isa_dev);
-
-	/* Save the video state across the suspend. */
-	if (sc->state_buf != NULL)
-		goto save_palette;
-	nbytes = vidd_save_state(sc->adp, NULL, 0);
-	if (nbytes <= 0)
-		goto save_palette;
-	sc->state_buf = malloc(nbytes, M_TEMP, M_NOWAIT);
-	if (sc->state_buf == NULL)
-		goto save_palette;
-	if (bootverbose)
-		device_printf(dev, "saving %d bytes of video state\n", nbytes);
-	if (vidd_save_state(sc->adp, sc->state_buf, nbytes) != 0) {
-		device_printf(dev, "failed to save state (nbytes=%d)\n",
-		    nbytes);
-		free(sc->state_buf, M_TEMP);
-		sc->state_buf = NULL;
-	}
+	int error;
 
-save_palette:
-	/* Save the color palette across the suspend. */
-	if (sc->pal_buf != NULL)
-		return (err);
-	sc->pal_buf = malloc(256 * 3, M_TEMP, M_NOWAIT);
-	if (sc->pal_buf != NULL) {
-		if (bootverbose)
-			device_printf(dev, "saving color palette\n");
-		if (vidd_save_palette(sc->adp, sc->pal_buf) != 0) {
-			device_printf(dev, "failed to save palette\n");
-			free(sc->pal_buf, M_TEMP);
-			sc->pal_buf = NULL;
-		}
-	}
+	error = bus_generic_suspend(dev);
+	if (error != 0)
+		return (error);
+	vga_suspend(dev);
 
-	return (err);
+	return (error);
 }
 
 static int
 isavga_resume(device_t dev)
 {
-	vga_softc_t *sc;
-	device_t isa_dev;
 
-	isa_dev = dev;
-	sc = device_get_softc(isa_dev);
-	if (sc->pci_dev != NULL)
-		dev = sc->pci_dev;
+	vga_resume(dev);
 
-	if (sc->state_buf != NULL) {
-		if (vidd_load_state(sc->adp, sc->state_buf) != 0)
-			device_printf(dev, "failed to reload state\n");
-		free(sc->state_buf, M_TEMP);
-		sc->state_buf = NULL;
-	}
-	if (sc->pal_buf != NULL) {
-		if (vidd_load_palette(sc->adp, sc->pal_buf) != 0)
-			device_printf(dev, "failed to reload palette\n");
-		free(sc->pal_buf, M_TEMP);
-		sc->pal_buf = NULL;
-	}
-
-	if (isa_dev != dev)
-		return (0);
-
-	return (bus_generic_resume(isa_dev));
+	return (bus_generic_resume(dev));
 }
 
 #ifdef FB_INSTALL_CDEV
@@ -323,3 +303,76 @@ static driver_t isavga_driver = {
 };
 
 DRIVER_MODULE(vga, isa, isavga_driver, isavga_devclass, 0, 0);
+
+static devclass_t	vgapm_devclass;
+
+static void
+vgapm_identify(driver_t *driver, device_t parent)
+{
+
+	if (device_get_flags(parent) != 0)
+		device_add_child(parent, "vgapm", 0);
+}
+
+static int
+vgapm_probe(device_t dev)
+{
+
+	device_set_desc(dev, "VGA suspend/resume");
+	device_quiet(dev);
+
+	return (BUS_PROBE_DEFAULT);
+}
+
+static int
+vgapm_attach(device_t dev)
+{
+
+	return (0);
+}
+
+static int
+vgapm_suspend(device_t dev)
+{
+	device_t vga_dev;
+	int error;
+
+	error = bus_generic_suspend(dev);
+	if (error != 0)
+		return (error);
+	vga_dev = devclass_get_device(isavga_devclass, 0);
+	if (vga_dev == NULL)
+		return (0);
+	vga_suspend(vga_dev);
+
+	return (0);
+}
+
+static int
+vgapm_resume(device_t dev)
+{
+	device_t vga_dev;
+
+	vga_dev = devclass_get_device(isavga_devclass, 0);
+	if (vga_dev != NULL)
+		vga_resume(vga_dev);
+
+	return (bus_generic_resume(dev));
+}
+
+static device_method_t vgapm_methods[] = {
+	DEVMETHOD(device_identify,	vgapm_identify),
+	DEVMETHOD(device_probe,		vgapm_probe),
+	DEVMETHOD(device_attach,	vgapm_attach),
+	DEVMETHOD(device_suspend,	vgapm_suspend),
+	DEVMETHOD(device_resume,	vgapm_resume),
+	{ 0, 0 }
+};
+
+static driver_t vgapm_driver = {
+	"vgapm",
+	vgapm_methods,
+	0
+};
+
+DRIVER_MODULE(vgapm, vgapci, vgapm_driver, vgapm_devclass, 0, 0);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 18:00:24 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7FE6B106566C;
	Thu, 12 Nov 2009 18:00:24 +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 1FE1D8FC17;
	Thu, 12 Nov 2009 18:00:24 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nACHtTgH060579;
	Thu, 12 Nov 2009 10:55:29 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 12 Nov 2009 10:55:42 -0700 (MST)
Message-Id: <20091112.105542.643508160.imp@bsdimp.com>
To: antoine@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: 
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, delphij@FreeBSD.org
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 18:00:24 -0000

In message: 
            Antoine Brodin  writes:
: On Wed, Nov 11, 2009 at 10:30 PM, Xin LI  wrote:=

: > Author: delphij
: > Date: Wed Nov 11 21:30:58 2009
: > New Revision: 199201
: > URL: http://svn.freebsd.org/changeset/base/199201
: >
: > Log:
: > =A0Add interface description capability as inspired by OpenBSD.
: >
: > =A0MFC after: =A0 =A03 months
: >
: > Modified:
: > =A0head/contrib/libpcap/inet.c
: > =A0head/sbin/ifconfig/ifconfig.8
: > =A0head/sbin/ifconfig/ifconfig.c
: > =A0head/share/man/man4/netintro.4
: > =A0head/sys/kern/kern_jail.c
: > =A0head/sys/net/if.c
: > =A0head/sys/net/if.h
: > =A0head/sys/net/if_var.h
: > =A0head/sys/sys/param.h
: > =A0head/sys/sys/priv.h
: > =A0head/sys/sys/sockio.h
: ...
: > Modified: head/sys/net/if_var.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/net/if_var.h =A0 =A0 =A0 Wed Nov 11 21:18:27 2009 =A0 =
=A0 =A0 =A0(r199200)
: > +++ head/sys/net/if_var.h =A0 =A0 =A0 Wed Nov 11 21:30:58 2009 =A0 =
=A0 =A0 =A0(r199201)
: > @@ -198,6 +198,7 @@ struct ifnet {
: > =A0 =A0 =A0 =A0void =A0 =A0*if_pf_kif;
: > =A0 =A0 =A0 =A0void =A0 =A0*if_lagg; =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*=
 lagg glue */
: > =A0 =A0 =A0 =A0u_char =A0 if_alloctype; =A0 =A0 =A0 =A0 =A0/* if_ty=
pe at time of allocation */
: > + =A0 =A0 =A0 struct sbuf *if_description; =A0 =A0/* interface desc=
ription */
: >
: > =A0 =A0 =A0 =A0/*
: > =A0 =A0 =A0 =A0 * Spare fields are added so that we can modify sens=
itive data
: > @@ -205,7 +206,7 @@ struct ifnet {
: > =A0 =A0 =A0 =A0 * be used with care where binary compatibility is r=
equired.
: > =A0 =A0 =A0 =A0 */
: > =A0 =A0 =A0 =A0char =A0 =A0 if_cspare[3];
: > - =A0 =A0 =A0 void =A0 =A0*if_pspare[8];
: > + =A0 =A0 =A0 void =A0 =A0*if_pspare[7];
: > =A0 =A0 =A0 =A0int =A0 =A0 if_ispare[4];
: > =A0};
: =

: Hi Delphij,
: =

: Doesn't this break ABI gratuitously?  (I think it changes the size of=

: struct ifnet)

In head this is OK (it doean't break the size).  In -stable, it should
instead look like:

=A0 =A0 =A0 =A0char =A0 =A0 if_cspare[3];
- =A0 =A0 =A0 void =A0 =A0*if_pspare[8];
+ =A0 =A0 =A0 void =A0 =A0*if_pspare[7];
+ =A0 =A0 =A0 struct sbuf=A0*if_description;

of course, in -head it could look that way too and not force a
recompile of everything that groks ifnets...

Warner


From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 18:16:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 927D7106566B;
	Thu, 12 Nov 2009 18:16: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 8198F8FC18;
	Thu, 12 Nov 2009 18:16: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 nACIGZDZ038426;
	Thu, 12 Nov 2009 18:16:35 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACIGZrM038423;
	Thu, 12 Nov 2009 18:16:35 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200911121816.nACIGZrM038423@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 12 Nov 2009 18:16: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: r199230 - in head/sys/dev: dpms fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 18:16:35 -0000

Author: jkim
Date: Thu Nov 12 18:16:35 2009
New Revision: 199230
URL: http://svn.freebsd.org/changeset/base/199230

Log:
  - Remove a redundant check for dpms(4).
  - Test a cheaper function first.

Modified:
  head/sys/dev/dpms/dpms.c
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/dpms/dpms.c
==============================================================================
--- head/sys/dev/dpms/dpms.c	Thu Nov 12 17:56:56 2009	(r199229)
+++ head/sys/dev/dpms/dpms.c	Thu Nov 12 18:16:35 2009	(r199230)
@@ -125,12 +125,8 @@ static void
 dpms_identify(driver_t *driver, device_t parent)
 {
 
-	/* The DPMS VBE only allows for manipulating a single monitor. */
-	if (devclass_get_device(dpms_devclass, 0) != NULL)
-		return;
-
-	if (x86bios_match_device(0xc0000, parent) &&
-	    device_get_flags(parent) != 0)
+	if (device_get_flags(parent) != 0 &&
+	    x86bios_match_device(0xc0000, parent))
 		device_add_child(parent, "dpms", 0);
 }
 

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Thu Nov 12 17:56:56 2009	(r199229)
+++ head/sys/dev/fb/vesa.c	Thu Nov 12 18:16:35 2009	(r199230)
@@ -250,8 +250,8 @@ vesa_bios_post(void)
 	dc = devclass_find("vgapci");
 	if (dc != NULL && devclass_get_devices(dc, &devs, &count) == 0) {
 		for (dev = NULL, i = 0; dev == NULL && i < count; devs++, i++)
-			if (x86bios_match_device(0xc0000, *devs) &&
-			    device_get_flags(*devs) != 0) {
+			if (device_get_flags(*devs) != 0 &&
+			    x86bios_match_device(0xc0000, *devs)) {
 				dev = *devs;
 				is_pci = 1;
 				break;

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 18:17:41 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F0D8B1065692;
	Thu, 12 Nov 2009 18:17:41 +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 AFBE68FC0A;
	Thu, 12 Nov 2009 18:17:41 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nACI7JhN060710;
	Thu, 12 Nov 2009 11:07:19 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 12 Nov 2009 11:07:32 -0700 (MST)
Message-Id: <20091112.110732.1938114630.imp@bsdimp.com>
To: brde@optusnet.com.au
From: "M. Warner Losh" 
In-Reply-To: <20091103214231.H23957@delplex.bde.org>
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, delphij@FreeBSD.org
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 18:17:42 -0000

I'd argue that as we get more and more cores that %CPU will need to
change.

If we change it like Bruce suggests, then when we have 1024
core/thread processors the 'pegged' thread shows up as 0.09% of the
CPU and likely nothing else shows up at all since the usages are
diluted by a factor of 1024.

However, for the 'TOP' display, 102400% of the CPU seems like a crazy
thing to report, even if it is consistent with what other systems
report for fewer cores going back to 1980's when VMS reported up to
200% CPU for the VAX 11/785 on both BSD and VMS.

Likewise, we have issues with our current TOP display eating up a
bunch of columns for 55670k of core when 56M would generally give the
same info to the user (I say generally, because the former is useful
in watching for memory leaks).

Maybe we just need to have top offer different views into this data
for the different needs that people have for it.  A 'detailed' view
that helps expose even small differences that is useful in
development, and a 'condensed' version that gives more of the general
sense of what's going on in the system in a more concise format, but
might lack some of the details found today.

Here's where my bikeshed proximity detector starts beeping...

Warner

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 18:26:34 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0943C106568B;
	Thu, 12 Nov 2009 18:26:34 +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 A70818FC12;
	Thu, 12 Nov 2009 18:26:33 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nACIFSjw060860;
	Thu, 12 Nov 2009 11:15:28 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 12 Nov 2009 11:15:41 -0700 (MST)
Message-Id: <20091112.111541.1310106669.imp@bsdimp.com>
To: antoine@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <20091112.105542.643508160.imp@bsdimp.com>
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	
	<20091112.105542.643508160.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=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, delphij@FreeBSD.org
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 18:26:34 -0000

In message: <20091112.105542.643508160.imp@bsdimp.com>
            "M. Warner Losh"  writes:
: In message: 
:             Antoine Brodin  writes:
: : On Wed, Nov 11, 2009 at 10:30 PM, Xin LI  wrot=
e:
: : > Author: delphij
: : > Date: Wed Nov 11 21:30:58 2009
: : > New Revision: 199201
: : > URL: http://svn.freebsd.org/changeset/base/199201
: : >
: : > Log:
: : > =A0Add interface description capability as inspired by OpenBSD.
: : >
: : > =A0MFC after: =A0 =A03 months
: : >
: : > Modified:
: : > =A0head/contrib/libpcap/inet.c
: : > =A0head/sbin/ifconfig/ifconfig.8
: : > =A0head/sbin/ifconfig/ifconfig.c
: : > =A0head/share/man/man4/netintro.4
: : > =A0head/sys/kern/kern_jail.c
: : > =A0head/sys/net/if.c
: : > =A0head/sys/net/if.h
: : > =A0head/sys/net/if_var.h
: : > =A0head/sys/sys/param.h
: : > =A0head/sys/sys/priv.h
: : > =A0head/sys/sys/sockio.h
: : ...
: : > Modified: head/sys/net/if_var.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/net/if_var.h =A0 =A0 =A0 Wed Nov 11 21:18:27 2009 =A0=
 =A0 =A0 =A0(r199200)
: : > +++ head/sys/net/if_var.h =A0 =A0 =A0 Wed Nov 11 21:30:58 2009 =A0=
 =A0 =A0 =A0(r199201)
: : > @@ -198,6 +198,7 @@ struct ifnet {
: : > =A0 =A0 =A0 =A0void =A0 =A0*if_pf_kif;
: : > =A0 =A0 =A0 =A0void =A0 =A0*if_lagg; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
/* lagg glue */
: : > =A0 =A0 =A0 =A0u_char =A0 if_alloctype; =A0 =A0 =A0 =A0 =A0/* if_=
type at time of allocation */
: : > + =A0 =A0 =A0 struct sbuf *if_description; =A0 =A0/* interface de=
scription */
: : >
: : > =A0 =A0 =A0 =A0/*
: : > =A0 =A0 =A0 =A0 * Spare fields are added so that we can modify se=
nsitive data
: : > @@ -205,7 +206,7 @@ struct ifnet {
: : > =A0 =A0 =A0 =A0 * be used with care where binary compatibility is=
 required.
: : > =A0 =A0 =A0 =A0 */
: : > =A0 =A0 =A0 =A0char =A0 =A0 if_cspare[3];
: : > - =A0 =A0 =A0 void =A0 =A0*if_pspare[8];
: : > + =A0 =A0 =A0 void =A0 =A0*if_pspare[7];
: : > =A0 =A0 =A0 =A0int =A0 =A0 if_ispare[4];
: : > =A0};
: : =

: : Hi Delphij,
: : =

: : Doesn't this break ABI gratuitously?  (I think it changes the size =
of
: : struct ifnet)
: =

: In head this is OK (it doean't break the size).  In -stable, it shoul=
d

Actually, I'm wrong.  It does break the size due to the 3 characters
of new padding...

: instead look like:
: =

: =A0 =A0 =A0 =A0char =A0 =A0 if_cspare[3];
: - =A0 =A0 =A0 void =A0 =A0*if_pspare[8];
: + =A0 =A0 =A0 void =A0 =A0*if_pspare[7];
: + =A0 =A0 =A0 struct sbuf=A0*if_description;
: =

: of course, in -head it could look that way too and not force a
: recompile of everything that groks ifnets...


From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 18:50:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13034106568F;
	Thu, 12 Nov 2009 18:50:50 +0000 (UTC) (envelope-from flo@smeets.im)
Received: from mail.solomo.de (mail.solomo.de [85.214.49.72])
	by mx1.freebsd.org (Postfix) with ESMTP id B94788FC12;
	Thu, 12 Nov 2009 18:50:49 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by mail.solomo.de (Postfix) with ESMTP id 90C6C3F499;
	Thu, 12 Nov 2009 19:50:48 +0100 (CET)
X-Virus-Scanned: amavisd-new at vistream.de
Received: from mail.solomo.de ([127.0.0.1])
	by localhost (mail.solomo.de [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id qTt1IKLPGtJL; Thu, 12 Nov 2009 19:50:46 +0100 (CET)
Received: from [192.168.0.113] (p50916A71.dip.t-dialin.net [80.145.106.113])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.solomo.de (Postfix) with ESMTPSA id D4EB23F44F;
	Thu, 12 Nov 2009 19:50:45 +0100 (CET)
Message-ID: <4AFC5905.70101@smeets.im>
Date: Thu, 12 Nov 2009 19:50:45 +0100
From: Florian Smeets 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.1.5) Gecko/20091112 Lightning/1.0pre Shredder/3.0pre
MIME-Version: 1.0
To: Kostik Belousov 
References: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>	<20091111215651.GM64905@hoeg.nl>	<20091111223340.GF2331@deviant.kiev.zoral.com.ua>
	<20091112145506.GH2331@deviant.kiev.zoral.com.ua>
In-Reply-To: <20091112145506.GH2331@deviant.kiev.zoral.com.ua>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, Ed Schouten ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 18:50:50 -0000

On 11/12/09 3:55 PM, Kostik Belousov wrote:
> On Thu, Nov 12, 2009 at 12:33:40AM +0200, Kostik Belousov wrote:
>> On Wed, Nov 11, 2009 at 10:56:51PM +0100, Ed Schouten wrote:
>>> Hi,
>>>
>>> * Jun Kuriyama  wrote:
>>>> Can you test with these patches?  Testing on only one of both system
>>>> is enough.  "patch-1" forces disabling CLFLUSH feature even if SS bit
>>>> exists.  "patch-2" forces no CLFLUSH tweak.  I'd like to know with
>>>> which patch your system can live.
>>>
>>> For some reason they both seem to boot. Yikes. I've done some more
>>> testing and it seems the old version even hangs if I add some additional
>>> printf's above and below, which makes me believe the problem is a bit
>>> more complex than we realize...
>>
>> The only thing I see now is that TUNABLE_INT declaration is not needed,
>> since SYSINIT is started after hammer_time(), so TUNABLE_FETCH is
>> processed after everything is done for BSP.
>>
>> Wait, are your machines SMP ? Hmm, could you, please, remove TUNABLE_INT()
>> and see how it ends up ?
>
> [Selecting random email in the thread].
>
> Luckily, my co-worker has laptop that runs HEAD and exhibited the
> problem. Patch below fixed the hang for him. Will be happy to get
> confirmation that patch fixes the hung for other people who reported it.
>
> http://people.freebsd.org/~kib/misc/initcache.1.patch
>
> Issue is that TUNABLE_INT_FETCH was called on AP while CPU was not
> initialized properly, in particular, curthread was not set etc. But,
> kernel environment is already switched to dynamic, so access needs to
> lock a mutex.
>
> I am currently looking at i386, that probably needs similar change.
>

r199229 + your patch boots again.

Thank you very much!

Cheers,
Florian

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 19:02:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9600010656CB;
	Thu, 12 Nov 2009 19:02: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 82DB88FC2C;
	Thu, 12 Nov 2009 19:02: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 nACJ2AgB039578;
	Thu, 12 Nov 2009 19:02:10 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACJ2AQP039566;
	Thu, 12 Nov 2009 19:02:10 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200911121902.nACJ2AQP039566@svn.freebsd.org>
From: Xin LI 
Date: Thu, 12 Nov 2009 19:02: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: r199231 - in head: contrib/libpcap sbin/ifconfig
	share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 19:02:10 -0000

Author: delphij
Date: Thu Nov 12 19:02:10 2009
New Revision: 199231
URL: http://svn.freebsd.org/changeset/base/199231

Log:
  Revert revision 199201 for now as it has introduced a kernel vulnerability
  and requires more polishing.

Modified:
  head/contrib/libpcap/inet.c
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifconfig.c
  head/share/man/man4/netintro.4
  head/sys/kern/kern_jail.c
  head/sys/net/if.c
  head/sys/net/if.h
  head/sys/net/if_var.h
  head/sys/sys/param.h
  head/sys/sys/priv.h
  head/sys/sys/sockio.h

Modified: head/contrib/libpcap/inet.c
==============================================================================
--- head/contrib/libpcap/inet.c	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/contrib/libpcap/inet.c	Thu Nov 12 19:02:10 2009	(r199231)
@@ -403,30 +403,22 @@ add_addr_to_iflist(pcap_if_t **alldevs, 
 	pcap_addr_t *curaddr, *prevaddr, *nextaddr;
 #ifdef SIOCGIFDESCR
 	struct ifreq ifrdesc;
-#ifdef __FreeBSD__
-#define _IFDESCRSIZE 64
-	char ifdescr[_IFDESCRSIZE];
-#else
 	char ifdescr[IFDESCRSIZE];
-#endif
 	int s;
+#endif
 
+#ifdef SIOCGIFDESCR
 	/*
 	 * Get the description for the interface.
 	 */
 	memset(&ifrdesc, 0, sizeof ifrdesc);
 	strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
-#ifdef __FreeBSD__
-	ifrdesc.ifr_buffer.buffer = ifdescr;
-	ifrdesc.ifr_buffer.length = _IFDESCRSIZE;
-#else
 	ifrdesc.ifr_data = (caddr_t)&ifdescr;
-#endif
 	s = socket(AF_INET, SOCK_DGRAM, 0);
 	if (s >= 0) {
 		if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0 &&
-		    strlen(ifdescr) != 0)
-			description = ifdescr;
+		    strlen(ifrdesc.ifr_data) != 0)
+			description = ifrdesc.ifr_data;
 		close(s);
 	}
 #endif

Modified: head/sbin/ifconfig/ifconfig.8
==============================================================================
--- head/sbin/ifconfig/ifconfig.8	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sbin/ifconfig/ifconfig.8	Thu Nov 12 19:02:10 2009	(r199231)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd November 11, 2009
+.Dd September 23, 2009
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -258,12 +258,6 @@ Disable permanently promiscuous mode.
 Another name for the
 .Fl alias
 parameter.
-.It Cm description Ar value
-Specify a description of the interface.
-This can be used to label interfaces in situations where they may
-otherwise be difficult to distinguish.
-.It Cm -description
-Clear the interface description.
 .It Cm down
 Mark an interface
 .Dq down .
@@ -2518,10 +2512,6 @@ Configure the interface
 to use 100baseTX, full duplex Ethernet media options:
 .Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
 .Pp
-Label the em0 interface as an uplink:
-.Pp
-.Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
-.Pp
 Create the software network interface
 .Li gif1 :
 .Dl # ifconfig gif1 create

Modified: head/sbin/ifconfig/ifconfig.c
==============================================================================
--- head/sbin/ifconfig/ifconfig.c	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sbin/ifconfig/ifconfig.c	Thu Nov 12 19:02:10 2009	(r199231)
@@ -83,8 +83,6 @@ static const char rcsid[] =
 struct	ifreq ifr;
 
 char	name[IFNAMSIZ];
-char	*descr = NULL;
-size_t	descrlen = 64;
 int	setaddr;
 int	setmask;
 int	doalias;
@@ -824,36 +822,6 @@ setifname(const char *val, int dummy __u
 	free(newname);
 }
 
-/* ARGSUSED */
-static void
-setifdescr(const char *val, int dummy __unused, int s, 
-    const struct afswtch *afp)
-{
-	char *newdescr;
-
-	newdescr = strdup(val);
-	if (newdescr == NULL) {
-		warn("no memory to set ifdescr");
-		return;
-	}
-	ifr.ifr_buffer.buffer = newdescr;
-	ifr.ifr_buffer.length = strlen(newdescr);
-	if (ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0) {
-		warn("ioctl (set descr)");
-		free(newdescr);
-		return;
-	}
-	free(newdescr);
-}
-
-/* ARGSUSED */
-static void
-unsetifdescr(const char *val, int value, int s, const struct afswtch *afp)
-{
-
-	setifdescr("", 0, s, 0);
-}
-
 #define	IFFBITS \
 "\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6SMART\7RUNNING" \
 "\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2" \
@@ -898,23 +866,6 @@ status(const struct afswtch *afp, const 
 		printf(" mtu %d", ifr.ifr_mtu);
 	putchar('\n');
 
-	descr = reallocf(descr, descrlen);
-	if (descr != NULL) {
-		do {
-			ifr.ifr_buffer.buffer = descr;
-			ifr.ifr_buffer.length = descrlen;
-			if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) {
-			    if (strlen(descr) > 0)
-				printf("\tdescription: %s\n", descr);
-			    break;
-			}
-			if (errno == ENAMETOOLONG) {
-				descrlen *= 2;
-				descr = reallocf(descr, descrlen);
-			}
-		} while (errno == ENAMETOOLONG);
-	}
-
 	if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) {
 		if (ifr.ifr_curcap != 0) {
 			printb("\toptions", ifr.ifr_curcap, IFCAPBITS);
@@ -1084,10 +1035,6 @@ static struct cmd basic_cmds[] = {
 	DEF_CMD("-arp",		IFF_NOARP,	setifflags),
 	DEF_CMD("debug",	IFF_DEBUG,	setifflags),
 	DEF_CMD("-debug",	-IFF_DEBUG,	setifflags),
-	DEF_CMD_ARG("description",		setifdescr),
-	DEF_CMD_ARG("descr",			setifdescr),
-	DEF_CMD("-description",	0,		unsetifdescr),
-	DEF_CMD("-descr",	0,		unsetifdescr),
 	DEF_CMD("promisc",	IFF_PPROMISC,	setifflags),
 	DEF_CMD("-promisc",	-IFF_PPROMISC,	setifflags),
 	DEF_CMD("add",		IFF_UP,		notealias),

Modified: head/share/man/man4/netintro.4
==============================================================================
--- head/share/man/man4/netintro.4	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/share/man/man4/netintro.4	Thu Nov 12 19:02:10 2009	(r199231)
@@ -32,7 +32,7 @@
 .\"     @(#)netintro.4	8.2 (Berkeley) 11/30/93
 .\" $FreeBSD$
 .\"
-.Dd November 11, 2009
+.Dd June 18, 2004
 .Dt NETINTRO 4
 .Os
 .Sh NAME
@@ -277,25 +277,6 @@ and
 fields of the
 .Vt ifreq
 structure, respectively.
-.It Dv SIOCGIFDESCR
-Get the interface description, returned in the
-.Va buffer
-field of
-.Va ifru_buffer
-struct.
-The user supplied buffer length should defined in the
-.Va length
-field of
-.Va ifru_buffer
-struct passed in as parameter.
-.It Dv SIOCSIFDESCR
-Set the interface description to the value of the
-.Va buffer
-field of
-.Va ifru_buffer
-struct, with
-.Va length
-field specifying its length.
 .It Dv SIOCSIFFLAGS
 Set interface flags field.
 If the interface is marked down,

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/kern/kern_jail.c	Thu Nov 12 19:02:10 2009	(r199231)
@@ -3467,7 +3467,6 @@ prison_priv_check(struct ucred *cred, in
 	case PRIV_NET_SETIFMTU:
 	case PRIV_NET_SETIFFLAGS:
 	case PRIV_NET_SETIFCAP:
-	case PRIV_NET_SETIFDESCR:
 	case PRIV_NET_SETIFNAME	:
 	case PRIV_NET_SETIFMETRIC:
 	case PRIV_NET_SETIFPHYS:

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/net/if.c	Thu Nov 12 19:02:10 2009	(r199231)
@@ -463,8 +463,6 @@ if_free_internal(struct ifnet *ifp)
 #ifdef MAC
 	mac_ifnet_destroy(ifp);
 #endif /* MAC */
-	if (ifp->if_description != NULL)
-		sbuf_delete(ifp->if_description);
 	IF_AFDATA_DESTROY(ifp);
 	IF_ADDR_LOCK_DESTROY(ifp);
 	ifq_delete(&ifp->if_snd);
@@ -2092,45 +2090,6 @@ ifhwioctl(u_long cmd, struct ifnet *ifp,
 		ifr->ifr_phys = ifp->if_physical;
 		break;
 
-	case SIOCGIFDESCR:
-		IF_AFDATA_RLOCK(ifp);
-		if (ifp->if_description == NULL)
-			error = ENOMSG;
-		else
-			error = copystr(sbuf_data(ifp->if_description),
-					ifr->ifr_buffer.buffer,
-					ifr->ifr_buffer.length, NULL);
-		IF_AFDATA_RUNLOCK(ifp);
-		break;
-
-	case SIOCSIFDESCR:
-		error = priv_check(td, PRIV_NET_SETIFDESCR);
-		if (error)
-			return (error);
-
-		IF_AFDATA_WLOCK(ifp);
-		if (ifp->if_description == NULL) {
-			ifp->if_description = sbuf_new_auto();
-			if (ifp->if_description == NULL) {
-				error = ENOMEM;
-				IF_AFDATA_WUNLOCK(ifp);
-				break;
-			}
-		} else
-			sbuf_clear(ifp->if_description);
-
-		if (sbuf_copyin(ifp->if_description, ifr->ifr_buffer.buffer,
-				ifr->ifr_buffer.length) == -1)
-			error = EFAULT;
-
-		if (error == 0) {
-			sbuf_finish(ifp->if_description);
-			getmicrotime(&ifp->if_lastchange);
-		}
-		IF_AFDATA_WUNLOCK(ifp);
-
-		break;
-
 	case SIOCSIFFLAGS:
 		error = priv_check(td, PRIV_NET_SETIFFLAGS);
 		if (error)

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/net/if.h	Thu Nov 12 19:02:10 2009	(r199231)
@@ -294,7 +294,6 @@ struct	ifreq {
 		struct	sockaddr ifru_addr;
 		struct	sockaddr ifru_dstaddr;
 		struct	sockaddr ifru_broadaddr;
-		struct { size_t length; caddr_t	buffer; } ifru_buffer;
 		short	ifru_flags[2];
 		short	ifru_index;
 		int	ifru_jid;
@@ -308,7 +307,6 @@ struct	ifreq {
 #define	ifr_addr	ifr_ifru.ifru_addr	/* address */
 #define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
 #define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address */
-#define	ifr_buffer	ifr_ifru.ifru_buffer	/* user supplied buffer with its length */
 #define	ifr_flags	ifr_ifru.ifru_flags[0]	/* flags (low 16 bits) */
 #define	ifr_flagshigh	ifr_ifru.ifru_flags[1]	/* flags (high 16 bits) */
 #define	ifr_jid		ifr_ifru.ifru_jid	/* jail/vnet */

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/net/if_var.h	Thu Nov 12 19:02:10 2009	(r199231)
@@ -198,7 +198,6 @@ struct ifnet {
 	void	*if_pf_kif;
 	void	*if_lagg;		/* lagg glue */
 	u_char	 if_alloctype;		/* if_type at time of allocation */
-	struct sbuf *if_description;	/* interface description */
 
 	/*
 	 * Spare fields are added so that we can modify sensitive data
@@ -206,7 +205,7 @@ struct ifnet {
 	 * be used with care where binary compatibility is required.
 	 */
 	char	 if_cspare[3];
-	void	*if_pspare[7];
+	void	*if_pspare[8];
 	int	if_ispare[4];
 };
 

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/sys/param.h	Thu Nov 12 19:02:10 2009	(r199231)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 900003	/* Master, propagated to newvers */
+#define __FreeBSD_version 900002	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/sys/priv.h	Thu Nov 12 19:02:10 2009	(r199231)
@@ -335,7 +335,6 @@
 #define	PRIV_NET_LAGG		415	/* Administer lagg interface. */
 #define	PRIV_NET_GIF		416	/* Administer gif interface. */
 #define	PRIV_NET_SETIFVNET	417	/* Move interface to vnet. */
-#define	PRIV_NET_SETIFDESCR	418	/* Set interface description. */
 
 /*
  * 802.11-related privileges.

Modified: head/sys/sys/sockio.h
==============================================================================
--- head/sys/sys/sockio.h	Thu Nov 12 18:16:35 2009	(r199230)
+++ head/sys/sys/sockio.h	Thu Nov 12 19:02:10 2009	(r199231)
@@ -82,8 +82,6 @@
 #define	SIOCGIFMAC	_IOWR('i', 38, struct ifreq)	/* get IF MAC label */
 #define	SIOCSIFMAC	 _IOW('i', 39, struct ifreq)	/* set IF MAC label */
 #define	SIOCSIFNAME	 _IOW('i', 40, struct ifreq)	/* set IF name */
-#define	SIOCSIFDESCR	 _IOW('i', 41, struct ifreq)	/* set ifnet descr */ 
-#define	SIOCGIFDESCR	_IOWR('i', 42, struct ifreq)	/* get ifnet descr */ 
 
 #define	SIOCADDMULTI	 _IOW('i', 49, struct ifreq)	/* add m'cast addr */
 #define	SIOCDELMULTI	 _IOW('i', 50, struct ifreq)	/* del m'cast addr */

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 19:05:10 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 12E521065676;
	Thu, 12 Nov 2009 19:05:10 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.geekcn.org (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net
	[IPv6:2001:470:1f03:2c9::2])
	by mx1.freebsd.org (Postfix) with ESMTP id A7D5D8FC0A;
	Thu, 12 Nov 2009 19:05:09 +0000 (UTC)
Received: from localhost (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id 47AE555CD8F1;
	Fri, 13 Nov 2009 03:05:08 +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 YVLss80BUZPd; Fri, 13 Nov 2009 03:04:56 +0800 (CST)
Received: from delta.delphij.net (drawbridge.ixsystems.net [206.40.55.65])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.geekcn.org (Postfix) with ESMTPSA id C10CD55CD8C3;
	Fri, 13 Nov 2009 03:04:52 +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=QUXoOjPks8mcB0AID1/JZ9pqQEIgoyLAxSnKDlpSxHpnwEoL1Go4iWmHdw1yJhKze
	D6/wzyU0FMbluN/R8f6aw==
Message-ID: <4AFC5C51.1010807@delphij.net>
Date: Thu, 12 Nov 2009 11:04:49 -0800
From: Xin LI 
Organization: The Geek China Organization
User-Agent: Thunderbird 2.0.0.23 (X11/20091022)
MIME-Version: 1.0
To: Brooks Davis 
References: <200911112130.nABLUw9b007768@svn.freebsd.org>
	<20091112135211.GT64905@hoeg.nl> <86hbsz24sq.fsf@ds4.des.no>
	
	<20091112160849.GB65026@lor.one-eyed-alien.net>
In-Reply-To: <20091112160849.GB65026@lor.one-eyed-alien.net>
X-Enigmail-Version: 0.95.7
OpenPGP: id=18EDEBA0;
	url=http://www.delphij.net/delphij.asc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: Ed Schouten , src-committers@FreeBSD.ORG,
	svn-src-all@FreeBSD.ORG, Xin LI ,
	svn-src-head@FreeBSD.ORG, Dag-Erling Sm?rgrav ,
	Robert Watson 
Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig
 share/man/man4 sys/kern sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: d@delphij.net
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 19:05:10 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys,

I've just reverted this changeset and will work to address all these
problems you have raised.  I'll post the new patchset to -net@ for
review.  Thanks for your comments!

Cheers,
- --
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (FreeBSD)

iEYEARECAAYFAkr8XFEACgkQi+vbBBjt66C0DACeOstfcmWW89SoW61y9OmKZxWN
PUQAnRCFMk3fWefwMdCUI2AtH9KJTqEj
=SO/J
-----END PGP SIGNATURE-----

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 19:30:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC5011065695;
	Thu, 12 Nov 2009 19:30:49 +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 BB4708FC17;
	Thu, 12 Nov 2009 19:30: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 nACJUnvF041110;
	Thu, 12 Nov 2009 19:30:49 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACJUn7O041108;
	Thu, 12 Nov 2009 19:30:49 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200911121930.nACJUn7O041108@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 12 Nov 2009 19:30:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199232 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 19:30:49 -0000

Author: rpaulo
Date: Thu Nov 12 19:30:49 2009
New Revision: 199232
URL: http://svn.freebsd.org/changeset/base/199232

Log:
  Add a missing check for Apple HFS partitions.
  
  MFC after:	1 week

Modified:
  head/sys/geom/part/g_part_gpt.c

Modified: head/sys/geom/part/g_part_gpt.c
==============================================================================
--- head/sys/geom/part/g_part_gpt.c	Thu Nov 12 19:02:10 2009	(r199231)
+++ head/sys/geom/part/g_part_gpt.c	Thu Nov 12 19:30:49 2009	(r199232)
@@ -736,6 +736,8 @@ g_part_gpt_type(struct g_part_table *bas
 		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS));
 	if (EQUUID(type, &gpt_uuid_mbr))
 		return (g_part_alias_name(G_PART_ALIAS_MBR));
+	if (EQUUID(type, &gpt_uuid_apple_hfs))
+		return (g_part_alias_name(G_PART_ALIAS_APPLE_HFS));
 	buf[0] = '!';
 	snprintf_uuid(buf + 1, bufsz - 1, type);
 	return (buf);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 19:43:13 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE6601065697
	for ; Thu, 12 Nov 2009 19:43:13 +0000 (UTC)
	(envelope-from julian@elischer.org)
Received: from outD.internet-mail-service.net (outd.internet-mail-service.net
	[216.240.47.227])
	by mx1.freebsd.org (Postfix) with ESMTP id D283C8FC21
	for ; Thu, 12 Nov 2009 19:43:13 +0000 (UTC)
Received: from idiom.com (mx0.idiom.com [216.240.32.160])
	by out.internet-mail-service.net (Postfix) with ESMTP id 07F5BC3FB;
	Thu, 12 Nov 2009 11:43:14 -0800 (PST)
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
Received: from julian-mac.elischer.org (64.1.209.194.ptr.us.xo.net
	[64.1.209.194]) by idiom.com (Postfix) with ESMTP id BB8922D6012;
	Thu, 12 Nov 2009 11:43:12 -0800 (PST)
Message-ID: <4AFC655E.406@elischer.org>
Date: Thu, 12 Nov 2009 11:43:26 -0800
From: Julian Elischer 
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
MIME-Version: 1.0
To: "M. Warner Losh" 
References: <200911030928.nA39SjLx085597@svn.freebsd.org>	<20091103214231.H23957@delplex.bde.org>
	<20091112.110732.1938114630.imp@bsdimp.com>
In-Reply-To: <20091112.110732.1938114630.imp@bsdimp.com>
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, delphij@FreeBSD.org, brde@optusnet.com.au
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 19:43:14 -0000

M. Warner Losh wrote:
> I'd argue that as we get more and more cores that %CPU will need to
> change.
> 
> If we change it like Bruce suggests, then when we have 1024
> core/thread processors the 'pegged' thread shows up as 0.09% of the
> CPU and likely nothing else shows up at all since the usages are
> diluted by a factor of 1024.
> 
> However, for the 'TOP' display, 102400% of the CPU seems like a crazy
> thing to report, even if it is consistent with what other systems
> report for fewer cores going back to 1980's when VMS reported up to
> 200% CPU for the VAX 11/785 on both BSD and VMS.
> 
> Likewise, we have issues with our current TOP display eating up a
> bunch of columns for 55670k of core when 56M would generally give the
> same info to the user (I say generally, because the former is useful
> in watching for memory leaks).
> 
> Maybe we just need to have top offer different views into this data
> for the different needs that people have for it.  A 'detailed' view
> that helps expose even small differences that is useful in
> development, and a 'condensed' version that gives more of the general
> sense of what's going on in the system in a more concise format, but
> might lack some of the details found today.
> 

If you select -H (all threads showing), then give it as  a% of a 
single CPU.

they can never be > 100% per thread.

for non -H show aggregate.

> Here's where my bikeshed proximity detector starts beeping...
> 
> Warner


From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 20:09:19 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9AA3F1065672;
	Thu, 12 Nov 2009 20:09:19 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au
	[211.29.132.187])
	by mx1.freebsd.org (Postfix) with ESMTP id 352598FC12;
	Thu, 12 Nov 2009 20:09:18 +0000 (UTC)
Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au
	[220.239.235.116])
	by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	nACK9CDt025376
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 13 Nov 2009 07:09:13 +1100
Date: Fri, 13 Nov 2009 07:09:12 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: "M. Warner Losh" 
In-Reply-To: <20091112.110732.1938114630.imp@bsdimp.com>
Message-ID: <20091113065648.K2448@besplex.bde.org>
References: <200911030928.nA39SjLx085597@svn.freebsd.org>
	<20091103214231.H23957@delplex.bde.org>
	<20091112.110732.1938114630.imp@bsdimp.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, delphij@FreeBSD.org, brde@optusnet.com.au
Subject: Re: svn commit: r198848 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 20:09:19 -0000

On Thu, 12 Nov 2009, M. Warner Losh wrote:

> I'd argue that as we get more and more cores that %CPU will need to
> change.
>
> If we change it like Bruce suggests, then when we have 1024
> core/thread processors the 'pegged' thread shows up as 0.09% of the
> CPU and likely nothing else shows up at all since the usages are
> diluted by a factor of 1024.

You mean, like I said not to.

> However, for the 'TOP' display, 102400% of the CPU seems like a crazy
> thing to report, even if it is consistent with what other systems
> report for fewer cores going back to 1980's when VMS reported up to
> 200% CPU for the VAX 11/785 on both BSD and VMS.

102400 isn't a very large number.  1M CPUs would give a more interesting
number.  Anyway, displaying %CPUs is the least of the problems in displaying
many threads in top.  top has the same problems as systat -p, but more so.
It wants to display the top active threads, while systat -p only wants to
display the top active threads if they are active enough to be considered
pigs.  You need the 6 metre high terminal to display the 1024 idle threads
for top -SH.  If you only want to display user threads then you will
still need O(ncpu) lines to display enough active ones if all of the CPUs
are actually used.

> Likewise, we have issues with our current TOP display eating up a
> bunch of columns for 55670k of core when 56M would generally give the
> same info to the user (I say generally, because the former is useful
> in watching for memory leaks).
>
> Maybe we just need to have top offer different views into this data
> for the different needs that people have for it.  A 'detailed' view
> that helps expose even small differences that is useful in
> development, and a 'condensed' version that gives more of the general
> sense of what's going on in the system in a more concise format, but
> might lack some of the details found today.
>
> Here's where my bikeshed proximity detector starts beeping...

Adding all the different views would take a lot of paint and many would
not like its color.  I just want to avoid changing the standard view
to one that works worse for small configurations.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 21:06:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 727A11065694;
	Thu, 12 Nov 2009 21:06:09 +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 0F1C28FC1F;
	Thu, 12 Nov 2009 21:06:09 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 11EB31CDC3; Thu, 12 Nov 2009 22:06:08 +0100 (CET)
Date: Thu, 12 Nov 2009 22:06:08 +0100
From: Ed Schouten 
To: Kostik Belousov 
Message-ID: <20091112210608.GV64905@hoeg.nl>
References: <7meio5g4yx.wl%kuriyama@s2factory.co.jp>
	<20091111215651.GM64905@hoeg.nl>
	<20091111223340.GF2331@deviant.kiev.zoral.com.ua>
	<20091112145506.GH2331@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="EDT6MSV0B3GxyNyZ"
Content-Disposition: inline
In-Reply-To: <20091112145506.GH2331@deviant.kiev.zoral.com.ua>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jun Kuriyama 
Subject: Re: svn commit: r199067 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 21:06:09 -0000


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

* Kostik Belousov  wrote:
> Luckily, my co-worker has laptop that runs HEAD and exhibited the
> problem. Patch below fixed the hang for him. Will be happy to get
> confirmation that patch fixes the hung for other people who reported it.
>=20
> http://people.freebsd.org/~kib/misc/initcache.1.patch

It works. Thanks!

--=20
 Ed Schouten 
 WWW: http://80386.nl/

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr8eL8ACgkQ52SDGA2eCwVdDACfWxHfplgDlbE6T03UKX2vLtxT
UV8AnjErLMU4jPXXp2BJ96wTQo1aZUiN
=qt2y
-----END PGP SIGNATURE-----

--EDT6MSV0B3GxyNyZ--

From owner-svn-src-head@FreeBSD.ORG  Thu Nov 12 21:51:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54E481065670;
	Thu, 12 Nov 2009 21:51:02 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4377B8FC08;
	Thu, 12 Nov 2009 21: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 nACLp25c044412;
	Thu, 12 Nov 2009 21:51:02 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACLp2wn044410;
	Thu, 12 Nov 2009 21:51:02 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200911122151.nACLp2wn044410@svn.freebsd.org>
From: Edwin Groothuis 
Date: Thu, 12 Nov 2009 21: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: r199236 - head/usr.bin/gencat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 12 Nov 2009 21:51:02 -0000

Author: edwin
Date: Thu Nov 12 21:51:01 2009
New Revision: 199236
URL: http://svn.freebsd.org/changeset/base/199236

Log:
  Although the file has "ex:ts=4", do some "    " -> \t translations
  so that it is also nicely readable with ts=8.

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

Modified: head/usr.bin/gencat/gencat.c
==============================================================================
--- head/usr.bin/gencat/gencat.c	Thu Nov 12 21:33:36 2009	(r199235)
+++ head/usr.bin/gencat/gencat.c	Thu Nov 12 21:51:01 2009	(r199236)
@@ -94,13 +94,13 @@ __FBSDID("$FreeBSD$");
 struct _msgT {
 	long    msgId;
 	char   *str;
-        LIST_ENTRY(_msgT) entries;
+	LIST_ENTRY(_msgT) entries;
 };
 
 struct _setT {
 	long    setId;
-        LIST_HEAD(msghead, _msgT) msghead;
-        LIST_ENTRY(_setT) entries;
+	LIST_HEAD(msghead, _msgT) msghead;
+	LIST_ENTRY(_setT) entries;
 };
 
 LIST_HEAD(sethead, _setT) sethead;
@@ -133,14 +133,14 @@ void
 usage()
 {
 	fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname());
-    exit(1);
+	exit(1);
 }
 
 int
 main(int argc, char **argv)
 {
 	int     ofd, ifd;
-    char	*catfile = NULL;
+	char	*catfile = NULL;
 	int     c;
 
 #define DEPRECATEDMSG	1
@@ -419,23 +419,23 @@ MCParse(int fd)
 				cptr += 5;
 				if (!*cptr)
 					quote = 0;
-		else {
+				else {
 					cptr = wskip(cptr);
 					if (!*cptr)
 						quote = 0;
 					else
 						quote = *cptr;
-		}
+				}
 			} else if (isspace((unsigned char) *cptr)) {
 				;
-	    } else {
+			} else {
 				if (*cptr) {
 					cptr = wskip(cptr);
 					if (*cptr)
 						warning(cptr, "unrecognized line");
 				}
-	    }
-        } else {
+			}
+		} else {
 			/*
 			 * First check for (and eat) empty lines....
 			 */
@@ -453,7 +453,7 @@ MCParse(int fd)
 			} else {
 				warning(cptr, "neither blank line nor start of a message id");
 				continue;
-		}
+			}
 			/*
 			 * If we have a message ID, but no message,
 			 * then this means "delete this message id
@@ -461,12 +461,12 @@ MCParse(int fd)
 			 */
 			if (!*cptr) {
 				MCDelMsg(msgid);
-	    } else {
+			} else {
 				str = getmsg(fd, cptr, quote);
 				MCAddMsg(msgid, str);
-	    }
+			}
+		}
 	}
-    }
 }
 
 void
@@ -686,7 +686,7 @@ MCAddSet(int setId)
 
 	if (p && p->setId == setId) {
 		;
-    } else {
+	} else {
 		p = xmalloc(sizeof(struct _setT));
 		memset(p, '\0', sizeof(struct _setT));
 		LIST_INIT(&p->msghead);
@@ -697,8 +697,8 @@ MCAddSet(int setId)
 			LIST_INSERT_HEAD(&sethead, p, entries);
 		} else {
 			LIST_INSERT_AFTER(q, p, entries);
-    }
-}
+		}
+	}
 
 	curSet = p;
 }
@@ -718,7 +718,7 @@ MCAddMsg(int msgId, const char *str)
 	if (msgId > NL_MSGMAX) {
 		error("msgID exceeds limit");
 		/* NOTREACHED */
-    }
+	}
 
 	p = curSet->msghead.lh_first;
 	q = NULL;
@@ -739,7 +739,7 @@ MCAddMsg(int msgId, const char *str)
 
 	p->msgId = msgId;
 	p->str = xstrdup(str);
-	    }
+}
 
 void
 MCDelSet(int setId)
@@ -756,13 +756,13 @@ MCDelSet(int setId)
 		while (msg) {
 			free(msg->str);
 			LIST_REMOVE(msg, entries);
-	}
+		}
 
 		LIST_REMOVE(set, entries);
 		return;
-    }
-	warning(NULL, "specified set doesn't exist");
 	}
+	warning(NULL, "specified set doesn't exist");
+}
 
 void
 MCDelMsg(int msgId)
@@ -779,6 +779,6 @@ MCDelMsg(int msgId)
 		free(msg->str);
 		LIST_REMOVE(msg, entries);
 		return;
-    }
+	}
 	warning(NULL, "specified msg doesn't exist");
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 00:28:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A73EB1065679;
	Fri, 13 Nov 2009 00:28:17 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9624C8FC18;
	Fri, 13 Nov 2009 00:28: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 nAD0SHJE048083;
	Fri, 13 Nov 2009 00:28:17 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD0SHNX048082;
	Fri, 13 Nov 2009 00:28:17 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <200911130028.nAD0SHNX048082@svn.freebsd.org>
From: Navdeep Parhar 
Date: Fri, 13 Nov 2009 00:28: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: r199237 - head/sys/dev/cxgb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 00:28:17 -0000

Author: np
Date: Fri Nov 13 00:28:16 2009
New Revision: 199237
URL: http://svn.freebsd.org/changeset/base/199237

Log:
  sc->rev and is_offload(sc) will always be 0 during probe.  Wait till
  attach to get correct values.

Modified:
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Thu Nov 12 21:51:01 2009	(r199236)
+++ head/sys/dev/cxgb/cxgb_main.c	Fri Nov 13 00:28:16 2009	(r199237)
@@ -355,7 +355,6 @@ cxgb_controller_probe(device_t dev)
 	const struct adapter_info *ai;
 	char *ports, buf[80];
 	int nports;
-	struct adapter *sc = device_get_softc(dev);
 
 	ai = cxgb_get_adapter_info(dev);
 	if (ai == NULL)
@@ -367,9 +366,7 @@ cxgb_controller_probe(device_t dev)
 	else
 		ports = "ports";
 
-	snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s",
-	    ai->desc, is_offload(sc) ? "R" : "",
-	    sc->params.rev, nports, ports);
+	snprintf(buf, sizeof(buf), "%s, %d %s", ai->desc, nports, ports);
 	device_set_desc_copy(dev, buf);
 	return (BUS_PROBE_DEFAULT);
 }
@@ -665,8 +662,8 @@ cxgb_controller_attach(device_t dev)
 	    G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers),
 	    G_FW_VERSION_MICRO(vers));
 
-	snprintf(buf, sizeof(buf), "%s\t E/C: %s S/N: %s", 
-		 ai->desc,
+	snprintf(buf, sizeof(buf), "%s %sNIC\t E/C: %s S/N: %s",
+		 ai->desc, is_offload(sc) ? "R" : "",
 		 sc->params.vpd.ec, sc->params.vpd.sn);
 	device_set_desc_copy(dev, buf);
 

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 00:31:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79D59106566C;
	Fri, 13 Nov 2009 00:31:51 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 690418FC0A;
	Fri, 13 Nov 2009 00:31: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 nAD0Vpaa048191;
	Fri, 13 Nov 2009 00:31:51 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD0VpH6048189;
	Fri, 13 Nov 2009 00:31:51 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <200911130031.nAD0VpH6048189@svn.freebsd.org>
From: Navdeep Parhar 
Date: Fri, 13 Nov 2009 00:31: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: r199238 - head/sys/dev/cxgb/common
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 00:31:51 -0000

Author: np
Date: Fri Nov 13 00:31:51 2009
New Revision: 199238
URL: http://svn.freebsd.org/changeset/base/199238

Log:
  Make sure *some* edc is setup even for an unknown transceiver (assume
  it is optical).

Modified:
  head/sys/dev/cxgb/common/cxgb_ael1002.c

Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_ael1002.c	Fri Nov 13 00:28:16 2009	(r199237)
+++ head/sys/dev/cxgb/common/cxgb_ael1002.c	Fri Nov 13 00:31:51 2009	(r199238)
@@ -1270,7 +1270,7 @@ static int ael2005_reset(struct cphy *ph
 		return err;
 	phy->modtype = (u8)err;
 
-	if (err == phy_modtype_none || err == phy_modtype_unknown)
+	if (err == phy_modtype_none)
 		err = 0;
 	else if (err == phy_modtype_twinax || err == phy_modtype_twinax_long)
 		err = ael2005_setup_twinax_edc(phy, err);
@@ -1981,7 +1981,7 @@ static int ael2020_reset(struct cphy *ph
 	if (err < 0)
 		return err;
 	phy->modtype = (u8)err;
-	if (err == phy_modtype_none || err == phy_modtype_unknown)
+	if (err == phy_modtype_none)
 		err = 0;
 	else if (err == phy_modtype_twinax || err == phy_modtype_twinax_long)
 		err = ael2020_setup_twinax_edc(phy, err);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 00:34:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 654C01065670;
	Fri, 13 Nov 2009 00:34:28 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 53F158FC19;
	Fri, 13 Nov 2009 00:34: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 nAD0YS1K048288;
	Fri, 13 Nov 2009 00:34:28 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD0YSJJ048285;
	Fri, 13 Nov 2009 00:34:28 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <200911130034.nAD0YSJJ048285@svn.freebsd.org>
From: Navdeep Parhar 
Date: Fri, 13 Nov 2009 00:34: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: r199239 - head/sys/dev/cxgb/common
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 00:34:28 -0000

Author: np
Date: Fri Nov 13 00:34:28 2009
New Revision: 199239
URL: http://svn.freebsd.org/changeset/base/199239

Log:
  The 10GBASE-T card should use an IPG of 1.  Also enable the check
  for low power startup on this card.

Modified:
  head/sys/dev/cxgb/common/cxgb_aq100x.c
  head/sys/dev/cxgb/common/cxgb_xgmac.c

Modified: head/sys/dev/cxgb/common/cxgb_aq100x.c
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_aq100x.c	Fri Nov 13 00:31:51 2009	(r199238)
+++ head/sys/dev/cxgb/common/cxgb_aq100x.c	Fri Nov 13 00:34:28 2009	(r199239)
@@ -515,13 +515,11 @@ t3_aq100x_phy_prep(pinfo_t *pinfo, int p
 		CH_WARN(adapter, "PHY%d: unknown firmware %d.%d\n", phy_addr,
 		    v >> 8, v & 0xff);
 
-#if 0
 	/* The PHY should start in really-low-power mode. */
 	(void) mdio_read(phy, MDIO_DEV_PMA_PMD, MII_BMCR, &v);
 	if ((v & BMCR_PDOWN) == 0)
 		CH_WARN(adapter, "PHY%d does not start in low power mode.\n",
 			phy_addr);
-#endif
 
 	/*
 	 * Verify XAUI and 1000-X settings, but let prep succeed no matter what.

Modified: head/sys/dev/cxgb/common/cxgb_xgmac.c
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_xgmac.c	Fri Nov 13 00:31:51 2009	(r199238)
+++ head/sys/dev/cxgb/common/cxgb_xgmac.c	Fri Nov 13 00:34:28 2009	(r199239)
@@ -508,7 +508,7 @@ int t3_mac_set_mtu(struct cmac *mac, uns
 		thres /= 10;
 	thres = mtu > thres ? (mtu - thres + 7) / 8 : 0;
 	thres = max(thres, 8U);                          /* need at least 8 */
-	ipg = (adap->params.rev == T3_REV_C) ? 0 : 1;
+	ipg = (port_type == 9 || adap->params.rev != T3_REV_C) ? 1 : 0;
 	t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset,
 			 V_TXFIFOTHRESH(M_TXFIFOTHRESH) | V_TXIPG(M_TXIPG),
 			 V_TXFIFOTHRESH(thres) | V_TXIPG(ipg));

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 00:37:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB2CE1065670;
	Fri, 13 Nov 2009 00:37:29 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA56A8FC19;
	Fri, 13 Nov 2009 00:37: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 nAD0bTJ9048385;
	Fri, 13 Nov 2009 00:37:29 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD0bTeW048383;
	Fri, 13 Nov 2009 00:37:29 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <200911130037.nAD0bTeW048383@svn.freebsd.org>
From: Navdeep Parhar 
Date: Fri, 13 Nov 2009 00:37: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: r199240 - head/sys/dev/cxgb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 00:37:29 -0000

Author: np
Date: Fri Nov 13 00:37:29 2009
New Revision: 199240
URL: http://svn.freebsd.org/changeset/base/199240

Log:
  Don't disable the XGMAC's tx on ifconfig down.  It is unnecessary
  and can cause false backpressure in the chip.  Fix a us/ms mixup
  while here.

Modified:
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Fri Nov 13 00:34:28 2009	(r199239)
+++ head/sys/dev/cxgb/cxgb_main.c	Fri Nov 13 00:37:29 2009	(r199240)
@@ -1982,14 +1982,14 @@ cxgb_uninit_synchronized(struct port_inf
 	t3_set_reg_field(sc, A_XGM_RXFIFO_CFG +  pi->mac.offset,
 			 V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM), 0);
 
-	DELAY(100);
+	DELAY(100 * 1000);
 
 	/* Wait for TXFIFO empty */
 	t3_wait_op_done(sc, A_XGM_TXFIFO_CFG + pi->mac.offset,
 			F_TXFIFO_EMPTY, 1, 20, 5);
 
-	DELAY(100);
-	t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
+	DELAY(100 * 1000);
+	t3_mac_disable(&pi->mac, MAC_DIRECTION_RX);
 
 
 	pi->phy.ops->power_down(&pi->phy, 1);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 02:50:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B71CE1065672;
	Fri, 13 Nov 2009 02:50:50 +0000 (UTC) (envelope-from ps@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A60E58FC0C;
	Fri, 13 Nov 2009 02:50: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 nAD2ooCs051466;
	Fri, 13 Nov 2009 02:50:50 GMT (envelope-from ps@svn.freebsd.org)
Received: (from ps@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD2ooIp051465;
	Fri, 13 Nov 2009 02:50:50 GMT (envelope-from ps@svn.freebsd.org)
Message-Id: <200911130250.nAD2ooIp051465@svn.freebsd.org>
From: Paul Saab 
Date: Fri, 13 Nov 2009 02:50: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: r199241 - head/sys/cddl/boot/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 02:50:50 -0000

Author: ps
Date: Fri Nov 13 02:50:50 2009
New Revision: 199241
URL: http://svn.freebsd.org/changeset/base/199241

Log:
  Correct another case of not doing 64bit math.  This allows mine and
  other raidz2 volumes to boot.
  
  Submitted by:	Matt Reimer 

Modified:
  head/sys/cddl/boot/zfs/zfssubr.c

Modified: head/sys/cddl/boot/zfs/zfssubr.c
==============================================================================
--- head/sys/cddl/boot/zfs/zfssubr.c	Fri Nov 13 00:37:29 2009	(r199240)
+++ head/sys/cddl/boot/zfs/zfssubr.c	Fri Nov 13 02:50:50 2009	(r199241)
@@ -550,7 +550,8 @@ vdev_raidz_read(vdev_t *vdev, const blkp
 	uint64_t s = psize >> unit_shift;
 	uint64_t f = b % dcols;
 	uint64_t o = (b / dcols) << unit_shift;
-	int q, r, c, c1, bc, col, acols, coff, devidx, asize, n;
+	uint64_t q, r, coff;
+	int c, c1, bc, col, acols, devidx, asize, n;
 	static raidz_col_t cols[16];
 	raidz_col_t *rc, *rc1;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 03:59:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD4451065741;
	Fri, 13 Nov 2009 03:59:44 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC4F28FC20;
	Fri, 13 Nov 2009 03:59: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 nAD3xiWR053585;
	Fri, 13 Nov 2009 03:59:44 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD3xi4O053582;
	Fri, 13 Nov 2009 03:59:44 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911130359.nAD3xi4O053582@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 13 Nov 2009 03:59: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: r199242 - head/usr.bin/systat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 03:59:45 -0000

Author: ume
Date: Fri Nov 13 03:59:44 2009
New Revision: 199242
URL: http://svn.freebsd.org/changeset/base/199242

Log:
  Use ncursesw to output the date field of vmstat display
  with multi-byte string, correctly.

Modified:
  head/usr.bin/systat/Makefile
  head/usr.bin/systat/main.c

Modified: head/usr.bin/systat/Makefile
==============================================================================
--- head/usr.bin/systat/Makefile	Fri Nov 13 02:50:50 2009	(r199241)
+++ head/usr.bin/systat/Makefile	Fri Nov 13 03:59:44 2009	(r199242)
@@ -15,6 +15,6 @@ CFLAGS+= -DINET6
 .endif
 
 DPADD=	${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM}
-LDADD=	-lcurses -lm -ldevstat -lkvm
+LDADD=	-lcursesw -lm -ldevstat -lkvm
 
 .include 

Modified: head/usr.bin/systat/main.c
==============================================================================
--- head/usr.bin/systat/main.c	Fri Nov 13 02:50:50 2009	(r199241)
+++ head/usr.bin/systat/main.c	Fri Nov 13 03:59:44 2009	(r199242)
@@ -87,7 +87,7 @@ main(int argc, char **argv)
 	char errbuf[_POSIX2_LINE_MAX], dummy;
 	size_t	size;
 
-	(void) setlocale(LC_TIME, "");
+	(void) setlocale(LC_ALL, "");
 
 	argc--, argv++;
 	while (argc > 0) {

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 05:54:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6465B1065670;
	Fri, 13 Nov 2009 05:54:56 +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 4E3238FC12;
	Fri, 13 Nov 2009 05:54: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 nAD5suvU056149;
	Fri, 13 Nov 2009 05:54:56 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD5st8F056133;
	Fri, 13 Nov 2009 05:54:55 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911130554.nAD5st8F056133@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 13 Nov 2009 05:54: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: r199243 - in head: . etc/etc.amd64 etc/etc.arm
	etc/etc.ia64 etc/etc.mips etc/etc.powerpc etc/etc.sparc64
	etc/root share/skel sys/conf sys/dev/syscons
	tools/tools/nanobsd/gateworks/Files...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 05:54:56 -0000

Author: ed
Date: Fri Nov 13 05:54:55 2009
New Revision: 199243
URL: http://svn.freebsd.org/changeset/base/199243

Log:
  Switch the default terminal emulation style to xterm for most platforms.
  
  Right now syscons(4) uses a cons25-style terminal emulator. The
  disadvantages of that are:
  
  - Little compatibility with embedded devices with serial interfaces.
  - Bad bandwidth efficiency, mainly because of the lack of scrolling
    regions.
  - A very hard transition path to support for modern character sets like
    UTF-8.
  
  Our terminal emulation library, libteken, has been supporting
  xterm-style terminal emulation for months, so flip the switch and make
  everyone use an xterm-style console driver.
  
  I still have to enable this on i386. Right now pc98 and i386 share the
  same /etc/ttys file. I'm not going to switch pc98, because it uses its
  own Kanji-capable cons25 emulator.
  
  IMPORTANT: What to do if things go wrong (i.e. graphical artifacts):
  
  - Run the application inside script(1), try to reduce the problem and
    send me the log file.
  - In the mean time, you can run `vidcontrol -T cons25' and `export
    TERM=cons25' so you can run applications the same way you did before.
    You can also build your kernel with `options TEKEN_CONS25' to make all
    virtual terminals use the cons25 emulator by default.
  
  Discussed on:	current@

Modified:
  head/UPDATING
  head/etc/etc.amd64/ttys
  head/etc/etc.arm/ttys
  head/etc/etc.ia64/ttys
  head/etc/etc.mips/ttys
  head/etc/etc.powerpc/ttys
  head/etc/etc.sparc64/ttys
  head/etc/root/dot.profile
  head/share/skel/dot.profile
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/syscons/scterm-teken.c
  head/tools/tools/nanobsd/gateworks/Files/root/.profile
  head/usr.sbin/sade/termcap.c
  head/usr.sbin/sysinstall/termcap.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/UPDATING	Fri Nov 13 05:54:55 2009	(r199243)
@@ -22,6 +22,21 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20091113:
+	The default terminal emulation for syscons(4) has been changed
+	from cons25 to xterm on all platforms except i386 and pc98.
+	This means that the /etc/ttys file needs to be updated to ensure
+	correct operation of applications on the console.
+
+	The terminal emulation style can be toggled per window by using
+	vidcontrol(1)'s -T flag.  The TEKEN_XTERM and TEKEN_CONS25
+	kernel configuration options can be used to change the
+	compile-time default.
+
+	To prevent graphical artifacts, make sure the TERM environment
+	variable is set to match the terminal emulation that is being
+	performed by syscons(4).
+
 20091109:
 	The layout of the structure ieee80211req_scan_result has changed.
 	Applications that require wireless scan results (e.g. ifconfig(8))

Modified: head/etc/etc.amd64/ttys
==============================================================================
--- head/etc/etc.amd64/ttys	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/etc.amd64/ttys	Fri Nov 13 05:54:55 2009	(r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	on  secure
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/etc.arm/ttys
==============================================================================
--- head/etc/etc.arm/ttys	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/etc.arm/ttys	Fri Nov 13 05:54:55 2009	(r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	off  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	off  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	off  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	off  secure
 #ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/etc.ia64/ttys
==============================================================================
--- head/etc/etc.ia64/ttys	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/etc.ia64/ttys	Fri Nov 13 05:54:55 2009	(r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	off secure
-# Virtual terminals.
-ttyv1	"/usr/libexec/getty Pc"		cons25	off secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	off secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	off secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	off secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	off secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	off secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	off secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	off secure
+# Virtual terminals
+ttyv1	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	off secure
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals. The 'dialup' keyword identifies dialin lines to login,
 # fingerd etc.

Modified: head/etc/etc.mips/ttys
==============================================================================
--- head/etc/etc.mips/ttys	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/etc.mips/ttys	Fri Nov 13 05:54:55 2009	(r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.

Modified: head/etc/etc.powerpc/ttys
==============================================================================
--- head/etc/etc.powerpc/ttys	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/etc.powerpc/ttys	Fri Nov 13 05:54:55 2009	(r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	on  secure
 #ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/etc.sparc64/ttys
==============================================================================
--- head/etc/etc.sparc64/ttys	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/etc.sparc64/ttys	Fri Nov 13 05:54:55 2009	(r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -34,15 +34,15 @@ screen	"/usr/libexec/getty Pc"		vt100	of
 ttya	"/usr/libexec/getty 3wire.9600"	vt100	off secure
 ttyb	"/usr/libexec/getty 3wire.9600"	vt100	off secure
 # syscons(4)
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	on  secure
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/root/dot.profile
==============================================================================
--- head/etc/root/dot.profile	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/etc/root/dot.profile	Fri Nov 13 05:54:55 2009	(r199243)
@@ -4,7 +4,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/
 export PATH
 HOME=/root
 export HOME
-TERM=${TERM:-cons25}
+TERM=${TERM:-xterm}
 export TERM
 PAGER=more
 export PAGER

Modified: head/share/skel/dot.profile
==============================================================================
--- head/share/skel/dot.profile	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/share/skel/dot.profile	Fri Nov 13 05:54:55 2009	(r199243)
@@ -11,8 +11,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/
 # Setting TERM is normally done through /etc/ttys.  Do only override
 # if you're sure that you'll never log in via telnet or xterm or a
 # serial line.
-# Use cons25l1 for iso-* fonts
-# TERM=cons25; 	export TERM
+# TERM=xterm; 	export TERM
 
 BLOCKSIZE=K;	export BLOCKSIZE
 EDITOR=vi;   	export EDITOR

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/sys/conf/NOTES	Fri Nov 13 05:54:55 2009	(r199243)
@@ -1410,8 +1410,9 @@ options 	SC_NO_SUSPEND_VTYSWITCH
 #	0x100	Probe for a keyboard device periodically if one is not present
 
 # Enable experimental features of the syscons terminal emulator (teken).
+options 	TEKEN_CONS25		# cons25-style terminal emulation
 options 	TEKEN_UTF8		# UTF-8 output handling
-options 	TEKEN_XTERM		# xterm-style terminal emulation
+#options 	TEKEN_XTERM		# xterm-style terminal emulation
 
 #
 # Optional devices:

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/sys/conf/options	Fri Nov 13 05:54:55 2009	(r199243)
@@ -732,6 +732,7 @@ SC_RENDER_DEBUG		opt_syscons.h
 SC_TWOBUTTON_MOUSE	opt_syscons.h
 
 # teken terminal emulator options
+TEKEN_CONS25		opt_teken.h
 TEKEN_UTF8		opt_teken.h
 TEKEN_XTERM		opt_teken.h
 

Modified: head/sys/dev/syscons/scterm-teken.c
==============================================================================
--- head/sys/dev/syscons/scterm-teken.c	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/sys/dev/syscons/scterm-teken.c	Fri Nov 13 05:54:55 2009	(r199243)
@@ -50,6 +50,15 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#if defined(TEKEN_XTERM) && defined(TEKEN_CONS25)
+#error "xterm and cons25 are mutually exclusive."
+#endif
+
+/* XXX: Use cons25 on i386, for compatibility with pc98. */
+#if defined(__i386__) && !defined(TEKEN_XTERM) && !defined(TEKEN_CONS25)
+#define	TEKEN_CONS25
+#endif
+
 static void scteken_revattr(unsigned char, teken_attr_t *);
 static unsigned int scteken_attr(const teken_attr_t *);
 
@@ -132,9 +141,9 @@ scteken_init(scr_stat *scp, void **softc
 #ifndef TEKEN_UTF8
 		teken_set_8bit(&ts->ts_teken);
 #endif /* !TEKEN_UTF8 */
-#ifndef TEKEN_XTERM
+#ifdef TEKEN_CONS25
 		teken_set_cons25(&ts->ts_teken);
-#endif /* !TEKEN_XTERM */
+#endif /* TEKEN_CONS25 */
 
 		tp.tp_row = scp->ysize;
 		tp.tp_col = scp->xsize;

Modified: head/tools/tools/nanobsd/gateworks/Files/root/.profile
==============================================================================
--- head/tools/tools/nanobsd/gateworks/Files/root/.profile	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/tools/tools/nanobsd/gateworks/Files/root/.profile	Fri Nov 13 05:54:55 2009	(r199243)
@@ -3,7 +3,7 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
 export PATH
 HOME=/root; export HOME
-TERM=${TERM:-cons25}; export TERM
+TERM=${TERM:-xterm}; export TERM
 PAGER=more; export PAGER
 
 #set -o vi

Modified: head/usr.sbin/sade/termcap.c
==============================================================================
--- head/usr.sbin/sade/termcap.c	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/usr.sbin/sade/termcap.c	Fri Nov 13 05:54:55 2009	(r199243)
@@ -83,7 +83,11 @@ set_termcap(void)
 #else
 	if (ColorDisplay) {
 	    if (!term) {
+#ifdef __i386__
 		if (setenv("TERM", "cons25", 1) < 0)
+#else
+		if (setenv("TERM", "xterm", 1) < 0)
+#endif
 		    return -1;
 	    }
 	}

Modified: head/usr.sbin/sysinstall/termcap.c
==============================================================================
--- head/usr.sbin/sysinstall/termcap.c	Fri Nov 13 03:59:44 2009	(r199242)
+++ head/usr.sbin/sysinstall/termcap.c	Fri Nov 13 05:54:55 2009	(r199243)
@@ -125,10 +125,17 @@ set_termcap(void)
 #else
 	if (ColorDisplay) {
 	    if (!term) {
+#ifdef __i386__
 		if (setenv("TERM", "cons25", 1) < 0)
 		    return -1;
 		if (setenv("TERMCAP", termcap_cons25, 1) < 0)
 		    return -1;
+#else
+		if (setenv("TERM", "xterm", 1) < 0)
+		    return -1;
+		if (setenv("TERMCAP", termcap_xterm, 1) < 0)
+		    return -1;
+#endif
 	    }
 	}
 	else {

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 09:03:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D9EF106566B;
	Fri, 13 Nov 2009 09:03:51 +0000 (UTC)
	(envelope-from roam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DA798FC15;
	Fri, 13 Nov 2009 09:03: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 nAD93p79060129;
	Fri, 13 Nov 2009 09:03:51 GMT (envelope-from roam@svn.freebsd.org)
Received: (from roam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD93pus060127;
	Fri, 13 Nov 2009 09:03:51 GMT (envelope-from roam@svn.freebsd.org)
Message-Id: <200911130903.nAD93pus060127@svn.freebsd.org>
From: Peter Pentchev 
Date: Fri, 13 Nov 2009 09:03:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199244 - head/lib/libc/locale
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 09:03:51 -0000

Author: roam (doc,ports committer)
Date: Fri Nov 13 09:03:50 2009
New Revision: 199244
URL: http://svn.freebsd.org/changeset/base/199244

Log:
  Fix the grammar in the isgraph(3) description, almost as per the PR.
  
  PR:		140455
  Submitted by:	Jeremy Huddleston 
  MFC after:	2 weeks

Modified:
  head/lib/libc/locale/isgraph.3

Modified: head/lib/libc/locale/isgraph.3
==============================================================================
--- head/lib/libc/locale/isgraph.3	Fri Nov 13 05:54:55 2009	(r199243)
+++ head/lib/libc/locale/isgraph.3	Fri Nov 13 09:03:50 2009	(r199244)
@@ -50,7 +50,7 @@ The
 function tests for any printing character except space
 .Pq Ql "\ "
 and other
-locale specific space-like characters.
+locale-specific space-like characters.
 The value of the argument must be representable as an
 .Vt "unsigned char"
 or the value of

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 09:07:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 083B81065670;
	Fri, 13 Nov 2009 09:07:34 +0000 (UTC)
	(envelope-from roam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC7A88FC16;
	Fri, 13 Nov 2009 09:07: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 nAD97Xj4060232;
	Fri, 13 Nov 2009 09:07:33 GMT (envelope-from roam@svn.freebsd.org)
Received: (from roam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD97XD4060230;
	Fri, 13 Nov 2009 09:07:33 GMT (envelope-from roam@svn.freebsd.org)
Message-Id: <200911130907.nAD97XD4060230@svn.freebsd.org>
From: Peter Pentchev 
Date: Fri, 13 Nov 2009 09:07: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: r199245 - head/lib/libc/locale
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 09:07:34 -0000

Author: roam (doc,ports committer)
Date: Fri Nov 13 09:07:33 2009
New Revision: 199245
URL: http://svn.freebsd.org/changeset/base/199245

Log:
  Fix the grammar in the isprint(3) description.
  
  PR:		140456
  Submitted by:	Jeremy Huddleston 

Modified:
  head/lib/libc/locale/isprint.3

Modified: head/lib/libc/locale/isprint.3
==============================================================================
--- head/lib/libc/locale/isprint.3	Fri Nov 13 09:03:50 2009	(r199244)
+++ head/lib/libc/locale/isprint.3	Fri Nov 13 09:07:33 2009	(r199245)
@@ -47,7 +47,7 @@
 .Sh DESCRIPTION
 The
 .Fn isprint
-function tests for any printing character including space
+function tests for any printing character, including space
 .Pq Ql "\ " .
 The value of the argument must be representable as an
 .Vt "unsigned char"

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 09:57:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17A75106566B;
	Fri, 13 Nov 2009 09:57:51 +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 071B68FC14;
	Fri, 13 Nov 2009 09:57: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 nAD9vou3061365;
	Fri, 13 Nov 2009 09:57:50 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAD9voDt061363;
	Fri, 13 Nov 2009 09:57:50 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911130957.nAD9voDt061363@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 13 Nov 2009 09:57: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: r199247 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 09:57:51 -0000

Author: mav
Date: Fri Nov 13 09:57:50 2009
New Revision: 199247
URL: http://svn.freebsd.org/changeset/base/199247

Log:
  Remove part that HDMI is not implemented. It had different meaning and
  confuse users.
  Extend BUGS section.
  Add some supported chipsets.

Modified:
  head/share/man/man4/snd_hda.4

Modified: head/share/man/man4/snd_hda.4
==============================================================================
--- head/share/man/man4/snd_hda.4	Fri Nov 13 09:24:09 2009	(r199246)
+++ head/share/man/man4/snd_hda.4	Fri Nov 13 09:57:50 2009	(r199247)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2009
+.Dd November 13, 2009
 .Dt SND_HDA 4
 .Os
 .Sh NAME
@@ -59,7 +59,7 @@ driver that allows the generic audio dri
 to be used with this hardware.
 Only audio functions are supported by
 .Nm .
-Modem, HDMI and other possible functions are not implemented.
+Modem and other possible functions are not implemented.
 .Pp
 The
 .Nm
@@ -500,6 +500,14 @@ nVidia MCP68
 .It
 nVidia MCP69
 .It
+nVidia MCP73
+.It
+nVidia MCP78
+.It
+nVidia MCP79
+.It
+nVidia MCP89
+.It
 SiS 966
 .It
 VIA VT8251/8237A
@@ -626,5 +634,11 @@ trying to fix problem that way, make sur
 and the PCM audio device you are using really corresponds to expected
 audio connector.
 .Pp
+Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec
+to control external amplifiers. In some cases setting proper combination of
+GPIO bits may be needed to make sound work on specific device.
+.Pp
+HDMI and DisplayPort audio may also require support from video driver.
+.Pp
 Due to OSS limitation multichannel (not multidevice) playback is not
 supported.

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 11:19:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 950E4106566C;
	Fri, 13 Nov 2009 11:19:26 +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 8334F8FC18;
	Fri, 13 Nov 2009 11:19:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nADBJQaC064514;
	Fri, 13 Nov 2009 11:19:26 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADBJQvf064512;
	Fri, 13 Nov 2009 11:19:26 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200911131119.nADBJQvf064512@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Fri, 13 Nov 2009 11:19:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199248 - head/lib/libpam/modules/pam_unix
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 11:19:26 -0000

Author: des
Date: Fri Nov 13 11:19:26 2009
New Revision: 199248
URL: http://svn.freebsd.org/changeset/base/199248

Log:
  Note that nullok should not be used by processes that can't access the
  password database.
  
  PR:		bin/126650, misc/140514
  MFC after:	1 week

Modified:
  head/lib/libpam/modules/pam_unix/pam_unix.8

Modified: head/lib/libpam/modules/pam_unix/pam_unix.8
==============================================================================
--- head/lib/libpam/modules/pam_unix/pam_unix.8	Fri Nov 13 09:57:50 2009	(r199247)
+++ head/lib/libpam/modules/pam_unix/pam_unix.8	Fri Nov 13 11:19:26 2009	(r199248)
@@ -105,6 +105,17 @@ sufficient.
 If the password database has no password for the entity being
 authenticated, then this option will forgo password prompting, and
 silently allow authentication to succeed.
+.Pp
+.Sy NOTE:
+If
+.Nm
+is invoked by a process that does not have the privileges required to
+access the password database (in most cases, this means root
+privileges), the
+.Cm nullok
+option may cause
+.Nm
+to allow any user to log in with any password.
 .It Cm local_pass
 Use only the local password database, even if NIS is in use.
 This will cause an authentication failure if the system is configured

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 11:26:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B05D106566B;
	Fri, 13 Nov 2009 11:26:44 +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 794C58FC20;
	Fri, 13 Nov 2009 11:26: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 nADBQisT064701;
	Fri, 13 Nov 2009 11:26:44 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADBQiji064699;
	Fri, 13 Nov 2009 11:26:44 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911131126.nADBQiji064699@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 13 Nov 2009 11:26: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: r199249 - in head/etc: . etc.pc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 11:26:44 -0000

Author: ed
Date: Fri Nov 13 11:26:44 2009
New Revision: 199249
URL: http://svn.freebsd.org/changeset/base/199249

Log:
  Split up etc.i386/ttys into a PC98 version as well.
  
  This means I can now convert syscons on i386 to xterm as well.
  
  Discussed with:	nyan

Added:
  head/etc/etc.pc98/
     - copied from r199243, head/etc/etc.i386/
Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Fri Nov 13 11:19:26 2009	(r199248)
+++ head/etc/Makefile	Fri Nov 13 11:26:44 2009	(r199249)
@@ -18,8 +18,13 @@ BIN1=	auth.conf \
 	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
 	rc.sendmail rc.shutdown \
 	rc.subr remote rpc services shells \
-	sysctl.conf syslog.conf \
-	etc.${MACHINE_ARCH}/ttys
+	sysctl.conf syslog.conf
+
+.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
+BIN1+=	etc.${MACHINE}/ttys
+.else
+BIN1+=	etc.${MACHINE_ARCH}/ttys
+.endif
 
 OPENBSMDIR=			${.CURDIR}/../contrib/openbsm
 BSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 11:28:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35BAD106566B;
	Fri, 13 Nov 2009 11:28:55 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1975D8FC15;
	Fri, 13 Nov 2009 11:28: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 nADBSsll064783;
	Fri, 13 Nov 2009 11:28:55 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADBSsx8064775;
	Fri, 13 Nov 2009 11:28:54 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911131128.nADBSsx8064775@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 13 Nov 2009 11:28:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199250 - in head: . etc/etc.i386 sys/conf
	sys/dev/syscons usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 11:28:55 -0000

Author: ed
Date: Fri Nov 13 11:28:54 2009
New Revision: 199250
URL: http://svn.freebsd.org/changeset/base/199250

Log:
  Convert syscons on i386 to TERM=xterm.
  
  TEKEN_XTERM is now gone. Because we always use xterm mode now, we only
  need a TEKEN_CONS25 switch to go back to cons25.

Modified:
  head/UPDATING
  head/etc/etc.i386/ttys
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/syscons/scterm-teken.c
  head/usr.sbin/sade/termcap.c
  head/usr.sbin/sysinstall/termcap.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/UPDATING	Fri Nov 13 11:28:54 2009	(r199250)
@@ -24,14 +24,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 
 20091113:
 	The default terminal emulation for syscons(4) has been changed
-	from cons25 to xterm on all platforms except i386 and pc98.
-	This means that the /etc/ttys file needs to be updated to ensure
-	correct operation of applications on the console.
+	from cons25 to xterm on all platforms except pc98.  This means
+	that the /etc/ttys file needs to be updated to ensure correct
+	operation of applications on the console.
 
 	The terminal emulation style can be toggled per window by using
-	vidcontrol(1)'s -T flag.  The TEKEN_XTERM and TEKEN_CONS25
-	kernel configuration options can be used to change the
-	compile-time default.
+	vidcontrol(1)'s -T flag.  The TEKEN_CONS25 kernel configuration
+	options can be used to change the compile-time default back to
+	cons25.
 
 	To prevent graphical artifacts, make sure the TERM environment
 	variable is set to match the terminal emulation that is being

Modified: head/etc/etc.i386/ttys
==============================================================================
--- head/etc/etc.i386/ttys	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/etc/etc.i386/ttys	Fri Nov 13 11:28:54 2009	(r199250)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	on  secure
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/sys/conf/NOTES	Fri Nov 13 11:28:54 2009	(r199250)
@@ -1412,7 +1412,6 @@ options 	SC_NO_SUSPEND_VTYSWITCH
 # Enable experimental features of the syscons terminal emulator (teken).
 options 	TEKEN_CONS25		# cons25-style terminal emulation
 options 	TEKEN_UTF8		# UTF-8 output handling
-#options 	TEKEN_XTERM		# xterm-style terminal emulation
 
 #
 # Optional devices:

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/sys/conf/options	Fri Nov 13 11:28:54 2009	(r199250)
@@ -734,7 +734,6 @@ SC_TWOBUTTON_MOUSE	opt_syscons.h
 # teken terminal emulator options
 TEKEN_CONS25		opt_teken.h
 TEKEN_UTF8		opt_teken.h
-TEKEN_XTERM		opt_teken.h
 
 # options for printf
 PRINTF_BUFR_SIZE	opt_printf.h

Modified: head/sys/dev/syscons/scterm-teken.c
==============================================================================
--- head/sys/dev/syscons/scterm-teken.c	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/sys/dev/syscons/scterm-teken.c	Fri Nov 13 11:28:54 2009	(r199250)
@@ -50,15 +50,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if defined(TEKEN_XTERM) && defined(TEKEN_CONS25)
-#error "xterm and cons25 are mutually exclusive."
-#endif
-
-/* XXX: Use cons25 on i386, for compatibility with pc98. */
-#if defined(__i386__) && !defined(TEKEN_XTERM) && !defined(TEKEN_CONS25)
-#define	TEKEN_CONS25
-#endif
-
 static void scteken_revattr(unsigned char, teken_attr_t *);
 static unsigned int scteken_attr(const teken_attr_t *);
 

Modified: head/usr.sbin/sade/termcap.c
==============================================================================
--- head/usr.sbin/sade/termcap.c	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/usr.sbin/sade/termcap.c	Fri Nov 13 11:28:54 2009	(r199250)
@@ -83,17 +83,13 @@ set_termcap(void)
 #else
 	if (ColorDisplay) {
 	    if (!term) {
-#ifdef __i386__
-		if (setenv("TERM", "cons25", 1) < 0)
-#else
 		if (setenv("TERM", "xterm", 1) < 0)
-#endif
 		    return -1;
 	    }
 	}
 	else {
 	    if (!term) {
-		if (setenv("TERM", "cons25-m", 1) < 0)
+		if (setenv("TERM", "vt100", 1) < 0)
 		    return -1;
 	    }
 	}

Modified: head/usr.sbin/sysinstall/termcap.c
==============================================================================
--- head/usr.sbin/sysinstall/termcap.c	Fri Nov 13 11:26:44 2009	(r199249)
+++ head/usr.sbin/sysinstall/termcap.c	Fri Nov 13 11:28:54 2009	(r199250)
@@ -125,24 +125,17 @@ set_termcap(void)
 #else
 	if (ColorDisplay) {
 	    if (!term) {
-#ifdef __i386__
-		if (setenv("TERM", "cons25", 1) < 0)
-		    return -1;
-		if (setenv("TERMCAP", termcap_cons25, 1) < 0)
-		    return -1;
-#else
 		if (setenv("TERM", "xterm", 1) < 0)
 		    return -1;
 		if (setenv("TERMCAP", termcap_xterm, 1) < 0)
 		    return -1;
-#endif
 	    }
 	}
 	else {
 	    if (!term) {
-		if (setenv("TERM", "cons25-m", 1) < 0)
+		if (setenv("TERM", "vt100", 1) < 0)
 		    return -1;
-		if (setenv("TERMCAP", termcap_cons25_m, 1) < 0)
+		if (setenv("TERMCAP", termcap_vt100, 1) < 0)
 		    return -1;
 	    }
 	}

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 11:30:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC9621065694;
	Fri, 13 Nov 2009 11:30:03 +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 6AA558FC23;
	Fri, 13 Nov 2009 11:30:03 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 7D0731CDCF; Fri, 13 Nov 2009 12:30:02 +0100 (CET)
Date: Fri, 13 Nov 2009 12:30:02 +0100
From: Ed Schouten 
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
Message-ID: <20091113113002.GX64905@hoeg.nl>
References: <200911131128.nADBSsx8064775@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="KZCIPwrNpw38UenM"
Content-Disposition: inline
In-Reply-To: <200911131128.nADBSsx8064775@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: 
Subject: Re: svn commit: r199250 - in head: . etc/etc.i386 sys/conf
 sys/dev/syscons usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 11:30:03 -0000


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

* Ed Schouten  wrote:
> Author: ed
> Date: Fri Nov 13 11:28:54 2009
> New Revision: 199250
> URL: http://svn.freebsd.org/changeset/base/199250
>=20
> Log:
>   Convert syscons on i386 to TERM=3Dxterm.
>  =20
>   TEKEN_XTERM is now gone. Because we always use xterm mode now, we only
>   need a TEKEN_CONS25 switch to go back to cons25.

Commit message should also contain:

	Also fall back to vt100 instead of cons25-m in sade and
	sysinstall when a color display is missing.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr9QzoACgkQ52SDGA2eCwVVrgCcCX8dlbGazrDwiZitmD7M5dZL
9dMAn09COoTyZHrnuCdfHlbwAs/VqthC
=rXrG
-----END PGP SIGNATURE-----

--KZCIPwrNpw38UenM--

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 11:32:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99BD9106566B;
	Fri, 13 Nov 2009 11:32: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 85C8D8FC08;
	Fri, 13 Nov 2009 11:32: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 nADBWEwD064897;
	Fri, 13 Nov 2009 11:32:14 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADBWEJ6064892;
	Fri, 13 Nov 2009 11:32:14 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911131132.nADBWEJ6064892@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 13 Nov 2009 11:32: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: r199251 - in head: release/picobsd/floppy.tree/etc
	release/picobsd/tinyware/oinit tools/tools/nanobsd/rescue/Files/etc
	tools/tools/tinybsd/conf/wrap/etc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 11:32:14 -0000

Author: ed
Date: Fri Nov 13 11:32:14 2009
New Revision: 199251
URL: http://svn.freebsd.org/changeset/base/199251

Log:
  Convert {small prefix}BSD to TERM=xterm as well.
  
  Clean up the ttys files shipped with PicoBSD, NanoBSD and TinyBSD. While
  there, it seems one of them still had references to sio(4). Make it in
  sync with what we do in the base system.

Modified:
  head/release/picobsd/floppy.tree/etc/ttys
  head/release/picobsd/tinyware/oinit/oinit.c
  head/tools/tools/nanobsd/rescue/Files/etc/ttys
  head/tools/tools/tinybsd/conf/wrap/etc/ttys

Modified: head/release/picobsd/floppy.tree/etc/ttys
==============================================================================
--- head/release/picobsd/floppy.tree/etc/ttys	Fri Nov 13 11:28:54 2009	(r199250)
+++ head/release/picobsd/floppy.tree/etc/ttys	Fri Nov 13 11:32:14 2009	(r199251)
@@ -8,19 +8,19 @@
 # This entry needed for asking password when init goes to single-user mode
 # If you want to be asked for password, change "secure" to "insecure" here
 #console	none				unknown	off secure
-vga	none				cons25	off secure
+vga	none				xterm	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	on  secure
-#ttyv8	"/usr/libexec/getty Pc"		cons25	on  secure
-#ttyv9	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	on  secure
+#ttyv8	"/usr/libexec/getty Pc"		xterm	on  secure
+#ttyv9	"/usr/libexec/getty Pc"		xterm	on  secure
 # Pseudo terminals
 ttyp0	none			network secure
 ttyp1	none			network secure

Modified: head/release/picobsd/tinyware/oinit/oinit.c
==============================================================================
--- head/release/picobsd/tinyware/oinit/oinit.c	Fri Nov 13 11:28:54 2009	(r199250)
+++ head/release/picobsd/tinyware/oinit/oinit.c	Fri Nov 13 11:32:14 2009	(r199251)
@@ -116,7 +116,7 @@ struct command bltins[]={
 	{"cd","Change working directory","cd [dir]","cd /etc",cd},
 	{"pwd","Print current directory","pwd","pwd",pwd},
 	{"exit","Exit from shell()","exit","exit",xit},
-	{"set","Set environment variable","set [VAR=value]","set TERM=cons25",set},
+	{"set","Set environment variable","set [VAR=value]","set TERM=xterm",set},
 	{"unset","Unset environment variable","unset VAR","unset EDITOR",unset},
 	{"echo","Echo arguments on stdout","echo arg1 arg2 ...","echo Hello World!",echo},
 	{"env","Print all environment variables","env","env",env},
@@ -572,7 +572,7 @@ start_session(int vty, int argc, char **
 	if(fd>2) close(fd);
 	login_tty(fd);
 	setpgid(0,getpid());
-	putenv("TERM=cons25");
+	putenv("TERM=xterm");
 	putenv("HOME=/");
 	putenv("PATH=/stand:/bin:/usr/bin:/sbin:.");
 	signal(SIGHUP,SIG_DFL);

Modified: head/tools/tools/nanobsd/rescue/Files/etc/ttys
==============================================================================
--- head/tools/tools/nanobsd/rescue/Files/etc/ttys	Fri Nov 13 11:28:54 2009	(r199250)
+++ head/tools/tools/nanobsd/rescue/Files/etc/ttys	Fri Nov 13 11:32:14 2009	(r199251)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25, but
+#      For virtual consoles, the correct type is typically xterm, but
 #      vt220 will work better if you need interoperability with other
 #      systems like Solaris or GNU/Linux.
 #      Other common values include network for network connections on
@@ -32,15 +32,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	off  secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	on  secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	off secure
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/tools/tools/tinybsd/conf/wrap/etc/ttys
==============================================================================
--- head/tools/tools/tinybsd/conf/wrap/etc/ttys	Fri Nov 13 11:28:54 2009	(r199250)
+++ head/tools/tools/tinybsd/conf/wrap/etc/ttys	Fri Nov 13 11:32:14 2009	(r199251)
@@ -14,7 +14,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25, but
+#      For virtual consoles, the correct type is typically xterm, but
 #      vt220 will work better if you need interoperability with other
 #      systems like Solaris or GNU/Linux.
 #      Other common values include network for network connections on
@@ -31,22 +31,22 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	off  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	off secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	off  secure
-ttyv8	"/usr/X11R6/bin/xdm -nodaemoff"	xterm	off secure
+ttyv1	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv2	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv3	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv4	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv5	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv6	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv7	"/usr/libexec/getty Pc"		xterm	off secure
+ttyv8	"/usr/local/bin/xdm -nodaemoff"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyd0	"/usr/libexec/getty std.9600"	dialup	on secure
-ttyd1	"/usr/libexec/getty std.9600"	dialup	off secure
-ttyd2	"/usr/libexec/getty std.9600"	dialup	off secure
-ttyd3	"/usr/libexec/getty std.9600"	dialup	off secure
+ttyu0	"/usr/libexec/getty std.9600"	dialup	on  secure
+ttyu1	"/usr/libexec/getty std.9600"	dialup	off secure
+ttyu2	"/usr/libexec/getty std.9600"	dialup	off secure
+ttyu3	"/usr/libexec/getty std.9600"	dialup	off secure
 # Dumb console
 dcons	"/usr/libexec/getty std.9600"	vt100	off secure
 # Pseudo terminals

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 11:54:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B2CB106568D;
	Fri, 13 Nov 2009 11:54:52 +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 694228FC08;
	Fri, 13 Nov 2009 11: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 nADBsq7U065376;
	Fri, 13 Nov 2009 11:54:52 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADBsqNm065374;
	Fri, 13 Nov 2009 11:54:52 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200911131154.nADBsqNm065374@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 13 Nov 2009 11:54: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: r199252 - head/etc/etc.pc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 11:54:52 -0000

Author: ed
Date: Fri Nov 13 11:54:52 2009
New Revision: 199252
URL: http://svn.freebsd.org/changeset/base/199252

Log:
  Use cons25w on pc98.
  
  Discussed with:	nyan

Modified:
  head/etc/etc.pc98/ttys

Modified: head/etc/etc.pc98/ttys
==============================================================================
--- head/etc/etc.pc98/ttys	Fri Nov 13 11:32:14 2009	(r199251)
+++ head/etc/etc.pc98/ttys	Fri Nov 13 11:54:52 2009	(r199252)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically cons25w.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv0	"/usr/libexec/getty Pc"		cons25w	on  secure
 # Virtual terminals
-ttyv1	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv2	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv3	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv4	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv5	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv6	"/usr/libexec/getty Pc"		cons25	on  secure
-ttyv7	"/usr/libexec/getty Pc"		cons25	on  secure
+ttyv1	"/usr/libexec/getty Pc"		cons25w	on  secure
+ttyv2	"/usr/libexec/getty Pc"		cons25w	on  secure
+ttyv3	"/usr/libexec/getty Pc"		cons25w	on  secure
+ttyv4	"/usr/libexec/getty Pc"		cons25w	on  secure
+ttyv5	"/usr/libexec/getty Pc"		cons25w	on  secure
+ttyv6	"/usr/libexec/getty Pc"		cons25w	on  secure
+ttyv7	"/usr/libexec/getty Pc"		cons25w	on  secure
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 13:07:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 676DE106566B;
	Fri, 13 Nov 2009 13:07:02 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 548FF8FC0C;
	Fri, 13 Nov 2009 13:07: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 nADD72CY066977;
	Fri, 13 Nov 2009 13:07:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADD72Gi066975;
	Fri, 13 Nov 2009 13:07:02 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200911131307.nADD72Gi066975@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 13 Nov 2009 13:07: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: r199253 - in head/sys/amd64: amd64 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 13:07:02 -0000

Author: kib
Date: Fri Nov 13 13:07:01 2009
New Revision: 199253
URL: http://svn.freebsd.org/changeset/base/199253

Log:
  Amd64 init_secondary() calls initializecpu() while curthread is still
  not properly set up. r199067 added the call to TUNABLE_INT_FETCH() to
  initializecpu() that results in hang because AP are started when kernel
  environment is already dynamic and thus needs to acquire mutex, that is
  too early in AP start sequence to work.
  
  Extract the code that should be executed only once, because it sets
  up global variables, from initializecpu() to initializecpucache(),
  and call the later only from hammer_time() executed on BSP. Now,
  TUNABLE_INT_FETCH() is done only once at BSP at the early boot stage.
  
  In collaboration with:	Mykola Dzham 
  Reviewed by:	jhb
  Tested by:	ed, battlez

Modified:
  head/sys/amd64/amd64/initcpu.c
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/include/md_var.h

Modified: head/sys/amd64/amd64/initcpu.c
==============================================================================
--- head/sys/amd64/amd64/initcpu.c	Fri Nov 13 11:54:52 2009	(r199252)
+++ head/sys/amd64/amd64/initcpu.c	Fri Nov 13 13:07:01 2009	(r199253)
@@ -163,6 +163,11 @@ initializecpu(void)
 	    CPUID_TO_FAMILY(cpu_id) == 0x6 &&
 	    CPUID_TO_MODEL(cpu_id) >= 0xf)
 		init_via();
+}
+
+void
+initializecpucache()
+{
 
 	/*
 	 * CPUID with %eax = 1, %ebx returns

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Fri Nov 13 11:54:52 2009	(r199252)
+++ head/sys/amd64/amd64/machdep.c	Fri Nov 13 13:07:01 2009	(r199253)
@@ -1663,6 +1663,7 @@ hammer_time(u_int64_t modulep, u_int64_t
 
 	identify_cpu();		/* Final stage of CPU initialization */
 	initializecpu();	/* Initialize CPU registers */
+	initializecpucache();
 
 	/* make an initial tss so cpu can get interrupt stack on syscall! */
 	common_tss[0].tss_rsp0 = thread0.td_kstack + \

Modified: head/sys/amd64/include/md_var.h
==============================================================================
--- head/sys/amd64/include/md_var.h	Fri Nov 13 11:54:52 2009	(r199252)
+++ head/sys/amd64/include/md_var.h	Fri Nov 13 13:07:01 2009	(r199253)
@@ -89,6 +89,7 @@ void	gs_load_fault(void) __asm(__STRING(
 void	dump_add_page(vm_paddr_t);
 void	dump_drop_page(vm_paddr_t);
 void	initializecpu(void);
+void	initializecpucache(void);
 void	fillw(int /*u_short*/ pat, void *base, size_t cnt);
 void	fpstate_drop(struct thread *td);
 int	is_physical_memory(vm_paddr_t addr);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 13:13:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 144D910656C0;
	Fri, 13 Nov 2009 13:13:36 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 015808FC0C;
	Fri, 13 Nov 2009 13: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 nADDDZnG067227;
	Fri, 13 Nov 2009 13:13:35 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADDDZh1067225;
	Fri, 13 Nov 2009 13:13:35 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200911131313.nADDDZh1067225@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 13 Nov 2009 13:13: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: r199255 - head/lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 13:13:36 -0000

Author: brueffer
Date: Fri Nov 13 13:13:35 2009
New Revision: 199255
URL: http://svn.freebsd.org/changeset/base/199255

Log:
  Improved the manpage description.  The committed wording
  was provided by jhb.
  
  PR:		140528
  Submitted by:	Chris Petrik 
  Discussed with:	remko, jhb and the submitter
  MFC after:	1 week

Modified:
  head/lib/libc/sys/vfork.2

Modified: head/lib/libc/sys/vfork.2
==============================================================================
--- head/lib/libc/sys/vfork.2	Fri Nov 13 13:08:34 2009	(r199254)
+++ head/lib/libc/sys/vfork.2	Fri Nov 13 13:13:35 2009	(r199255)
@@ -28,12 +28,12 @@
 .\"     @(#)vfork.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd November 13, 2009
 .Dt VFORK 2
 .Os
 .Sh NAME
 .Nm vfork
-.Nd spawn new process in a virtual memory efficient way
+.Nd create a new process without copying the address space
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 13:26:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A754D1065672;
	Fri, 13 Nov 2009 13:26:27 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 94AA68FC19;
	Fri, 13 Nov 2009 13:26: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 nADDQR6E067609;
	Fri, 13 Nov 2009 13:26:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADDQRiW067607;
	Fri, 13 Nov 2009 13:26:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200911131326.nADDQRiW067607@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 13 Nov 2009 13:26:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199257 - head/lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 13:26:27 -0000

Author: brueffer
Date: Fri Nov 13 13:26:27 2009
New Revision: 199257
URL: http://svn.freebsd.org/changeset/base/199257

Log:
  Remove a note about vfork(4) going to be eliminated, it's here to stay.
  
  Submitted by:	kib
  MFC after:	1 week

Modified:
  head/lib/libc/sys/vfork.2

Modified: head/lib/libc/sys/vfork.2
==============================================================================
--- head/lib/libc/sys/vfork.2	Fri Nov 13 13:17:54 2009	(r199256)
+++ head/lib/libc/sys/vfork.2	Fri Nov 13 13:26:27 2009	(r199257)
@@ -113,14 +113,6 @@ The
 system call appeared in
 .Bx 2.9 .
 .Sh BUGS
-This system call will be eliminated when proper system sharing
-mechanisms are implemented.
-Users should not depend on the memory
-sharing semantics of
-.Fn vfork
-as it will, in that case, be made synonymous to
-.Xr fork 2 .
-.Pp
 To avoid a possible deadlock situation,
 processes that are children in the middle
 of a

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 18:31:08 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A5ED5106568B;
	Fri, 13 Nov 2009 18:31:08 +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 408E18FC1D;
	Fri, 13 Nov 2009 18:31:08 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nADIOFLw078111;
	Fri, 13 Nov 2009 11:24:15 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Fri, 13 Nov 2009 11:24:15 -0700 (MST)
Message-Id: <20091113.112415.41705849.imp@bsdimp.com>
To: ed@FreeBSD.org
From: Warner Losh 
In-Reply-To: <200911131126.nADBQiji064699@svn.freebsd.org>
References: <200911131126.nADBQiji064699@svn.freebsd.org>
X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r199249 - in head/etc: . etc.pc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 18:31:08 -0000

> -	sysctl.conf syslog.conf \
> -	etc.${MACHINE_ARCH}/ttys
> +	sysctl.conf syslog.conf
> +
> +.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
> +BIN1+=	etc.${MACHINE}/ttys
> +.else
> +BIN1+=	etc.${MACHINE_ARCH}/ttys
> +.endif

I'd go all the way here and make this be ${MACHINE} unconditionally.

Warner

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 18:31:09 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4DD1E106568F;
	Fri, 13 Nov 2009 18:31:09 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id E705B8FC08;
	Fri, 13 Nov 2009 18:31:08 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nADIMQXW078077;
	Fri, 13 Nov 2009 11:22:26 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Fri, 13 Nov 2009 11:22:25 -0700 (MST)
Message-Id: <20091113.112225.74673095.imp@bsdimp.com>
To: ed@FreeBSD.org
From: Warner Losh 
In-Reply-To: <200911130554.nAD5st8F056133@svn.freebsd.org>
References: <200911130554.nAD5st8F056133@svn.freebsd.org>
X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r199243 - in head: . etc/etc.amd64 etc/etc.arm
 etc/etc.ia64 etc/etc.mips etc/etc.powerpc etc/etc.sparc64 etc/root
 share/skel sys/conf sys/dev/syscons tools/tools/nanobsd/gateworks/Files...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 18:31:09 -0000

> Author: ed
>   I still have to enable this on i386. Right now pc98 and i386 share the
>   same /etc/ttys file. I'm not going to switch pc98, because it uses its
>   own Kanji-capable cons25 emulator.

Sounds like a ${MACHINE} should be used here instead of
${MACHINE_ARCH}, no?

Warner

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 18:38:11 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2D52B1065692;
	Fri, 13 Nov 2009 18:38:11 +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 BF7BE8FC0A;
	Fri, 13 Nov 2009 18:38:10 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 69A271CDC3; Fri, 13 Nov 2009 19:38:09 +0100 (CET)
Date: Fri, 13 Nov 2009 19:38:09 +0100
From: Ed Schouten 
To: Warner Losh 
Message-ID: <20091113183809.GA64905@hoeg.nl>
References: <200911131126.nADBQiji064699@svn.freebsd.org>
	<20091113.112415.41705849.imp@bsdimp.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="ynll37MX3Fmyj3VY"
Content-Disposition: inline
In-Reply-To: <20091113.112415.41705849.imp@bsdimp.com>
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: r199249 - in head/etc: . etc.pc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 18:38:11 -0000


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

Hello Warner,

* Warner Losh  wrote:
> > -	sysctl.conf syslog.conf \
> > -	etc.${MACHINE_ARCH}/ttys
> > +	sysctl.conf syslog.conf
> > +
> > +.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
> > +BIN1+=3D	etc.${MACHINE}/ttys
> > +.else
> > +BIN1+=3D	etc.${MACHINE_ARCH}/ttys
> > +.endif
>=20
> I'd go all the way here and make this be ${MACHINE} unconditionally.

We could, but that means we also have to add a ttys file for sun4v. I
wouldn't mind doing that, but maybe it would be better if the sun4v
folks looked at this.

Cheers,
--=20
 Ed Schouten 
 WWW: http://80386.nl/

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkr9p5EACgkQ52SDGA2eCwWFQgCfSqI23HmR5TThkEeTa3daoqn1
pg4An2vf6faqAB/2MiGwD1fFvaLrhnLt
=PEKe
-----END PGP SIGNATURE-----

--ynll37MX3Fmyj3VY--

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 18:55:56 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA8C41065672;
	Fri, 13 Nov 2009 18:55:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 6703C8FC0C;
	Fri, 13 Nov 2009 18:55:56 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nADInisp078397;
	Fri, 13 Nov 2009 11:49:44 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Fri, 13 Nov 2009 11:49:43 -0700 (MST)
Message-Id: <20091113.114943.71166458.imp@bsdimp.com>
To: ed@80386.nl
From: Warner Losh 
In-Reply-To: <20091113183809.GA64905@hoeg.nl>
References: <200911131126.nADBQiji064699@svn.freebsd.org>
	<20091113.112415.41705849.imp@bsdimp.com>
	<20091113183809.GA64905@hoeg.nl>
X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r199249 - in head/etc: . etc.pc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 18:55:56 -0000

From: Ed Schouten 
Subject: Re: svn commit: r199249 - in head/etc: . etc.pc98
Date: Fri, 13 Nov 2009 19:38:09 +0100

> Hello Warner,
> 
> * Warner Losh  wrote:
> > > -	sysctl.conf syslog.conf \
> > > -	etc.${MACHINE_ARCH}/ttys
> > > +	sysctl.conf syslog.conf
> > > +
> > > +.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
> > > +BIN1+=	etc.${MACHINE}/ttys
> > > +.else
> > > +BIN1+=	etc.${MACHINE_ARCH}/ttys
> > > +.endif
> > 
> > I'd go all the way here and make this be ${MACHINE} unconditionally.
> 
> We could, but that means we also have to add a ttys file for sun4v. I
> wouldn't mind doing that, but maybe it would be better if the sun4v
> folks looked at this.

sun4v likely is moribund enough that nobody would notice if it broke.
But a repo-copy is easily enough to do.  I'll do it...

Warner

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 21:06:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D4CB1065692;
	Fri, 13 Nov 2009 21:06:34 +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 420078FC17;
	Fri, 13 Nov 2009 21:06: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 nADL6Y2p077761;
	Fri, 13 Nov 2009 21:06:34 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADL6XuE077760;
	Fri, 13 Nov 2009 21:06:33 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911132106.nADL6XuE077760@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 13 Nov 2009 21:06: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: r199258 - head/sys/dev/sound/pci/hda
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 21:06:34 -0000

Author: mav
Date: Fri Nov 13 21:06:33 2009
New Revision: 199258
URL: http://svn.freebsd.org/changeset/base/199258

Log:
  Add more codec IDs.

Modified:
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.c	Fri Nov 13 13:26:27 2009	(r199257)
+++ head/sys/dev/sound/pci/hda/hdac.c	Fri Nov 13 21:06:33 2009	(r199258)
@@ -86,7 +86,7 @@
 
 #include "mixer_if.h"
 
-#define HDA_DRV_TEST_REV	"20090929_0137"
+#define HDA_DRV_TEST_REV	"20091113_0138"
 
 SND_DECLARE_FILE("$FreeBSD$");
 
@@ -764,6 +764,16 @@ static const struct {
 #define HDA_CODEC_VT1702_5	HDA_CODEC_CONSTRUCT(VIA, 0x5398)
 #define HDA_CODEC_VT1702_6	HDA_CODEC_CONSTRUCT(VIA, 0x6398)
 #define HDA_CODEC_VT1702_7	HDA_CODEC_CONSTRUCT(VIA, 0x7398)
+#define HDA_CODEC_VT1716S_0	HDA_CODEC_CONSTRUCT(VIA, 0x0433)
+#define HDA_CODEC_VT1716S_1	HDA_CODEC_CONSTRUCT(VIA, 0xa721)
+#define HDA_CODEC_VT1718S_0	HDA_CODEC_CONSTRUCT(VIA, 0x0428)
+#define HDA_CODEC_VT1718S_1	HDA_CODEC_CONSTRUCT(VIA, 0x4428)
+#define HDA_CODEC_VT1812	HDA_CODEC_CONSTRUCT(VIA, 0x0448)
+#define HDA_CODEC_VT1818S	HDA_CODEC_CONSTRUCT(VIA, 0x0440)
+#define HDA_CODEC_VT1828S	HDA_CODEC_CONSTRUCT(VIA, 0x4441)
+#define HDA_CODEC_VT2002P_0	HDA_CODEC_CONSTRUCT(VIA, 0x0438)
+#define HDA_CODEC_VT2002P_1	HDA_CODEC_CONSTRUCT(VIA, 0x4438)
+#define HDA_CODEC_VT2020	HDA_CODEC_CONSTRUCT(VIA, 0x0441)
 #define HDA_CODEC_VTXXXX	HDA_CODEC_CONSTRUCT(VIA, 0xffff)
 
 /* ATI */
@@ -786,6 +796,7 @@ static const struct {
 #define HDA_CODEC_INTELG45_2	HDA_CODEC_CONSTRUCT(INTEL, 0x2802)
 #define HDA_CODEC_INTELG45_3	HDA_CODEC_CONSTRUCT(INTEL, 0x2803)
 #define HDA_CODEC_INTELG45_4	HDA_CODEC_CONSTRUCT(INTEL, 0x29fb)
+#define HDA_CODEC_INTELQ57	HDA_CODEC_CONSTRUCT(INTEL, 0x0054)
 #define HDA_CODEC_INTELXXXX	HDA_CODEC_CONSTRUCT(INTEL, 0xffff)
 
 /* Codecs */
@@ -917,6 +928,16 @@ static const struct {
 	{ HDA_CODEC_VT1702_5, "VIA VT1702_5" },
 	{ HDA_CODEC_VT1702_6, "VIA VT1702_6" },
 	{ HDA_CODEC_VT1702_7, "VIA VT1702_7" },
+	{ HDA_CODEC_VT1716S_0, "VIA VT1716S_0" },
+	{ HDA_CODEC_VT1716S_1, "VIA VT1716S_1" },
+	{ HDA_CODEC_VT1718S_0, "VIA VT1718S_0" },
+	{ HDA_CODEC_VT1718S_1, "VIA VT1718S_1" },
+	{ HDA_CODEC_VT1812, "VIA VT1812" },
+	{ HDA_CODEC_VT1818S, "VIA VT1818S" },
+	{ HDA_CODEC_VT1828S, "VIA VT1828S" },
+	{ HDA_CODEC_VT2002P_0, "VIA VT2002P_0" },
+	{ HDA_CODEC_VT2002P_1, "VIA VT2002P_1" },
+	{ HDA_CODEC_VT2020, "VIA VT2020" },
 	{ HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" },
 	{ HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" },
 	{ HDA_CODEC_ATIRS690,  "ATI RS690/780 HDMI" },
@@ -930,6 +951,7 @@ static const struct {
 	{ HDA_CODEC_INTELG45_2, "Intel G45 HDMI" },
 	{ HDA_CODEC_INTELG45_3, "Intel G45 HDMI" },
 	{ HDA_CODEC_INTELG45_4, "Intel G45 HDMI" },
+	{ HDA_CODEC_INTELQ57, "Intel Q57 HDMI" },
 	{ HDA_CODEC_SII1390,   "Silicon Image SiI1390 HDMI" },
 	{ HDA_CODEC_SII1392,   "Silicon Image SiI1392 HDMI" },
 	/* Unknown codec */

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 22:53:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5CEB1065676;
	Fri, 13 Nov 2009 22:53:49 +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 A44AF8FC17;
	Fri, 13 Nov 2009 22:53: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 nADMrnXV080130;
	Fri, 13 Nov 2009 22:53:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADMrnPb080127;
	Fri, 13 Nov 2009 22:53:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911132253.nADMrnPb080127@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 13 Nov 2009 22:53:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199259 - in head/sys/dev/ata: . chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 22:53:49 -0000

Author: mav
Date: Fri Nov 13 22:53:49 2009
New Revision: 199259
URL: http://svn.freebsd.org/changeset/base/199259

Log:
  Add support for SATA ports on SATA+PATA Marvell controllers.
  These controllers provide combination of AHCI for SATA and legacy
  PCI ATA for PATA. Use same solution as used for JMicron controllers.
  Add IDs of Marvell 88SX6102, 88SX6111. 88SX6141 alike controllers

Modified:
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/chipsets/ata-marvell.c

Modified: head/sys/dev/ata/ata-pci.h
==============================================================================
--- head/sys/dev/ata/ata-pci.h	Fri Nov 13 21:06:33 2009	(r199258)
+++ head/sys/dev/ata/ata-pci.h	Fri Nov 13 22:53:49 2009	(r199259)
@@ -225,7 +225,10 @@ struct ata_pci_controller {
 #define ATA_M88SX6081           0x608111ab
 #define ATA_M88SX7042           0x704211ab
 #define ATA_M88SX6101           0x610111ab
+#define ATA_M88SX6102           0x610211ab
+#define ATA_M88SX6111           0x611111ab
 #define ATA_M88SX6121           0x612111ab
+#define ATA_M88SX6141           0x614111ab
 #define ATA_M88SX6145           0x614511ab
 
 #define ATA_MICRON_ID           0x1042

Modified: head/sys/dev/ata/chipsets/ata-marvell.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-marvell.c	Fri Nov 13 21:06:33 2009	(r199258)
+++ head/sys/dev/ata/chipsets/ata-marvell.c	Fri Nov 13 22:53:49 2009	(r199259)
@@ -52,9 +52,11 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /* local prototypes */
-static int ata_marvell_pata_chipinit(device_t dev);
-static int ata_marvell_pata_ch_attach(device_t dev);
-static void ata_marvell_pata_setmode(device_t dev, int mode);
+static int ata_marvell_chipinit(device_t dev);
+static int ata_marvell_ch_attach(device_t dev);
+static int ata_marvell_ch_detach(device_t dev);
+static void ata_marvell_setmode(device_t dev, int mode);
+static void ata_marvell_reset(device_t dev);
 static int ata_marvell_edma_ch_attach(device_t dev);
 static int ata_marvell_edma_ch_detach(device_t dev);
 static int ata_marvell_edma_status(device_t dev);
@@ -107,9 +109,12 @@ ata_marvell_probe(device_t dev)
      { ATA_M88SX6042, 0, 4, MV_6042, ATA_SA300, "88SX6042" },
      { ATA_M88SX6081, 0, 8, MV_60XX, ATA_SA300, "88SX6081" },
      { ATA_M88SX7042, 0, 4, MV_7042, ATA_SA300, "88SX7042" },
-     { ATA_M88SX6101, 0, 1, MV_61XX, ATA_UDMA6, "88SX6101" },
-     { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" },
-     { ATA_M88SX6145, 0, 2, MV_61XX, ATA_UDMA6, "88SX6145" },
+     { ATA_M88SX6101, 0, 0, MV_61XX, ATA_UDMA6, "88SX6101" },
+     { ATA_M88SX6102, 0, 0, MV_61XX, ATA_UDMA6, "88SX6102" },
+     { ATA_M88SX6111, 0, 1, MV_61XX, ATA_SA300, "88SX6111" },
+     { ATA_M88SX6121, 0, 2, MV_61XX, ATA_SA300, "88SX6121" },
+     { ATA_M88SX6141, 0, 4, MV_61XX, ATA_SA300, "88SX6141" },
+     { ATA_M88SX6145, 0, 4, MV_61XX, ATA_SA300, "88SX6145" },
      { 0, 0, 0, 0, 0, 0}};
 
     if (pci_get_vendor(dev) != ATA_MARVELL_ID)
@@ -128,53 +133,92 @@ ata_marvell_probe(device_t dev)
 	ctlr->chipinit = ata_marvell_edma_chipinit;
 	break;
     case MV_61XX:
-	ctlr->chipinit = ata_marvell_pata_chipinit;
+	ctlr->chipinit = ata_marvell_chipinit;
 	break;
     }
     return (BUS_PROBE_DEFAULT);
 }
 
 static int
-ata_marvell_pata_chipinit(device_t dev)
+ata_marvell_chipinit(device_t dev)
 {
     struct ata_pci_controller *ctlr = device_get_softc(dev);
+    int error = 0;
 
     if (ata_setup_interrupt(dev, ata_generic_intr))
 	return ENXIO;
 
-    ctlr->ch_attach = ata_marvell_pata_ch_attach;
-    ctlr->ch_detach = ata_pci_ch_detach;
-    ctlr->setmode = ata_marvell_pata_setmode;
-    ctlr->channels = ctlr->chip->cfg1;
-    return 0;
+    if (ctlr->chip->cfg1 && (error = ata_ahci_chipinit(dev)))
+	return (error);    
+    ctlr->ch_attach = ata_marvell_ch_attach;
+    ctlr->ch_detach = ata_marvell_ch_detach;
+    ctlr->reset = ata_marvell_reset;
+    ctlr->setmode = ata_marvell_setmode;
+    ctlr->channels = ctlr->chip->cfg1 + 1;
+    return (0);
 }
 
 static int
-ata_marvell_pata_ch_attach(device_t dev)
+ata_marvell_ch_attach(device_t dev)
 {
+    struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
     struct ata_channel *ch = device_get_softc(dev);
+    int error;
  
-    /* setup the usual register normal pci style */
-    if (ata_pci_ch_attach(dev))
-	return ENXIO;
- 
-    /* dont use 32 bit PIO transfers */
+    if (ch->unit >= ctlr->chip->cfg1) {
+	ch->unit -= ctlr->chip->cfg1;
+	error = ata_pci_ch_attach(dev);
+	ch->unit += ctlr->chip->cfg1;
+    	/* dont use 32 bit PIO transfers */
 	ch->flags |= ATA_USE_16BIT;
+    } else
+	error = ata_ahci_ch_attach(dev);
+    return (error);
+}
 
-    return 0;
+static int
+ata_marvell_ch_detach(device_t dev)
+{
+    struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+    struct ata_channel *ch = device_get_softc(dev);
+    int error;
+ 
+    if (ch->unit >= ctlr->chip->cfg1) {
+	ch->unit -= ctlr->chip->cfg1;
+	error = ata_pci_ch_detach(dev);
+	ch->unit += ctlr->chip->cfg1;
+    } else
+	error = ata_ahci_ch_detach(dev);
+    return (error);
+}
+
+static void
+ata_marvell_reset(device_t dev)
+{
+    struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+    struct ata_channel *ch = device_get_softc(dev);
+	
+    if (ch->unit >= ctlr->chip->cfg1)
+	ata_generic_reset(dev);
+    else
+	ata_ahci_reset(dev);
 }
 
 static void
-ata_marvell_pata_setmode(device_t dev, int mode)
+ata_marvell_setmode(device_t dev, int mode)
 {
     device_t gparent = GRANDPARENT(dev);
     struct ata_pci_controller *ctlr = device_get_softc(gparent);
+    struct ata_channel *ch = device_get_softc(device_get_parent(dev));
     struct ata_device *atadev = device_get_softc(dev);
 
-    mode = ata_limit_mode(dev, mode, ctlr->chip->max_dma);
-    mode = ata_check_80pin(dev, mode);
-    if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
-	atadev->mode = mode;
+    if (ch->unit >= ctlr->chip->cfg1) {
+	mode = ata_limit_mode(dev, mode, ctlr->chip->max_dma);
+	mode = ata_check_80pin(dev, mode);
+	if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
+	    atadev->mode = mode;
+    } else
+	ata_sata_setmode(dev, mode);
 }
 
 int

From owner-svn-src-head@FreeBSD.ORG  Fri Nov 13 22:57:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CB0A106568B;
	Fri, 13 Nov 2009 22:57:20 +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 4ACFB8FC1C;
	Fri, 13 Nov 2009 22:57: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 nADMvKnL080243;
	Fri, 13 Nov 2009 22:57:20 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nADMvK42080237;
	Fri, 13 Nov 2009 22:57:20 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200911132257.nADMvK42080237@svn.freebsd.org>
From: Attilio Rao 
Date: Fri, 13 Nov 2009 22:57: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: r199260 - head/sys/dev/aic7xxx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 13 Nov 2009 22:57:20 -0000

Author: attilio
Date: Fri Nov 13 22:57:20 2009
New Revision: 199260
URL: http://svn.freebsd.org/changeset/base/199260

Log:
  Add sysctls in ahd(4) in order to keep track of different classes of
  errors. So far 3 different classes are present (correctable,
  uncorrectable and fatal) but more can be added easilly.
  
  Obtained from:	Sandvine Incorporated
  Reviewed by:	emase, gibbs
  Sponsored by:	Sandvine Incorporated
  MFC:		2 weeks

Modified:
  head/sys/dev/aic7xxx/ahd_pci.c
  head/sys/dev/aic7xxx/aic79xx.c
  head/sys/dev/aic7xxx/aic79xx.h
  head/sys/dev/aic7xxx/aic79xx_osm.c
  head/sys/dev/aic7xxx/aic79xx_osm.h

Modified: head/sys/dev/aic7xxx/ahd_pci.c
==============================================================================
--- head/sys/dev/aic7xxx/ahd_pci.c	Fri Nov 13 22:53:49 2009	(r199259)
+++ head/sys/dev/aic7xxx/ahd_pci.c	Fri Nov 13 22:57:20 2009	(r199260)
@@ -134,6 +134,7 @@ ahd_pci_attach(device_t dev)
 		return (error);
 	}
 
+	ahd_sysctl(ahd);
 	ahd_attach(ahd);
 	return (0);
 }
@@ -198,6 +199,7 @@ ahd_pci_map_registers(struct ahd_softc *
 				bus_release_resource(ahd->dev_softc, regs_type,
 						     regs_id, regs);
 				regs = NULL;
+				AHD_CORRECTABLE_ERROR(ahd);
 			} else {
 				command &= ~PCIM_CMD_PORTEN;
 				aic_pci_write_config(ahd->dev_softc,
@@ -214,6 +216,7 @@ ahd_pci_map_registers(struct ahd_softc *
 		if (regs == NULL) {
 			device_printf(ahd->dev_softc,
 				      "can't allocate register resources\n");
+			AHD_UNCORRECTABLE_ERROR(ahd);
 			return (ENOMEM);
 		}
 		ahd->tags[0] = rman_get_bustag(regs);
@@ -226,6 +229,7 @@ ahd_pci_map_registers(struct ahd_softc *
 		if (regs2 == NULL) {
 			device_printf(ahd->dev_softc,
 				      "can't allocate register resources\n");
+			AHD_UNCORRECTABLE_ERROR(ahd);
 			return (ENOMEM);
 		}
 		ahd->tags[1] = rman_get_bustag(regs2);

Modified: head/sys/dev/aic7xxx/aic79xx.c
==============================================================================
--- head/sys/dev/aic7xxx/aic79xx.c	Fri Nov 13 22:53:49 2009	(r199259)
+++ head/sys/dev/aic7xxx/aic79xx.c	Fri Nov 13 22:57:20 2009	(r199260)
@@ -401,6 +401,7 @@ ahd_flush_qoutfifo(struct ahd_softc *ahd
 		if (scb == NULL) {
 			printf("%s: Warning - GSFIFO SCB %d invalid\n",
 			       ahd_name(ahd), scbid);
+			AHD_CORRECTABLE_ERROR(ahd);
 			continue;
 		}
 		/*
@@ -525,6 +526,7 @@ rescan_fifos:
 		if (scb == NULL) {
 			printf("%s: Warning - DMA-up and complete "
 			       "SCB %d invalid\n", ahd_name(ahd), scbid);
+			AHD_CORRECTABLE_ERROR(ahd);
 			continue;
 		}
 		hscb_ptr = (uint8_t *)scb->hscb;
@@ -546,6 +548,7 @@ rescan_fifos:
 		if (scb == NULL) {
 			printf("%s: Warning - Complete Qfrz SCB %d invalid\n",
 			       ahd_name(ahd), scbid);
+			AHD_CORRECTABLE_ERROR(ahd);
 			continue;
 		}
 
@@ -563,6 +566,7 @@ rescan_fifos:
 		if (scb == NULL) {
 			printf("%s: Warning - Complete SCB %d invalid\n",
 			       ahd_name(ahd), scbid);
+			AHD_CORRECTABLE_ERROR(ahd);
 			continue;
 		}
 
@@ -870,6 +874,7 @@ ahd_run_qoutfifo(struct ahd_softc *ahd)
 			       "(cmdcmplt)\nQOUTPOS = %d\n",
 			       ahd_name(ahd), scb_index,
 			       ahd->qoutfifonext);
+			AHD_CORRECTABLE_ERROR(ahd);
 			ahd_dump_card_state(ahd);
 		} else if ((completion->sg_status & SG_STATUS_VALID) != 0) {
 			ahd_handle_scb_status(ahd, scb);
@@ -897,9 +902,11 @@ ahd_handle_hwerrint(struct ahd_softc *ah
 
 	error = ahd_inb(ahd, ERROR);
 	for (i = 0; i < num_errors; i++) {
-		if ((error & ahd_hard_errors[i].errno) != 0)
+		if ((error & ahd_hard_errors[i].errno) != 0) {
 			printf("%s: hwerrint, %s\n",
 			       ahd_name(ahd), ahd_hard_errors[i].errmesg);
+			AHD_UNCORRECTABLE_ERROR(ahd);
+		}
 	}
 
 	ahd_dump_card_state(ahd);
@@ -990,6 +997,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		       ahd_name(ahd));
 		ahd_dump_card_state(ahd);
 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
+		AHD_UNCORRECTABLE_ERROR(ahd);
 		break;
 	case STATUS_OVERRUN:
 	{
@@ -1005,6 +1013,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		printf("SCB %d Packetized Status Overrun", scbid);
 		ahd_dump_card_state(ahd);
 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
+		AHD_UNCORRECTABLE_ERROR(ahd);
 		break;
 	}
 	case CFG4ISTAT_INTR:
@@ -1017,6 +1026,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		if (scb == NULL) {
 			ahd_dump_card_state(ahd);
 			printf("CFG4ISTAT: Free SCB %d referenced", scbid);
+			AHD_FATAL_ERROR(ahd);
 			panic("For safety");
 		}
 		ahd_outq(ahd, HADDR, scb->sense_busaddr);
@@ -1044,6 +1054,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		case P_MESGIN:
 			ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
 			printf("%s: Issued Bus Reset.\n", ahd_name(ahd));
+			AHD_UNCORRECTABLE_ERROR(ahd);
 			break;
 		case P_COMMAND:
 		{
@@ -1068,6 +1079,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 			scbid = ahd_get_scbptr(ahd);
 			scb = ahd_lookup_scb(ahd, scbid);
 			if (scb == NULL) {
+				AHD_CORRECTABLE_ERROR(ahd);
 				printf("Invalid phase with no valid SCB.  "
 				       "Resetting bus.\n");
 				ahd_reset_channel(ahd, 'A',
@@ -1127,6 +1139,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 #ifdef AHD_DEBUG
 			if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) {
 				ahd_print_path(ahd, scb);
+				AHD_CORRECTABLE_ERROR(ahd);
 				printf("Unexpected command phase from "
 				       "packetized target\n");
 			}
@@ -1214,6 +1227,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 			 && bus_phase != P_MESGOUT) {
 				printf("ahd_intr: HOST_MSG_LOOP bad "
 				       "phase 0x%x\n", bus_phase);
+				AHD_CORRECTABLE_ERROR(ahd);
 				/*
 				 * Probably transitioned to bus free before
 				 * we got here.  Just punt the message.
@@ -1316,6 +1330,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		       ahd_name(ahd), 'A',
 		       SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)),
 		       lastphase, ahd_inb(ahd, SCSISIGI));
+		AHD_CORRECTABLE_ERROR(ahd);
 		break;
 	}
 	case MISSED_BUSFREE:
@@ -1328,6 +1343,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		       ahd_name(ahd), 'A',
 		       SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)),
 		       lastphase, ahd_inb(ahd, SCSISIGI));
+		AHD_CORRECTABLE_ERROR(ahd);
 		ahd_restart(ahd);
 		return;
 	}
@@ -1387,6 +1403,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		       devinfo.lun);
 		scbid = ahd_get_scbptr(ahd);
 		scb = ahd_lookup_scb(ahd, scbid);
+		AHD_CORRECTABLE_ERROR(ahd);
 		if (scb != NULL
 		 && (scb->flags & SCB_RECOVERY_SCB) != 0)
 			/*
@@ -1570,11 +1587,13 @@ ahd_handle_scsiint(struct ahd_softc *ahd
 
 		printf("%s: SCSI offset overrun detected.  Resetting bus.\n",
 		       ahd_name(ahd));
+		AHD_CORRECTABLE_ERROR(ahd);
 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
 	} else if ((status & SCSIRSTI) != 0) {
 
 		printf("%s: Someone reset channel A\n", ahd_name(ahd));
 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE);
+		AHD_UNCORRECTABLE_ERROR(ahd);
 	} else if ((status & SCSIPERR) != 0) {
 
 		/* Make sure the sequencer is in a safe location. */
@@ -1619,6 +1638,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd
 			       "valid during SELTO scb(0x%x)\n",
 			       ahd_name(ahd), scbid);
 			ahd_dump_card_state(ahd);
+			AHD_UNCORRECTABLE_ERROR(ahd);
 		} else {
 			struct ahd_devinfo devinfo;
 #ifdef AHD_DEBUG
@@ -1654,6 +1674,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd
 	} else if (status3 != 0) {
 		printf("%s: SCSI Cell parity error SSTAT3 == 0x%x\n",
 		       ahd_name(ahd), status3);
+		AHD_CORRECTABLE_ERROR(ahd);
 		ahd_outb(ahd, CLRSINT3, status3);
 	} else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) {
 
@@ -1712,6 +1733,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd
 				       "during unexpected busfree\n",
 				       ahd_name(ahd), scbid, mode);
 				packetized = 0;
+				AHD_CORRECTABLE_ERROR(ahd);
 			} else
 				packetized = (scb->flags & SCB_PACKETIZED) != 0;
 			clear_fifo = 1;
@@ -1856,6 +1878,7 @@ ahd_handle_transmission_error(struct ahd
 		ahd_scsisigi_print(curphase, &cur_col, 50);
 		ahd_perrdiag_print(perrdiag, &cur_col, 50);
 		printf("\n");
+		AHD_CORRECTABLE_ERROR(ahd);
 		ahd_dump_card_state(ahd);
 	}
 
@@ -1864,6 +1887,7 @@ ahd_handle_transmission_error(struct ahd
 			printf("%s: Gross protocol error during incoming "
 			       "packet.  lqistat1 == 0x%x.  Resetting bus.\n",
 			       ahd_name(ahd), lqistat1);
+			AHD_UNCORRECTABLE_ERROR(ahd);
 		}
 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
 		return;
@@ -1891,6 +1915,7 @@ ahd_handle_transmission_error(struct ahd
 		 */
 		ahd_outb(ahd, LQCTL2, LQIRETRY);
 		printf("LQIRetry for LQICRCI_LQ to release ACK\n");
+		AHD_CORRECTABLE_ERROR(ahd);
 	} else if ((lqistat1 & LQICRCI_NLQ) != 0) {
 		/*
 		 * We detected a CRC error in a NON-LQ packet.
@@ -1942,6 +1967,7 @@ ahd_handle_transmission_error(struct ahd
 		if (scb == NULL) {
 			printf("%s: No SCB valid for LQICRC_NLQ.  "
 			       "Resetting bus\n", ahd_name(ahd));
+			AHD_UNCORRECTABLE_ERROR(ahd);
 			ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
 			return;
 		}
@@ -1999,9 +2025,11 @@ ahd_handle_lqiphase_error(struct ahd_sof
 	 && (ahd_inb(ahd, MDFFSTAT) & DLZERO) != 0) {
 		if ((lqistat1 & LQIPHASE_LQ) != 0) {
 			printf("LQIRETRY for LQIPHASE_LQ\n");
+			AHD_CORRECTABLE_ERROR(ahd);
 			ahd_outb(ahd, LQCTL2, LQIRETRY);
 		} else if ((lqistat1 & LQIPHASE_NLQ) != 0) {
 			printf("LQIRETRY for LQIPHASE_NLQ\n");
+			AHD_CORRECTABLE_ERROR(ahd);
 			ahd_outb(ahd, LQCTL2, LQIRETRY);
 		} else
 			panic("ahd_handle_lqiphase_error: No phase errors\n");
@@ -2010,6 +2038,7 @@ ahd_handle_lqiphase_error(struct ahd_sof
 		ahd_unpause(ahd);
 	} else {
 		printf("Reseting Channel for LQI Phase error\n");
+		AHD_CORRECTABLE_ERROR(ahd);
 		ahd_dump_card_state(ahd);
 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
 	}
@@ -2099,6 +2128,7 @@ ahd_handle_pkt_busfree(struct ahd_softc 
 				ahd_print_path(ahd, scb);
 				printf("Probable outgoing LQ CRC error.  "
 				       "Retrying command\n");
+				AHD_CORRECTABLE_ERROR(ahd);
 			}
 			scb->crc_retry_count++;
 		} else {
@@ -2134,6 +2164,7 @@ ahd_handle_pkt_busfree(struct ahd_softc 
 		scb = ahd_lookup_scb(ahd, scbid);
 		ahd_print_path(ahd, scb);
 		printf("Unexpected PKT busfree condition\n");
+		AHD_UNCORRECTABLE_ERROR(ahd);
 		ahd_dump_card_state(ahd);
 		ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb), 'A',
 			       SCB_GET_LUN(scb), SCB_GET_TAG(scb),
@@ -2143,6 +2174,7 @@ ahd_handle_pkt_busfree(struct ahd_softc 
 		return (1);
 	}
 	printf("%s: Unexpected PKT busfree condition\n", ahd_name(ahd));
+	AHD_UNCORRECTABLE_ERROR(ahd);
 	ahd_dump_card_state(ahd);
 	/* Restart the sequencer. */
 	return (1);
@@ -2421,6 +2453,7 @@ ahd_handle_nonpkt_busfree(struct ahd_sof
 		       ahd_lookup_phase_entry(lastphase)->phasemsg,
 		       aborted,
 		       ahd_inw(ahd, PRGMCNT));
+		AHD_UNCORRECTABLE_ERROR(ahd);
 		ahd_dump_card_state(ahd);
 		if (lastphase != P_BUSFREE)
 			ahd_force_renegotiation(ahd, &devinfo);
@@ -2456,6 +2489,7 @@ ahd_handle_proto_violation(struct ahd_so
 		ahd_print_devinfo(ahd, &devinfo);
 		printf("Target did not send an IDENTIFY message. "
 		       "LASTPHASE = 0x%x.\n", lastphase);
+		AHD_UNCORRECTABLE_ERROR(ahd);
 		scb = NULL;
 	} else if (scb == NULL) {
 		/*
@@ -2464,12 +2498,14 @@ ahd_handle_proto_violation(struct ahd_so
 		 */
 		ahd_print_devinfo(ahd, &devinfo);
 		printf("No SCB found during protocol violation\n");
+		AHD_UNCORRECTABLE_ERROR(ahd);
 		goto proto_violation_reset;
 	} else {
 		aic_set_transaction_status(scb, CAM_SEQUENCE_FAIL);
 		if ((seq_flags & NO_CDB_SENT) != 0) {
 			ahd_print_path(ahd, scb);
 			printf("No or incomplete CDB sent to device.\n");
+			AHD_UNCORRECTABLE_ERROR(ahd);
 		} else if ((ahd_inb_scbram(ahd, SCB_CONTROL)
 			  & STATUS_RCVD) == 0) {
 			/*
@@ -2484,6 +2520,7 @@ ahd_handle_proto_violation(struct ahd_so
 		} else {
 			ahd_print_path(ahd, scb);
 			printf("Unknown protocol violation.\n");
+			AHD_UNCORRECTABLE_ERROR(ahd);
 			ahd_dump_card_state(ahd);
 		}
 	}
@@ -2499,6 +2536,7 @@ proto_violation_reset:
 		found = ahd_reset_channel(ahd, 'A', TRUE);
 		printf("%s: Issued Channel %c Bus Reset. "
 		       "%d SCBs aborted\n", ahd_name(ahd), 'A', found);
+		AHD_UNCORRECTABLE_ERROR(ahd);
 	} else {
 		/*
 		 * Leave the selection hardware off in case
@@ -2521,6 +2559,7 @@ proto_violation_reset:
 		}
 		printf("Protocol violation %s.  Attempting to abort.\n",
 		       ahd_lookup_phase_entry(curphase)->phasemsg);
+		AHD_UNCORRECTABLE_ERROR(ahd);
 	}
 }
 
@@ -2602,6 +2641,7 @@ ahd_clear_critical_section(struct ahd_so
 			       "%s: First Instruction 0x%x now 0x%x\n",
 			       ahd_name(ahd), ahd_name(ahd), first_instr,
 			       seqaddr);
+			AHD_FATAL_ERROR(ahd);
 			ahd_dump_card_state(ahd);
 			panic("critical section loop");
 		}
@@ -3566,6 +3606,7 @@ ahd_setup_initiator_msgout(struct ahd_so
 	} else if (scb == NULL) {
 		printf("%s: WARNING. No pending message for "
 		       "I_T msgin.  Issuing NO-OP\n", ahd_name(ahd));
+		AHD_CORRECTABLE_ERROR(ahd);
 		ahd->msgout_buf[ahd->msgout_index++] = MSG_NOOP;
 		ahd->msgout_len++;
 		ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
@@ -3596,6 +3637,7 @@ ahd_setup_initiator_msgout(struct ahd_so
 		ahd->msgout_len++;
 		ahd_print_path(ahd, scb);
 		printf("Bus Device Reset Message Sent\n");
+		AHD_CORRECTABLE_ERROR(ahd);
 		/*
 		 * Clear our selection hardware in advance of
 		 * the busfree.  We may have an entry in the waiting
@@ -3615,6 +3657,7 @@ ahd_setup_initiator_msgout(struct ahd_so
 		ahd_print_path(ahd, scb);
 		printf("Abort%s Message Sent\n",
 		       (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : "");
+		AHD_CORRECTABLE_ERROR(ahd);
 		/*
 		 * Clear our selection hardware in advance of
 		 * the busfree.  We may have an entry in the waiting
@@ -3638,6 +3681,7 @@ ahd_setup_initiator_msgout(struct ahd_so
 		       "does not have a waiting message\n");
 		printf("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid,
 		       devinfo->target_mask);
+		AHD_FATAL_ERROR(ahd);
 		panic("SCB = %d, SCB Control = %x:%x, MSG_OUT = %x "
 		      "SCB flags = %x", SCB_GET_TAG(scb), scb->hscb->control,
 		      ahd_inb_scbram(ahd, SCB_CONTROL), ahd_inb(ahd, MSG_OUT),
@@ -5129,9 +5173,11 @@ ahd_handle_devreset(struct ahd_softc *ah
 			       lun, AC_SENT_BDR, NULL);
 
 	if (message != NULL
-	 && (verbose_level <= bootverbose))
+	 && (verbose_level <= bootverbose)) {
+		AHD_CORRECTABLE_ERROR(ahd);
 		printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd),
 		       message, devinfo->channel, devinfo->target, found);
+	}
 }
 
 #ifdef AHD_TARGET_MODE
@@ -5509,6 +5555,7 @@ ahd_reset(struct ahd_softc *ahd, int rei
 	if (wait == 0) {
 		printf("%s: WARNING - Failed chip reset!  "
 		       "Trying to initialize anyway.\n", ahd_name(ahd));
+		AHD_FATAL_ERROR(ahd);
 	}
 	ahd_outb(ahd, HCNTRL, ahd->pause);
 
@@ -5630,6 +5677,7 @@ ahd_init_scbdata(struct ahd_softc *ahd)
 	scb_data->maxhscbs = ahd_probe_scbs(ahd);
 	if (scb_data->maxhscbs == 0) {
 		printf("%s: No SCB space found\n", ahd_name(ahd));
+		AHD_FATAL_ERROR(ahd);
 		return (ENXIO);
 	}
 
@@ -6474,6 +6522,7 @@ ahd_init(struct ahd_softc *ahd)
 		printf("%s: WARNING. Termination is not configured correctly.\n"
 		       "%s: WARNING. SCSI bus operations may FAIL.\n",
 		       ahd_name(ahd), ahd_name(ahd));
+		AHD_CORRECTABLE_ERROR(ahd);
 	}
 init_done:
 	ahd_restart(ahd);
@@ -6830,6 +6879,7 @@ ahd_default_config(struct ahd_softc *ahd
 	if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) {
 		printf("%s: unable to allocate ahd_tmode_tstate.  "
 		       "Failing attach\n", ahd_name(ahd));
+		AHD_FATAL_ERROR(ahd);
 		return (ENOMEM);
 	}
 
@@ -6909,6 +6959,7 @@ ahd_parse_cfgdata(struct ahd_softc *ahd,
 	if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) {
 		printf("%s: unable to allocate ahd_tmode_tstate.  "
 		       "Failing attach\n", ahd_name(ahd));
+		AHD_FATAL_ERROR(ahd);
 		return (ENOMEM);
 	}
 
@@ -7135,6 +7186,7 @@ ahd_pause_and_flushwork(struct ahd_softc
 	if (maxloops == 0) {
 		printf("Infinite interrupt loop, INTSTAT = %x",
 		      ahd_inb(ahd, INTSTAT));
+		AHD_FATAL_ERROR(ahd);
 	}
 	ahd->qfreeze_cnt++;
 	ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt);
@@ -7440,6 +7492,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd
 		if (scb == NULL) {
 			printf("qinpos = %d, SCB index = %d\n",
 				qinpos, ahd->qinfifo[qinpos]);
+			AHD_FATAL_ERROR(ahd);
 			panic("Loop 1\n");
 		}
 
@@ -8195,20 +8248,26 @@ ahd_handle_scsi_status(struct ahd_softc 
 				switch (SIU_PKTFAIL_CODE(siu)) {
 				case SIU_PFC_NONE:
 					printf("No packet failure found\n");
+					AHD_UNCORRECTABLE_ERROR(ahd);
 					break;
 				case SIU_PFC_CIU_FIELDS_INVALID:
 					printf("Invalid Command IU Field\n");
+					AHD_UNCORRECTABLE_ERROR(ahd);
 					break;
 				case SIU_PFC_TMF_NOT_SUPPORTED:
 					printf("TMF not supportd\n");
+					AHD_UNCORRECTABLE_ERROR(ahd);
 					break;
 				case SIU_PFC_TMF_FAILED:
 					printf("TMF failed\n");
+					AHD_UNCORRECTABLE_ERROR(ahd);
 					break;
 				case SIU_PFC_INVALID_TYPE_CODE:
 					printf("Invalid L_Q Type code\n");
+					AHD_UNCORRECTABLE_ERROR(ahd);
 					break;
 				case SIU_PFC_ILLEGAL_REQUEST:
+					AHD_UNCORRECTABLE_ERROR(ahd);
 					printf("Illegal request\n");
 				default:
 					break;
@@ -9281,6 +9340,7 @@ ahd_recover_commands(struct ahd_softc *a
 
 	printf("%s: Recovery Initiated - Card was %spaused\n", ahd_name(ahd),
 	       was_paused ? "" : "not ");
+	AHD_CORRECTABLE_ERROR(ahd);
 	ahd_dump_card_state(ahd);
 
 	ahd_pause_and_flushwork(ahd);
@@ -9507,6 +9567,7 @@ ahd_other_scb_timeout(struct ahd_softc *
  	       (scb->flags & SCB_OTHERTCL_TIMEOUT) != 0
 	       ? " again\n" : "\n");
 
+	AHD_UNCORRECTABLE_ERROR(ahd);
 	newtimeout = aic_get_timeout(scb);
 	scb->flags |= SCB_OTHERTCL_TIMEOUT;
 	found = 0;
@@ -9929,6 +9990,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd,
 		if (lstate != NULL) {
 			xpt_print_path(ccb->ccb_h.path);
 			printf("Lun already enabled\n");
+			AHD_CORRECTABLE_ERROR(ahd);
 			ccb->ccb_h.status = CAM_LUN_ALRDY_ENA;
 			return;
 		}

Modified: head/sys/dev/aic7xxx/aic79xx.h
==============================================================================
--- head/sys/dev/aic7xxx/aic79xx.h	Fri Nov 13 22:53:49 2009	(r199259)
+++ head/sys/dev/aic7xxx/aic79xx.h	Fri Nov 13 22:57:20 2009	(r199260)
@@ -1061,6 +1061,27 @@ typedef enum {
 #define AHD_MODE_UNKNOWN_MSK	AHD_MK_MSK(AHD_MODE_UNKNOWN)
 #define AHD_MODE_ANY_MSK (~0)
 
+typedef enum {
+	AHD_SYSCTL_ROOT,
+	AHD_SYSCTL_SUMMARY,
+	AHD_SYSCTL_DEBUG,
+	AHD_SYSCTL_NUMBER
+} ahd_sysctl_types_t;
+
+typedef enum {
+	AHD_ERRORS_CORRECTABLE,
+	AHD_ERRORS_UNCORRECTABLE,
+	AHD_ERRORS_FATAL,
+	AHD_ERRORS_NUMBER
+} ahd_sysctl_errors_t;
+
+#define	AHD_CORRECTABLE_ERROR(sc)					\
+	(((sc)->summerr[AHD_ERRORS_CORRECTABLE])++)
+#define	AHD_UNCORRECTABLE_ERROR(sc)					\
+	(((sc)->summerr[AHD_ERRORS_UNCORRECTABLE])++)
+#define	AHD_FATAL_ERROR(sc)						\
+	(((sc)->summerr[AHD_ERRORS_FATAL])++)
+
 typedef uint8_t ahd_mode_state;
 
 typedef void ahd_callback_t (void *);
@@ -1159,6 +1180,13 @@ struct ahd_softc {
 	uint32_t		  cmdcmplt_total;
 
 	/*
+	 * Errors statistics and printouts.
+	 */
+	struct sysctl_ctx_list	  sysctl_ctx[AHD_SYSCTL_NUMBER];
+	struct sysctl_oid	 *sysctl_tree[AHD_SYSCTL_NUMBER];
+	u_int			  summerr[AHD_ERRORS_NUMBER];
+
+	/*
 	 * Card characteristics
 	 */
 	ahd_chip		  chip;

Modified: head/sys/dev/aic7xxx/aic79xx_osm.c
==============================================================================
--- head/sys/dev/aic7xxx/aic79xx_osm.c	Fri Nov 13 22:53:49 2009	(r199259)
+++ head/sys/dev/aic7xxx/aic79xx_osm.c	Fri Nov 13 22:57:20 2009	(r199260)
@@ -77,6 +77,63 @@ static int	ahd_create_path(struct ahd_so
 				char channel, u_int target, u_int lun,
 				struct cam_path **path);
 
+static const char *ahd_sysctl_node_elements[] = {
+	"root",
+	"summary",
+	"debug"
+};
+
+static const char *ahd_sysctl_node_descriptions[] = {
+	"root error collection for aic79xx controllers",
+	"summary collection for aic79xx controllers",
+	"debug collection for aic79xx controllers"
+};
+
+static const char *ahd_sysctl_errors_elements[] = {
+	"Cerrors",
+	"Uerrors",
+	"Ferrors"
+};
+
+static const char *ahd_sysctl_errors_descriptions[] = {
+	"Correctable errors",
+	"Uncorrectable errors",
+	"Fatal errors"
+};
+
+static int
+ahd_set_debugcounters(SYSCTL_HANDLER_ARGS)
+{
+	struct ahd_softc *sc;
+	int error, tmpv;
+
+	tmpv = 0;
+	sc = arg1;
+	error = sysctl_handle_int(oidp, &tmpv, 0, req);
+	if (error != 0 || req->newptr == NULL)
+		return (error);
+	if (tmpv < 0 || tmpv >= AHD_ERRORS_NUMBER)
+		return (EINVAL);
+	sc->summerr[arg2] = tmpv;
+	return (0);
+}
+
+static int
+ahd_clear_allcounters(SYSCTL_HANDLER_ARGS)
+{
+	struct ahd_softc *sc;
+	int error, tmpv;
+
+	tmpv = 0;
+	sc = arg1;
+	error = sysctl_handle_int(oidp, &tmpv, 0, req);
+	if (error != 0 || req->newptr == NULL)
+		return (error);
+	if (tmpv != 0)
+		bzero(sc->summerr, sizeof(sc->summerr));
+	return (0);
+}
+
 static int
 ahd_create_path(struct ahd_softc *ahd, char channel, u_int target,
 	        u_int lun, struct cam_path **path)
@@ -88,6 +145,48 @@ ahd_create_path(struct ahd_softc *ahd, c
 				path_id, target, lun));
 }
 
+void
+ahd_sysctl(struct ahd_softc *ahd)
+{
+	u_int i;
+
+	for (i = 0; i < AHD_SYSCTL_NUMBER; i++)
+		sysctl_ctx_init(&ahd->sysctl_ctx[i]);
+
+	ahd->sysctl_tree[AHD_SYSCTL_ROOT] =
+	    SYSCTL_ADD_NODE(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT],
+			    SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO,
+			    device_get_nameunit(ahd->dev_softc), CTLFLAG_RD, 0,
+			    ahd_sysctl_node_descriptions[AHD_SYSCTL_ROOT]);
+	    SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT],
+			    SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]),
+			    OID_AUTO, "clear", CTLTYPE_UINT | CTLFLAG_RW, ahd,
+			    0, ahd_clear_allcounters, "IU",
+			    "Clear all counters");
+
+	for (i = AHD_SYSCTL_SUMMARY; i < AHD_SYSCTL_NUMBER; i++)
+		ahd->sysctl_tree[i] =
+		    SYSCTL_ADD_NODE(&ahd->sysctl_ctx[i],
+				    SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]),
+				    OID_AUTO, ahd_sysctl_node_elements[i],
+				    CTLFLAG_RD, 0,
+				    ahd_sysctl_node_descriptions[i]);
+
+	for (i = AHD_ERRORS_CORRECTABLE; i < AHD_ERRORS_NUMBER; i++) {
+		SYSCTL_ADD_UINT(&ahd->sysctl_ctx[AHD_SYSCTL_SUMMARY],
+				SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_SUMMARY]),
+				OID_AUTO, ahd_sysctl_errors_elements[i],
+				CTLFLAG_RD, &ahd->summerr[i], i,
+				ahd_sysctl_errors_descriptions[i]);
+		SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_DEBUG],
+				SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_DEBUG]),
+				OID_AUTO, ahd_sysctl_errors_elements[i],
+				CTLFLAG_RW | CTLTYPE_UINT, ahd, i,
+				ahd_set_debugcounters, "IU",
+				ahd_sysctl_errors_descriptions[i]);
+	}
+}
+
 int
 ahd_map_int(struct ahd_softc *ahd)
 {

Modified: head/sys/dev/aic7xxx/aic79xx_osm.h
==============================================================================
--- head/sys/dev/aic7xxx/aic79xx_osm.h	Fri Nov 13 22:53:49 2009	(r199259)
+++ head/sys/dev/aic7xxx/aic79xx_osm.h	Fri Nov 13 22:57:20 2009	(r199260)
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define AIC_PCI_CONFIG 1
 #include 
@@ -259,6 +260,7 @@ void	  ahd_platform_free(struct ahd_soft
 int	  ahd_map_int(struct ahd_softc *ahd);
 int	  ahd_attach(struct ahd_softc *);
 int	  ahd_softc_comp(struct ahd_softc *lahd, struct ahd_softc *rahd);
+void	  ahd_sysctl(struct ahd_softc *ahd);
 int	  ahd_detach(device_t);
 #define	ahd_platform_init(arg)
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 08:04:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66D931065670;
	Sat, 14 Nov 2009 08:04:38 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 562A58FC1B;
	Sat, 14 Nov 2009 08:04: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 nAE84cC7091208;
	Sat, 14 Nov 2009 08:04:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAE84ct3091206;
	Sat, 14 Nov 2009 08:04:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911140804.nAE84ct3091206@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 08:04:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199262 - head/sys/dev/ata/chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 08:04:38 -0000

Author: mav
Date: Sat Nov 14 08:04:38 2009
New Revision: 199262
URL: http://svn.freebsd.org/changeset/base/199262

Log:
  Disable PMP probing for Marvell AHCI controllers.
  It is not working for some reason. Linux does the same.

Modified:
  head/sys/dev/ata/chipsets/ata-ahci.c

Modified: head/sys/dev/ata/chipsets/ata-ahci.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-ahci.c	Sat Nov 14 04:46:24 2009	(r199261)
+++ head/sys/dev/ata/chipsets/ata-ahci.c	Sat Nov 14 08:04:38 2009	(r199262)
@@ -845,9 +845,12 @@ ata_ahci_reset(device_t dev)
 	      ((ch->pm_level == 0) ? ATA_AHCI_P_IX_PRC | ATA_AHCI_P_IX_PC : 0) |
 	      ATA_AHCI_P_IX_DP | ATA_AHCI_P_IX_UF | ATA_AHCI_P_IX_SDB |
 	      ATA_AHCI_P_IX_DS | ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR));
-
-    /* only probe for PortMultiplier if HW has support */
-    if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) {
+    /*
+     * Only probe for PortMultiplier if HW has support.
+     * Ignore Marvell, which is not working,
+     */
+    if ((ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) &&
+	    pci_get_vendor(ctlr->dev) != 0x11ab) {
 	signature = ata_ahci_softreset(dev, ATA_PM);
 	/* Workaround for some ATI chips, failing to soft-reset
 	 * when port multiplicator supported, but absent.

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 08:08:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB35C10656B1;
	Sat, 14 Nov 2009 08:08:49 +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 9AEA08FC13;
	Sat, 14 Nov 2009 08:08: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 nAE88nZe091310;
	Sat, 14 Nov 2009 08:08:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAE88noX091308;
	Sat, 14 Nov 2009 08:08:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911140808.nAE88noX091308@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 08:08:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199263 - head/sys/cam/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 08:08:49 -0000

Author: mav
Date: Sat Nov 14 08:08:49 2009
New Revision: 199263
URL: http://svn.freebsd.org/changeset/base/199263

Log:
  MFp4:
  Do not enable tagged queueing if controller reports 0 tags support.

Modified:
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Sat Nov 14 08:04:38 2009	(r199262)
+++ head/sys/cam/ata/ata_xpt.c	Sat Nov 14 08:08:49 2009	(r199263)
@@ -719,7 +719,8 @@ noerror:
 		/* XXX: If not all tags allowed, we must to tell SIM which are. */
 		if (path->device->mintags < path->bus->sim->max_tagged_dev_openings)
 			path->device->mintags = path->device->maxtags = 0;
-		if (path->device->mintags != 0) {
+		if (path->device->mintags != 0 &&
+		    path->bus->sim->max_tagged_dev_openings != 0) {
 			xpt_start_tags(path);
 		}
 		ata_device_transport(path);

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 09:31:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99424106566C;
	Sat, 14 Nov 2009 09:31:47 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8846F8FC15;
	Sat, 14 Nov 2009 09:31: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 nAE9VleW093012;
	Sat, 14 Nov 2009 09:31:47 GMT
	(envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAE9VlEx093010;
	Sat, 14 Nov 2009 09:31:47 GMT
	(envelope-from cperciva@svn.freebsd.org)
Message-Id: <200911140931.nAE9VlEx093010@svn.freebsd.org>
From: Colin Percival 
Date: Sat, 14 Nov 2009 09:31: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: r199264 - head/lib/libc/stdlib
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 09:31:47 -0000

Author: cperciva
Date: Sat Nov 14 09:31:47 2009
New Revision: 199264
URL: http://svn.freebsd.org/changeset/base/199264

Log:
  Change the utrace log entry for malloc_init from (0, 0, 0) to (-1, 0, 0)
  in order to distinguish it from free(NULL), which is logged as (0, 0, 0).
  
  Reviewed by:	jhb

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==============================================================================
--- head/lib/libc/stdlib/malloc.c	Sat Nov 14 08:08:49 2009	(r199263)
+++ head/lib/libc/stdlib/malloc.c	Sat Nov 14 09:31:47 2009	(r199264)
@@ -5116,7 +5116,7 @@ MALLOC_OUT:
 	arena_maxclass = chunksize - (arena_chunk_header_npages <<
 	    PAGE_SHIFT);
 
-	UTRACE(0, 0, 0);
+	UTRACE((void *)(intptr_t)(-1), 0, 0);
 
 #ifdef MALLOC_STATS
 	memset(&stats_chunks, 0, sizeof(chunk_stats_t));

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 09:33:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6E2D106568D;
	Sat, 14 Nov 2009 09:33:51 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D5F128FC14;
	Sat, 14 Nov 2009 09:33: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 nAE9XpVH093097;
	Sat, 14 Nov 2009 09:33:51 GMT
	(envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAE9XpvC093095;
	Sat, 14 Nov 2009 09:33:51 GMT
	(envelope-from cperciva@svn.freebsd.org)
Message-Id: <200911140933.nAE9XpvC093095@svn.freebsd.org>
From: Colin Percival 
Date: Sat, 14 Nov 2009 09:33: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: r199265 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 09:33:52 -0000

Author: cperciva
Date: Sat Nov 14 09:33:51 2009
New Revision: 199265
URL: http://svn.freebsd.org/changeset/base/199265

Log:
  Update malloc utrace structure parsing to reflect the change (r199265)
  in how malloc_init is logged from (0, 0, 0) to (-1, 0, 0).
  
  While we're here, simplify the logic.
  
  Reviewed by:	jhb (earlier version)

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

Modified: head/usr.bin/kdump/kdump.c
==============================================================================
--- head/usr.bin/kdump/kdump.c	Sat Nov 14 09:31:47 2009	(r199264)
+++ head/usr.bin/kdump/kdump.c	Sat Nov 14 09:33:51 2009	(r199265)
@@ -1121,17 +1121,14 @@ ktruser_malloc(int len, unsigned char *p
 {
 	struct utrace_malloc *ut = (struct utrace_malloc *)p;
 
-	if (ut->p == NULL) {
-		if (ut->s == 0 && ut->r == NULL)
-			printf("malloc_init()\n");
-		else
-			printf("%p = malloc(%zu)\n", ut->r, ut->s);
-	} else {
-		if (ut->s == 0)
-			printf("free(%p)\n", ut->p);
-		else
-			printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s);
-	}
+	if (ut->p == (void *)(intptr_t)(-1))
+		printf("malloc_init()\n");
+	else if (ut->s == 0)
+		printf("free(%p)\n", ut->p);
+	else if (ut->p == NULL)
+		printf("%p = malloc(%zu)\n", ut->r, ut->s);
+	else
+		printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s);
 }
 
 void

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 09:36:23 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35])
	by hub.freebsd.org (Postfix) with ESMTP id CAB9B1065672
	for ; Sat, 14 Nov 2009 09:36:23 +0000 (UTC)
	(envelope-from cperciva@freebsd.org)
Received: from xps.daemonology.net (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx2.freebsd.org (Postfix) with SMTP id 2F6E115184C
	for ; Sat, 14 Nov 2009 09:36:23 +0000 (UTC)
Received: (qmail 71038 invoked from network); 14 Nov 2009 09:36:22 -0000
Received: from unknown (HELO xps.daemonology.net) (127.0.0.1)
	by localhost with SMTP; 14 Nov 2009 09:36:22 -0000
Message-ID: <4AFE7A16.9040701@freebsd.org>
Date: Sat, 14 Nov 2009 01:36:22 -0800
From: Colin Percival 
User-Agent: Thunderbird 2.0.0.23 (X11/20090919)
MIME-Version: 1.0
To: Colin Percival 
References: <200911140933.nAE9XpvC093095@svn.freebsd.org>
In-Reply-To: <200911140933.nAE9XpvC093095@svn.freebsd.org>
X-Enigmail-Version: 0.96.0
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: r199265 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 09:36:23 -0000

Colin Percival wrote:
> New Revision: 199265
                ^^^^^^
> Log:
>   Update malloc utrace structure parsing to reflect the change (r199265)
                                                                  ^^^^^^^
No, this wasn't deliberately self-referential.  The above should read "the
change (r199264)". :-)

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 14:16:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A3BB1065672;
	Sat, 14 Nov 2009 14:16:04 +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 0FAE38FC19;
	Sat, 14 Nov 2009 14:16: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 nAEEG36s000981;
	Sat, 14 Nov 2009 14:16:03 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEEG3K8000980;
	Sat, 14 Nov 2009 14:16:03 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911141416.nAEEG3K8000980@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 14:16:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199268 - head/sys/i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 14:16:04 -0000

Author: mav
Date: Sat Nov 14 14:16:02 2009
New Revision: 199268
URL: http://svn.freebsd.org/changeset/base/199268

Log:
  Desktop Core2Duo/Core2Quad CPUs are unable to control frequency of single
  CPU core, only pair of them. As result, both cores are running on highest
  one of requested frequencies, and that is reported by status register.
  Such behavior confuses frequency validation logic, as it runs on only
  one core, as SMP is not yet launched, making EIST completely unusable.
  
  To workaround this, add check for validation result. If we haven't found
  at least two usable frequencies, then probably we are looking bad and have
  to trust data provided by BIOS as-is.

Modified:
  head/sys/i386/cpufreq/est.c

Modified: head/sys/i386/cpufreq/est.c
==============================================================================
--- head/sys/i386/cpufreq/est.c	Sat Nov 14 12:19:00 2009	(r199267)
+++ head/sys/i386/cpufreq/est.c	Sat Nov 14 14:16:02 2009	(r199268)
@@ -1088,7 +1088,7 @@ est_acpi_info(device_t dev, freq_info **
 	struct cf_setting *sets;
 	freq_info *table;
 	device_t perf_dev;
-	int count, error, i, j;
+	int count, error, i, j, check = 1;
 	uint16_t saved_id16;
 
 	perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
@@ -1113,13 +1113,14 @@ est_acpi_info(device_t dev, freq_info **
 		goto out;
 	}
 	est_get_id16(&saved_id16);
+restart:
 	for (i = 0, j = 0; i < count; i++) {
 		/*
 		 * Confirm id16 value is correct.
 		 */
 		if (sets[i].freq > 0) {
-			error = est_set_id16(dev, sets[i].spec[0], 1);
-			if (error != 0) {
+			if (check &&
+			    est_set_id16(dev, sets[i].spec[0], 1) != 0) {
 				if (bootverbose) 
 					device_printf(dev, "Invalid freq %u, "
 					    "ignored.\n", sets[i].freq);
@@ -1132,6 +1133,14 @@ est_acpi_info(device_t dev, freq_info **
 			}
 		}
 	}
+	if (count >= 2 && j < 2) {
+		if (bootverbose) {
+			device_printf(dev, "Too much freqs ignored. "
+			    "May be a check problem. Restore all.\n");
+		}
+		check = 0;
+		goto restart;
+	}
 	/* restore saved setting */
 	est_set_id16(dev, saved_id16, 0);
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 14:29:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 625EB1065670;
	Sat, 14 Nov 2009 14:29:18 +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 518908FC15;
	Sat, 14 Nov 2009 14:29: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 nAEETISS001279;
	Sat, 14 Nov 2009 14:29:18 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEETI5w001277;
	Sat, 14 Nov 2009 14:29:18 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911141429.nAEETI5w001277@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 14:29: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: r199269 - head/sys/i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 14:29:18 -0000

Author: mav
Date: Sat Nov 14 14:29:18 2009
New Revision: 199269
URL: http://svn.freebsd.org/changeset/base/199269

Log:
  Retry only once, if BIOS is completely broken and gives zero freqs.

Modified:
  head/sys/i386/cpufreq/est.c

Modified: head/sys/i386/cpufreq/est.c
==============================================================================
--- head/sys/i386/cpufreq/est.c	Sat Nov 14 14:16:02 2009	(r199268)
+++ head/sys/i386/cpufreq/est.c	Sat Nov 14 14:29:18 2009	(r199269)
@@ -1133,7 +1133,7 @@ restart:
 			}
 		}
 	}
-	if (count >= 2 && j < 2) {
+	if (check && count >= 2 && j < 2) {
 		if (bootverbose) {
 			device_printf(dev, "Too much freqs ignored. "
 			    "May be a check problem. Restore all.\n");

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 15:08:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BACD6106566C;
	Sat, 14 Nov 2009 15:08:44 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9F5E8FC1E;
	Sat, 14 Nov 2009 15: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 nAEF8iwv002127;
	Sat, 14 Nov 2009 15:08:44 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEF8iVx002125;
	Sat, 14 Nov 2009 15:08:44 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200911141508.nAEF8iVx002125@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 14 Nov 2009 15: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: r199270 - head/libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 15:08:44 -0000

Author: rwatson
Date: Sat Nov 14 15:08:44 2009
New Revision: 199270
URL: http://svn.freebsd.org/changeset/base/199270

Log:
  Fix white space in rtld runtime error printf.
  
  MFC after:	3 days

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Sat Nov 14 14:29:18 2009	(r199269)
+++ head/libexec/rtld-elf/rtld.c	Sat Nov 14 15:08:44 2009	(r199270)
@@ -3425,7 +3425,7 @@ locate_dependency(const Obj_Entry *obj, 
 	if (object_match_name(needed->obj, name))
 	    return needed->obj;
     }
-    _rtld_error("%s: Unexpected  inconsistency: dependency %s not found",
+    _rtld_error("%s: Unexpected inconsistency: dependency %s not found",
 	obj->path, name);
     die();
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 15:56:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AAC91065676;
	Sat, 14 Nov 2009 15:56:23 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 79BD48FC17;
	Sat, 14 Nov 2009 15:56: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 nAEFuNpx003132;
	Sat, 14 Nov 2009 15:56:23 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEFuNuC003128;
	Sat, 14 Nov 2009 15:56:23 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200911141556.nAEFuNuC003128@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Sat, 14 Nov 2009 15:56: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: r199271 - head/share/timedef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 15:56:23 -0000

Author: ume
Date: Sat Nov 14 15:56:23 2009
New Revision: 199271
URL: http://svn.freebsd.org/changeset/base/199271

Log:
  Since %b contains unit, %b is not suitable for c_fmt, now.  Use %_m
  instead.

Modified:
  head/share/timedef/ja_JP.SJIS.src
  head/share/timedef/ja_JP.UTF-8.src
  head/share/timedef/ja_JP.eucJP.src

Modified: head/share/timedef/ja_JP.SJIS.src
==============================================================================
--- head/share/timedef/ja_JP.SJIS.src	Sat Nov 14 15:08:44 2009	(r199270)
+++ head/share/timedef/ja_JP.SJIS.src	Sat Nov 14 15:56:23 2009	(r199271)
@@ -65,7 +65,7 @@
 #
 # just following tradition...
 # %a %b %e %H:%M:%S %Y
-%a %b/%e %T %Y
+%a %_m/%e %T %Y
 #
 # am
 #

Modified: head/share/timedef/ja_JP.UTF-8.src
==============================================================================
--- head/share/timedef/ja_JP.UTF-8.src	Sat Nov 14 15:08:44 2009	(r199270)
+++ head/share/timedef/ja_JP.UTF-8.src	Sat Nov 14 15:56:23 2009	(r199271)
@@ -64,7 +64,7 @@
 #
 # just following tradition...
 # %a %b %e %H:%M:%S %Y
-%a %b/%e %T %Y
+%a %_m/%e %T %Y
 #
 # am
 #

Modified: head/share/timedef/ja_JP.eucJP.src
==============================================================================
--- head/share/timedef/ja_JP.eucJP.src	Sat Nov 14 15:08:44 2009	(r199270)
+++ head/share/timedef/ja_JP.eucJP.src	Sat Nov 14 15:56:23 2009	(r199271)
@@ -64,7 +64,7 @@
 #
 # just following tradition...
 # %a %b %e %H:%M:%S %Y
-%a %b/%e %T %Y
+%a %_m/%e %T %Y
 #
 # am
 #

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 16:20:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD6951065670;
	Sat, 14 Nov 2009 16:20:07 +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 A1D198FC13;
	Sat, 14 Nov 2009 16:20: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 nAEGK7eq003798;
	Sat, 14 Nov 2009 16:20:07 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEGK7hl003796;
	Sat, 14 Nov 2009 16:20:07 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911141620.nAEGK7hl003796@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 16:20: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: r199273 - head/sys/i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 16:20:07 -0000

Author: mav
Date: Sat Nov 14 16:20:07 2009
New Revision: 199273
URL: http://svn.freebsd.org/changeset/base/199273

Log:
  Previous solution appeared to be unsufficient. After additional testing
  I have found that it is not only desktop CPUs problem. but mobile also.
  Probably AP on laptops just started initially at lower frequency, hiding
  the problem.
  
  Disable frequency validation by default, for systems with more then one CPU,
  until we can implement it properly. It looks like making more harm now then
  benefits. Add 'hw.est.strict' loader tunable to control it.
  
  Now my iXsystems Invincibook is able to run at 800MHz lowest frequency,
  instead of 1200MHz before, when 800MHz was incorrectly reported invalid.

Modified:
  head/sys/i386/cpufreq/est.c

Modified: head/sys/i386/cpufreq/est.c
==============================================================================
--- head/sys/i386/cpufreq/est.c	Sat Nov 14 16:14:51 2009	(r199272)
+++ head/sys/i386/cpufreq/est.c	Sat Nov 14 16:20:07 2009	(r199273)
@@ -96,6 +96,8 @@ struct est_softc {
 
 static int msr_info_enabled = 0;
 TUNABLE_INT("hw.est.msr_info", &msr_info_enabled);
+static int strict = -1;
+TUNABLE_INT("hw.est.strict", &strict);
 
 /* Default bus clock value for Centrino processors. */
 #define INTEL_BUS_CLK		100
@@ -1025,6 +1027,9 @@ est_attach(device_t dev)
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 
+	/* On SMP system we can't guarantie independent freq setting. */
+	if (strict == -1 && mp_ncpus > 1)
+		strict = 0;
 	/* Check CPU for supported settings. */
 	if (est_get_info(dev))
 		return (ENXIO);
@@ -1088,7 +1093,7 @@ est_acpi_info(device_t dev, freq_info **
 	struct cf_setting *sets;
 	freq_info *table;
 	device_t perf_dev;
-	int count, error, i, j, check = 1;
+	int count, error, i, j;
 	uint16_t saved_id16;
 
 	perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
@@ -1113,34 +1118,29 @@ est_acpi_info(device_t dev, freq_info **
 		goto out;
 	}
 	est_get_id16(&saved_id16);
-restart:
 	for (i = 0, j = 0; i < count; i++) {
 		/*
 		 * Confirm id16 value is correct.
 		 */
 		if (sets[i].freq > 0) {
-			if (check &&
-			    est_set_id16(dev, sets[i].spec[0], 1) != 0) {
+			error = est_set_id16(dev, sets[i].spec[0], 1);
+			if (error != 0 && strict) {
 				if (bootverbose) 
 					device_printf(dev, "Invalid freq %u, "
 					    "ignored.\n", sets[i].freq);
-			} else {
-				table[j].freq = sets[i].freq;
-				table[j].volts = sets[i].volts;
-				table[j].id16 = sets[i].spec[0];
-				table[j].power = sets[i].power;
-				++j;
+				continue;
+			} else if (error != 0 && bootverbose) {
+				device_printf(dev, "Can't check freq %u, "
+				    "it may be invalid\n",
+				    sets[i].freq);
 			}
+			table[j].freq = sets[i].freq;
+			table[j].volts = sets[i].volts;
+			table[j].id16 = sets[i].spec[0];
+			table[j].power = sets[i].power;
+			++j;
 		}
 	}
-	if (check && count >= 2 && j < 2) {
-		if (bootverbose) {
-			device_printf(dev, "Too much freqs ignored. "
-			    "May be a check problem. Restore all.\n");
-		}
-		check = 0;
-		goto restart;
-	}
 	/* restore saved setting */
 	est_set_id16(dev, saved_id16, 0);
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 18:14:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1075106566B;
	Sat, 14 Nov 2009 18:14:07 +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 A02EF8FC12;
	Sat, 14 Nov 2009 18:14: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 nAEIE7bg008532;
	Sat, 14 Nov 2009 18:14:07 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEIE7ku008530;
	Sat, 14 Nov 2009 18:14:07 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200911141814.nAEIE7ku008530@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 14 Nov 2009 18:14: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: r199274 - head/sys/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 18:14:07 -0000

Author: marcel
Date: Sat Nov 14 18:14:07 2009
New Revision: 199274
URL: http://svn.freebsd.org/changeset/base/199274

Log:
  Fix an obvious panic by not casting from a pointer that is 4-bytes
  alignment to a type that needs 8-byte alignment, and thus causing
  misaligned memory references.
  
  MFC after:	1 week

Modified:
  head/sys/nfsserver/nfs_fha.c

Modified: head/sys/nfsserver/nfs_fha.c
==============================================================================
--- head/sys/nfsserver/nfs_fha.c	Sat Nov 14 16:20:07 2009	(r199273)
+++ head/sys/nfsserver/nfs_fha.c	Sat Nov 14 18:14:07 2009	(r199274)
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -206,7 +207,11 @@ fha_extract_info(struct svc_req *req, st
 	if (error)
 		goto out;
 
-	i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data);
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+	i->fh = le64dec(fh.fh_generic.fh_fid.fid_data);
+#else
+	i->fh = be64dec(fh.fh_generic.fh_fid.fid_data);
+#endif
 
 	/* Content ourselves with zero offset for all but reads. */
 	if (procnum != NFSPROC_READ)

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 20:06:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A70021065696;
	Sat, 14 Nov 2009 20:06:04 +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 965998FC0C;
	Sat, 14 Nov 2009 20:06: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 nAEK64C1012025;
	Sat, 14 Nov 2009 20:06:04 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEK64rM012023;
	Sat, 14 Nov 2009 20:06:04 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911142006.nAEK64rM012023@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 20:06: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: r199278 - head/sys/dev/ahci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 20:06:04 -0000

Author: mav
Date: Sat Nov 14 20:06:04 2009
New Revision: 199278
URL: http://svn.freebsd.org/changeset/base/199278

Log:
  MFp4:
  Check SNCQ HBA capability bit when reporting NCQ support to CAM.

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Sat Nov 14 18:54:25 2009	(r199277)
+++ head/sys/dev/ahci/ahci.c	Sat Nov 14 20:06:04 2009	(r199278)
@@ -734,7 +734,9 @@ ahci_ch_attach(device_t dev)
 	/* Construct SIM entry */
 	ch->sim = cam_sim_alloc(ahciaction, ahcipoll, "ahcich", ch,
 	    device_get_unit(dev), &ch->mtx,
-	    min(2, ch->numslots), ch->numslots, devq);
+	    min(2, ch->numslots),
+	    (ch->caps & AHCI_CAP_SNCQ) ? ch->numslots : 0,
+	    devq);
 	if (ch->sim == NULL) {
 		device_printf(dev, "unable to allocate sim\n");
 		error = ENOMEM;
@@ -2119,7 +2121,9 @@ ahciaction(struct cam_sim *sim, union cc
 		struct ccb_pathinq *cpi = &ccb->cpi;
 
 		cpi->version_num = 1; /* XXX??? */
-		cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE;
+		cpi->hba_inquiry = PI_SDTR_ABLE;
+		if (ch->caps & AHCI_CAP_SNCQ)
+			cpi->hba_inquiry |= PI_TAG_ABLE;
 		if (ch->caps & AHCI_CAP_SPM)
 			cpi->hba_inquiry |= PI_SATAPM;
 		cpi->target_sprt = 0;

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 20:13:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3B1A1065670;
	Sat, 14 Nov 2009 20:13:38 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E2C548FC0A;
	Sat, 14 Nov 2009 20:13: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 nAEKDcSi012202;
	Sat, 14 Nov 2009 20:13:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEKDcJt012198;
	Sat, 14 Nov 2009 20:13:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911142013.nAEKDcJt012198@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 20:13: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: r199279 - in head/sys/cam: . scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 20:13:39 -0000

Author: mav
Date: Sat Nov 14 20:13:38 2009
New Revision: 199279
URL: http://svn.freebsd.org/changeset/base/199279

Log:
  MFp4:
  Fix several device freeze counting bugs.

Modified:
  head/sys/cam/cam_periph.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_ch.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Sat Nov 14 20:06:04 2009	(r199278)
+++ head/sys/cam/cam_periph.c	Sat Nov 14 20:13:38 2009	(r199279)
@@ -981,16 +981,21 @@ camperiphdone(struct cam_periph *periph,
 {
 	union ccb      *saved_ccb;
 	cam_status	status;
-	int		frozen;
+	int		frozen = 0;
 	int		sense;
 	struct scsi_start_stop_unit *scsi_cmd;
 	u_int32_t	relsim_flags, timeout;
-	u_int32_t	qfrozen_cnt;
-	int		xpt_done_ccb;
+	int		xpt_done_ccb = FALSE;
 
-	xpt_done_ccb = FALSE;
 	status = done_ccb->ccb_h.status;
-	frozen = (status & CAM_DEV_QFRZN) != 0;
+	if (status & CAM_DEV_QFRZN) {
+		frozen = 1;
+		/*
+		 * Clear freeze flag now for case of retry,
+		 * freeze will be dropped later.
+		 */
+		done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
+	}
 	sense  = (status & CAM_AUTOSNS_VALID) != 0;
 	status &= CAM_STATUS_MASK;
 
@@ -998,17 +1003,6 @@ camperiphdone(struct cam_periph *periph,
 	relsim_flags = 0;
 	saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr;
 
-	/* 
-	 * Unfreeze the queue once if it is already frozen..
-	 */
-	if (frozen != 0) {
-		qfrozen_cnt = cam_release_devq(done_ccb->ccb_h.path,
-					      /*relsim_flags*/0,
-					      /*openings*/0,
-					      /*timeout*/0,
-					      /*getcount_only*/0);
-	}
-
 	switch (status) {
 	case CAM_REQ_CMP:
 	{
@@ -1185,14 +1179,33 @@ camperiphdone(struct cam_periph *periph,
 	 */
 	if (done_ccb->ccb_h.retry_count > 0)
 		done_ccb->ccb_h.retry_count--;
-
-	qfrozen_cnt = cam_release_devq(done_ccb->ccb_h.path,
-				      /*relsim_flags*/relsim_flags,
-				      /*openings*/0,
-				      /*timeout*/timeout,
-				      /*getcount_only*/0);
-	if (xpt_done_ccb == TRUE)
+	/*
+	 * Drop freeze taken due to CAM_DEV_QFREEZE flag set on recovery
+	 * request.
+	 */
+	cam_release_devq(done_ccb->ccb_h.path,
+			 /*relsim_flags*/relsim_flags,
+			 /*openings*/0,
+			 /*timeout*/timeout,
+			 /*getcount_only*/0);
+	if (xpt_done_ccb == TRUE) {
+		/*
+		 * Copy frozen flag from recovery request if it is set there
+		 * for some reason.
+		 */
+		if (frozen != 0)
+			done_ccb->ccb_h.status |= CAM_DEV_QFRZN;
 		(*done_ccb->ccb_h.cbfcnp)(periph, done_ccb);
+	} else {
+		/* Drop freeze taken, if this recovery request got error. */
+		if (frozen != 0) {
+			cam_release_devq(done_ccb->ccb_h.path,
+				 /*relsim_flags*/0,
+				 /*openings*/0,
+				 /*timeout*/0,
+				 /*getcount_only*/0);
+		}
+	}
 }
 
 /*

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Sat Nov 14 20:06:04 2009	(r199278)
+++ head/sys/cam/scsi/scsi_cd.c	Sat Nov 14 20:13:38 2009	(r199279)
@@ -1570,7 +1570,8 @@ cddone(struct cam_periph *periph, union 
 			bp->bio_resid = bp->bio_bcount;
 			bp->bio_error = error;
 			bp->bio_flags |= BIO_ERROR;
-			cam_release_devq(done_ccb->ccb_h.path,
+			if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
+				cam_release_devq(done_ccb->ccb_h.path,
 					 /*relsim_flags*/0,
 					 /*reduction*/0,
 					 /*timeout*/0,
@@ -1658,7 +1659,8 @@ cddone(struct cam_periph *periph, union 
 				struct ccb_getdev cgd;
 
 				/* Don't wedge this device's queue */
-				cam_release_devq(done_ccb->ccb_h.path,
+				if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
+					cam_release_devq(done_ccb->ccb_h.path,
 						 /*relsim_flags*/0,
 						 /*reduction*/0,
 						 /*timeout*/0,

Modified: head/sys/cam/scsi/scsi_ch.c
==============================================================================
--- head/sys/cam/scsi/scsi_ch.c	Sat Nov 14 20:06:04 2009	(r199278)
+++ head/sys/cam/scsi/scsi_ch.c	Sat Nov 14 20:13:38 2009	(r199279)
@@ -606,7 +606,8 @@ chdone(struct cam_periph *periph, union 
 					retry_scheduled = 0;
 
 				/* Don't wedge this device's queue */
-				cam_release_devq(done_ccb->ccb_h.path,
+				if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
+					cam_release_devq(done_ccb->ccb_h.path,
 						 /*relsim_flags*/0,
 						 /*reduction*/0,
 						 /*timeout*/0,

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 20:23:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A11BB1065672;
	Sat, 14 Nov 2009 20:23:20 +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 8FF938FC14;
	Sat, 14 Nov 2009 20:23:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAEKNKc3012441;
	Sat, 14 Nov 2009 20:23:20 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEKNKDl012439;
	Sat, 14 Nov 2009 20:23:20 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911142023.nAEKNKDl012439@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 20:23: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: r199280 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 20:23:20 -0000

Author: mav
Date: Sat Nov 14 20:23:20 2009
New Revision: 199280
URL: http://svn.freebsd.org/changeset/base/199280

Log:
  MFp4:
  Remove code that years ago was closing race between request submission
  to SIM and device/SIM freeze. That race become impossible after moving from
  spl to mutex locking, while this workaround causes some unexpected effects.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Sat Nov 14 20:13:38 2009	(r199279)
+++ head/sys/cam/cam_xpt.c	Sat Nov 14 20:23:20 2009	(r199280)
@@ -3273,16 +3273,13 @@ xpt_run_dev_sendq(struct cam_eb *bus)
 
 	devq->send_queue.qfrozen_cnt++;
 	while ((devq->send_queue.entries > 0)
-	    && (devq->send_openings > 0)) {
+	    && (devq->send_openings > 0)
+	    && (devq->send_queue.qfrozen_cnt <= 1)) {
 		struct	cam_ed_qinfo *qinfo;
 		struct	cam_ed *device;
 		union ccb *work_ccb;
 		struct	cam_sim *sim;
 
-	    	if (devq->send_queue.qfrozen_cnt > 1) {
-			break;
-		}
-
 		qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->send_queue,
 							   CAMQ_HEAD);
 		device = qinfo->device;
@@ -3330,9 +3327,7 @@ xpt_run_dev_sendq(struct cam_eb *bus)
 			}
 			mtx_unlock(&xsoftc.xpt_lock);
 		}
-		devq->active_dev = device;
 		cam_ccbq_remove_ccb(&device->ccbq, work_ccb);
-
 		cam_ccbq_send_ccb(&device->ccbq, work_ccb);
 
 		devq->send_openings--;
@@ -3370,8 +3365,6 @@ xpt_run_dev_sendq(struct cam_eb *bus)
 		 */
 		sim = work_ccb->ccb_h.path->bus->sim;
 		(*(sim->sim_action))(sim, work_ccb);
-
-		devq->active_dev = NULL;
 	}
 	devq->send_queue.qfrozen_cnt--;
 }
@@ -4102,45 +4095,18 @@ xpt_dev_async_default(u_int32_t async_co
 u_int32_t
 xpt_freeze_devq(struct cam_path *path, u_int count)
 {
-	struct ccb_hdr *ccbh;
 
 	mtx_assert(path->bus->sim->mtx, MA_OWNED);
-
 	path->device->ccbq.queue.qfrozen_cnt += count;
-
-	/*
-	 * Mark the last CCB in the queue as needing
-	 * to be requeued if the driver hasn't
-	 * changed it's state yet.  This fixes a race
-	 * where a ccb is just about to be queued to
-	 * a controller driver when it's interrupt routine
-	 * freezes the queue.  To completly close the
-	 * hole, controller drives must check to see
-	 * if a ccb's status is still CAM_REQ_INPROG
-	 * just before they queue
-	 * the CCB.  See ahc_action/ahc_freeze_devq for
-	 * an example.
-	 */
-	ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_tailq);
-	if (ccbh && ccbh->status == CAM_REQ_INPROG)
-		ccbh->status = CAM_REQUEUE_REQ;
 	return (path->device->ccbq.queue.qfrozen_cnt);
 }
 
 u_int32_t
 xpt_freeze_simq(struct cam_sim *sim, u_int count)
 {
-	mtx_assert(sim->mtx, MA_OWNED);
 
+	mtx_assert(sim->mtx, MA_OWNED);
 	sim->devq->send_queue.qfrozen_cnt += count;
-	if (sim->devq->active_dev != NULL) {
-		struct ccb_hdr *ccbh;
-
-		ccbh = TAILQ_LAST(&sim->devq->active_dev->ccbq.active_ccbs,
-				  ccb_hdr_tailq);
-		if (ccbh && ccbh->status == CAM_REQ_INPROG)
-			ccbh->status = CAM_REQUEUE_REQ;
-	}
 	return (sim->devq->send_queue.qfrozen_cnt);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 20:30:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 053491065693;
	Sat, 14 Nov 2009 20:30: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 CE7768FC14;
	Sat, 14 Nov 2009 20:30: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 nAEKUg7W012611;
	Sat, 14 Nov 2009 20:30:42 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEKUgUb012607;
	Sat, 14 Nov 2009 20:30:42 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200911142030.nAEKUgUb012607@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Nov 2009 20:30: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: r199281 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 20:30:43 -0000

Author: mav
Date: Sat Nov 14 20:30:42 2009
New Revision: 199281
URL: http://svn.freebsd.org/changeset/base/199281

Log:
  MFp4:
  Some more missed parts from previous commits.

Modified:
  head/sys/cam/cam_periph.c
  head/sys/cam/cam_queue.c
  head/sys/cam/cam_queue.h

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Sat Nov 14 20:23:20 2009	(r199280)
+++ head/sys/cam/cam_periph.c	Sat Nov 14 20:30:42 2009	(r199281)
@@ -1465,6 +1465,11 @@ camperiphscsisenseerror(union ccb *ccb, 
 				action_string = "No recovery CCB supplied";
 				goto sense_error_done;
 			}
+			/*
+			 * Clear freeze flag for original request here, as
+			 * this freeze will be dropped as part of ERESTART.
+			 */
+			ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
 			bcopy(ccb, save_ccb, sizeof(*save_ccb));
 			print_ccb = save_ccb;
 			periph->flags |= CAM_PERIPH_RECOVERY_INPROG;

Modified: head/sys/cam/cam_queue.c
==============================================================================
--- head/sys/cam/cam_queue.c	Sat Nov 14 20:23:20 2009	(r199280)
+++ head/sys/cam/cam_queue.c	Sat Nov 14 20:30:42 2009	(r199281)
@@ -334,7 +334,6 @@ cam_ccbq_init(struct cam_ccbq *ccbq, int
 	}
 	ccbq->devq_openings = openings;
 	ccbq->dev_openings = openings;	
-	TAILQ_INIT(&ccbq->active_ccbs);
 	return (0);
 }
 

Modified: head/sys/cam/cam_queue.h
==============================================================================
--- head/sys/cam/cam_queue.h	Sat Nov 14 20:23:20 2009	(r199280)
+++ head/sys/cam/cam_queue.h	Sat Nov 14 20:30:42 2009	(r199281)
@@ -60,7 +60,6 @@ struct cam_ccbq {
 	int	dev_openings;	
 	int	dev_active;
 	int	held;
-	struct	ccb_hdr_tailq active_ccbs;
 };
 
 struct cam_ed;
@@ -209,9 +208,6 @@ static __inline void
 cam_ccbq_send_ccb(struct cam_ccbq *ccbq, union ccb *send_ccb)
 {
 
-	TAILQ_INSERT_TAIL(&ccbq->active_ccbs,
-			  &(send_ccb->ccb_h),
-			  xpt_links.tqe);
 	send_ccb->ccb_h.pinfo.index = CAM_ACTIVE_INDEX;
 	ccbq->dev_active++;
 	ccbq->dev_openings--;		
@@ -220,8 +216,7 @@ cam_ccbq_send_ccb(struct cam_ccbq *ccbq,
 static __inline void
 cam_ccbq_ccb_done(struct cam_ccbq *ccbq, union ccb *done_ccb)
 {
-	TAILQ_REMOVE(&ccbq->active_ccbs, &done_ccb->ccb_h,
-		     xpt_links.tqe);
+
 	ccbq->dev_active--;
 	ccbq->dev_openings++;	
 	ccbq->held++;

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 21:52:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1BF61065679;
	Sat, 14 Nov 2009 21:52:36 +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 90B148FC24;
	Sat, 14 Nov 2009 21:52:36 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nAELkSVZ097040;
	Sat, 14 Nov 2009 14:46:28 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Sat, 14 Nov 2009 14:46:44 -0700 (MST)
Message-Id: <20091114.144644.580455928.imp@bsdimp.com>
To: marcel@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <200911141814.nAEIE7ku008530@svn.freebsd.org>
References: <200911141814.nAEIE7ku008530@svn.freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199274 - head/sys/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 21:52:36 -0000

In message: <200911141814.nAEIE7ku008530@svn.freebsd.org>
            Marcel Moolenaar  writes:
: Author: marcel
: Date: Sat Nov 14 18:14:07 2009
: New Revision: 199274
: URL: http://svn.freebsd.org/changeset/base/199274
: 
: Log:
:   Fix an obvious panic by not casting from a pointer that is 4-bytes
:   alignment to a type that needs 8-byte alignment, and thus causing
:   misaligned memory references.
:   
:   MFC after:	1 week
: 
: Modified:
:   head/sys/nfsserver/nfs_fha.c
: 
: Modified: head/sys/nfsserver/nfs_fha.c
: ==============================================================================
: --- head/sys/nfsserver/nfs_fha.c	Sat Nov 14 16:20:07 2009	(r199273)
: +++ head/sys/nfsserver/nfs_fha.c	Sat Nov 14 18:14:07 2009	(r199274)
: @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
:  #include 
:  #include 
:  #include 
: +#include 
:  #include 
:  #include 
:  #include 
: @@ -206,7 +207,11 @@ fha_extract_info(struct svc_req *req, st
:  	if (error)
:  		goto out;
:  
: -	i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data);
: +#if _BYTE_ORDER == _LITTLE_ENDIAN
: +	i->fh = le64dec(fh.fh_generic.fh_fid.fid_data);
: +#else
: +	i->fh = be64dec(fh.fh_generic.fh_fid.fid_data);
: +#endif
:  
:  	/* Content ourselves with zero offset for all but reads. */
:  	if (procnum != NFSPROC_READ)

Wouldn't memcpy do the same thing without the need for an ifdef?

	memcpy(&i->fh, fh.fh_generic.fh_fid.fid_data, sizeof(uint64_t));

Warner


From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 22:08:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E319D1065694;
	Sat, 14 Nov 2009 22:08:32 +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 CF3A78FC1D;
	Sat, 14 Nov 2009 22:08: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 nAEM8W3q014783;
	Sat, 14 Nov 2009 22:08:32 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEM8Wh5014782;
	Sat, 14 Nov 2009 22:08:32 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200911142208.nAEM8Wh5014782@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 14 Nov 2009 22:08: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: r199282 - in head: bin/sh tools/regression/bin/sh/parser
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 22:08:33 -0000

Author: jilles
Date: Sat Nov 14 22:08:32 2009
New Revision: 199282
URL: http://svn.freebsd.org/changeset/base/199282

Log:
  sh: Allow a newline before "in" in a for command, as required by POSIX.

Added:
  head/tools/regression/bin/sh/parser/for1.0   (contents, props changed)
Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Sat Nov 14 20:30:42 2009	(r199281)
+++ head/bin/sh/parser.c	Sat Nov 14 22:08:32 2009	(r199282)
@@ -364,7 +364,9 @@ TRACE(("expecting DO got %s %s\n", tokna
 		n1 = (union node *)stalloc(sizeof (struct nfor));
 		n1->type = NFOR;
 		n1->nfor.var = wordtext;
-		if (readtoken() == TWORD && ! quoteflag && equal(wordtext, "in")) {
+		while (readtoken() == TNL)
+			;
+		if (lasttoken == TWORD && ! quoteflag && equal(wordtext, "in")) {
 			app = ≈
 			while (readtoken() == TWORD) {
 				n2 = (union node *)stalloc(sizeof (struct narg));

Added: head/tools/regression/bin/sh/parser/for1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/for1.0	Sat Nov 14 22:08:32 2009	(r199282)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+nl='
+'
+list=' a b c'
+for s1 in "$nl" " "; do
+	for s2 in "$nl" ";"; do
+		for s3 in "$nl" " "; do
+			r=''
+			eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done"
+			[ "$r" = "$list" ] || exit 1
+		done
+	done
+done
+set -- $list
+for s2 in "$nl" " " ";"; do # s2=";" is an extension to POSIX
+	for s3 in "$nl" " "; do
+		r=''
+		eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
+		[ "$r" = "$list" ] || exit 1
+	done
+done
+for s1 in "$nl" " "; do
+	for s2 in "$nl" ";"; do
+		for s3 in "$nl" " "; do
+			eval "for i${s1}in${s2}do${s3}exit 1; done"
+		done
+	done
+done

From owner-svn-src-head@FreeBSD.ORG  Sat Nov 14 22:20:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3EBC1065679;
	Sat, 14 Nov 2009 22:20:54 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100])
	by mx1.freebsd.org (Postfix) with ESMTP id DB87E8FC17;
	Sat, 14 Nov 2009 22:20:54 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp025.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KT400L0TE1U2T80@asmtp025.mac.com>; Sat,
	14 Nov 2009 14:20:20 -0800 (PST)
From: Marcel Moolenaar 
In-reply-to: <20091114.144644.580455928.imp@bsdimp.com>
Date: Sat, 14 Nov 2009 14:20:18 -0800
Message-id: <9B515A18-6E30-4FF2-B739-E36BF3E0B84C@mac.com>
References: <200911141814.nAEIE7ku008530@svn.freebsd.org>
	<20091114.144644.580455928.imp@bsdimp.com>
To: "M. Warner Losh" 
X-Mailer: Apple Mail (2.1077)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r199274 - head/sys/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 14 Nov 2009 22:20:55 -0000


On Nov 14, 2009, at 1:46 PM, M. Warner Losh wrote:

> : @@ -206,7 +207,11 @@ fha_extract_info(struct svc_req *req, st
> :  	if (error)
> :  		goto out;
> :  
> : -	i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data);
> : +#if _BYTE_ORDER == _LITTLE_ENDIAN
> : +	i->fh = le64dec(fh.fh_generic.fh_fid.fid_data);
> : +#else
> : +	i->fh = be64dec(fh.fh_generic.fh_fid.fid_data);
> : +#endif
> :  
> :  	/* Content ourselves with zero offset for all but reads. */
> :  	if (procnum != NFSPROC_READ)
> 
> Wouldn't memcpy do the same thing without the need for an ifdef?
> 
> 	memcpy(&i->fh, fh.fh_generic.fh_fid.fid_data, sizeof(uint64_t));

Yes, it would. Shall I change it to use memcpy?

-- 
Marcel Moolenaar
xcllnt@mac.com